[Backport to rh-test] fix(telemetry): remove redundant run tracking; keep click analytics + single execution event (#6552)

## Summary
Manual backport of #6518 to the `rh-test` branch.

Deduplicates workflow run telemetry and keeps a single source of truth
for execution while retaining click analytics and attributing initiator
source.

- Keep execution tracking in one place via `trackWorkflowExecution()`
- Keep click analytics via `trackRunButton(...)`
- Attribute initiator with `trigger_source` = 'button' | 'keybinding' |
'legacy_ui'
- Remove pre-tracking from keybindings to avoid double/triple counting
- Update legacy UI buttons to emit both click + execution events

## Backport Notes
This backport required manual conflict resolution in:
- `src/components/actionbar/ComfyRunButton/ComfyQueueButton.vue` - Added
batchCount tracking and trigger_source metadata
- `src/composables/useCoreCommands.ts` - Added error handling and
execution tracking
- `src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts`
- Updated trackRunButton signature with trigger_source support

Additionally added:
- `trackUiButtonClicked` method to TelemetryProvider interface
- `UiButtonClickMetadata` type definition
- `UI_BUTTON_CLICKED` event constant

All conflicts resolved intelligently to maintain the intent of the
original PR while adapting to the rh-test branch codebase.

## Original PR
- Original PR: #6518  
- Original commit: 6fe88dba54

## Testing
-  Typecheck passed
-  Pre-commit hooks passed (lint, format)
-  All conflicts resolved

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6552-Backport-to-rh-test-fix-telemetry-remove-redundant-run-tracking-keep-click-analytics-2a06d73d365081f78e4ad46a16be69f1)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Christian Byrne <c.byrne@comfy.org>
Co-authored-by: Alexander Brown <drjkl@comfy.org>
Co-authored-by: Benjamin Lu <benjaminlu1107@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Christian Byrne <chrbyrne96@gmail.com>
This commit is contained in:
Christian Byrne
2025-11-02 20:49:02 -08:00
committed by GitHub
parent 044b675138
commit 56412a4076
10 changed files with 128 additions and 57 deletions

View File

@@ -480,7 +480,8 @@ export class ComfyUI {
textContent: 'Queue Prompt',
onclick: () => {
if (isCloud) {
useTelemetry()?.trackRunTriggeredViaMenu()
useTelemetry()?.trackRunButton({ trigger_source: 'legacy_ui' })
useTelemetry()?.trackWorkflowExecution()
}
app.queuePrompt(0, this.batchCount)
}
@@ -587,7 +588,8 @@ export class ComfyUI {
textContent: 'Queue Front',
onclick: () => {
if (isCloud) {
useTelemetry()?.trackRunTriggeredViaMenu()
useTelemetry()?.trackRunButton({ trigger_source: 'legacy_ui' })
useTelemetry()?.trackWorkflowExecution()
}
app.queuePrompt(-1, this.batchCount)
}