-
Notifications
You must be signed in to change notification settings - Fork 644
feat(telemetry): help center and workflow creation #6505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
0099512
59e1742
4e48f45
1a032d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,6 +74,7 @@ export function useCoreCommands(): ComfyCommand[] { | |
| const toastStore = useToastStore() | ||
| const canvasStore = useCanvasStore() | ||
| const executionStore = useExecutionStore() | ||
| const telemetry = useTelemetry() | ||
|
|
||
| const bottomPanelStore = useBottomPanelStore() | ||
|
|
||
|
|
@@ -102,7 +103,16 @@ export function useCoreCommands(): ComfyCommand[] { | |
| label: 'New Blank Workflow', | ||
| menubarLabel: 'New', | ||
| category: 'essentials' as const, | ||
| function: () => workflowService.loadBlankWorkflow() | ||
| function: async () => { | ||
| const previousWorkflowHadNodes = app.graph._nodes.length > 0 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [quality] medium Priority Issue: Workflow creation tracking logic may not be accurate in all scenarios
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can improve this if we see these problems in the data. |
||
| await workflowService.loadBlankWorkflow() | ||
| if (isCloud) { | ||
| telemetry?.trackWorkflowCreated({ | ||
| workflow_type: 'blank', | ||
| previous_workflow_had_nodes: previousWorkflowHadNodes | ||
| }) | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| id: 'Comfy.OpenWorkflow', | ||
|
|
@@ -118,7 +128,16 @@ export function useCoreCommands(): ComfyCommand[] { | |
| id: 'Comfy.LoadDefaultWorkflow', | ||
| icon: 'pi pi-code', | ||
| label: 'Load Default Workflow', | ||
| function: () => workflowService.loadDefaultWorkflow() | ||
| function: async () => { | ||
| const previousWorkflowHadNodes = app.graph._nodes.length > 0 | ||
| await workflowService.loadDefaultWorkflow() | ||
| if (isCloud) { | ||
| telemetry?.trackWorkflowCreated({ | ||
| workflow_type: 'default', | ||
| previous_workflow_had_nodes: previousWorkflowHadNodes | ||
| }) | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| id: 'Comfy.SaveWorkflow', | ||
|
|
@@ -721,6 +740,13 @@ export function useCoreCommands(): ComfyCommand[] { | |
| menubarLabel: 'ComfyUI Issues', | ||
| versionAdded: '1.5.5', | ||
| function: () => { | ||
| if (isCloud) { | ||
| telemetry?.trackHelpResourceClicked({ | ||
| resource_type: 'github', | ||
| is_external: true, | ||
| source: 'menu' | ||
| }) | ||
| } | ||
| window.open( | ||
| 'https://github.com/comfyanonymous/ComfyUI/issues', | ||
| '_blank' | ||
|
|
@@ -734,6 +760,13 @@ export function useCoreCommands(): ComfyCommand[] { | |
| menubarLabel: 'ComfyUI Docs', | ||
| versionAdded: '1.5.5', | ||
| function: () => { | ||
| if (isCloud) { | ||
| telemetry?.trackHelpResourceClicked({ | ||
| resource_type: 'docs', | ||
| is_external: true, | ||
| source: 'menu' | ||
| }) | ||
| } | ||
| window.open('https://docs.comfy.org/', '_blank') | ||
| } | ||
| }, | ||
|
|
@@ -744,6 +777,13 @@ export function useCoreCommands(): ComfyCommand[] { | |
| menubarLabel: 'Comfy-Org Discord', | ||
| versionAdded: '1.5.5', | ||
| function: () => { | ||
| if (isCloud) { | ||
| telemetry?.trackHelpResourceClicked({ | ||
| resource_type: 'discord', | ||
| is_external: true, | ||
| source: 'menu' | ||
| }) | ||
| } | ||
| window.open('https://www.comfy.org/discord', '_blank') | ||
| } | ||
| }, | ||
|
|
@@ -801,6 +841,13 @@ export function useCoreCommands(): ComfyCommand[] { | |
| menubarLabel: 'ComfyUI Forum', | ||
| versionAdded: '1.8.2', | ||
| function: () => { | ||
| if (isCloud) { | ||
| telemetry?.trackHelpResourceClicked({ | ||
| resource_type: 'help_feedback', | ||
| is_external: true, | ||
| source: 'menu' | ||
| }) | ||
| } | ||
| window.open('https://forum.comfy.org/', '_blank') | ||
| } | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,9 @@ import type { | |
| ExecutionContext, | ||
| ExecutionErrorMetadata, | ||
| ExecutionSuccessMetadata, | ||
| HelpCenterClosedMetadata, | ||
| HelpCenterOpenedMetadata, | ||
| HelpResourceClickedMetadata, | ||
| NodeSearchMetadata, | ||
| NodeSearchResultMetadata, | ||
| PageVisibilityMetadata, | ||
|
|
@@ -28,6 +31,7 @@ import type { | |
| TemplateLibraryMetadata, | ||
| TemplateLibraryClosedMetadata, | ||
| TemplateMetadata, | ||
| WorkflowCreatedMetadata, | ||
| WorkflowImportMetadata | ||
| } from '../../types' | ||
| import { TelemetryEvents } from '../../types' | ||
|
|
@@ -269,6 +273,22 @@ export class MixpanelTelemetryProvider implements TelemetryProvider { | |
| this.trackEvent(TelemetryEvents.TEMPLATE_FILTER_CHANGED, metadata) | ||
| } | ||
|
|
||
| trackHelpCenterOpened(metadata: HelpCenterOpenedMetadata): void { | ||
| this.trackEvent(TelemetryEvents.HELP_CENTER_OPENED, metadata) | ||
| } | ||
|
|
||
| trackHelpResourceClicked(metadata: HelpResourceClickedMetadata): void { | ||
| this.trackEvent(TelemetryEvents.HELP_RESOURCE_CLICKED, metadata) | ||
| } | ||
|
|
||
| trackHelpCenterClosed(metadata: HelpCenterClosedMetadata): void { | ||
| this.trackEvent(TelemetryEvents.HELP_CENTER_CLOSED, metadata) | ||
| } | ||
|
|
||
| trackWorkflowCreated(metadata: WorkflowCreatedMetadata): void { | ||
| this.trackEvent(TelemetryEvents.WORKFLOW_CREATED, metadata) | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [performance] medium Priority Issue: Complex execution context calculation runs on every telemetry call |
||
|
|
||
| trackWorkflowExecution(): void { | ||
| const context = this.getExecutionContext() | ||
| this.trackEvent(TelemetryEvents.EXECUTION_START, context) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[quality] medium Priority
Issue: Inconsistent conditional telemetry tracking pattern
Context: Some functions check isCloud before calling telemetry, others don't, creating inconsistent behavior and potential errors in non-cloud environments
Suggestion: Use consistent pattern - either centralize the cloud check in the telemetry provider itself, or ensure all telemetry calls are consistently wrapped with isCloud checks