fix: QPO progress bar now shows node name in subgraphs

This commit is contained in:
Csongor Czezar
2025-12-20 15:40:21 -08:00
parent 4c955f6725
commit e4110dd254
2 changed files with 165 additions and 16 deletions

View File

@@ -7,11 +7,7 @@ import { isCloud } from '@/platform/distribution/types'
import { useTelemetry } from '@/platform/telemetry'
import type { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
import type {
ComfyNode,
ComfyWorkflowJSON,
NodeId
} from '@/platform/workflow/validation/schemas/workflowSchema'
import type { NodeId } from '@/platform/workflow/validation/schemas/workflowSchema'
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
import type {
ExecutedWsMessage,
@@ -194,20 +190,16 @@ export const useExecutionStore = defineStore('execution', () => {
)
// For backward compatibility - returns the primary executing node
const executingNode = computed<ComfyNode | null>(() => {
const executingNode = computed(() => {
if (!executingNodeId.value) return null
const workflow: ComfyWorkflow | undefined = activePrompt.value?.workflow
if (!workflow) return null
const canvasState: ComfyWorkflowJSON | null =
workflow.changeTracker?.activeState ?? null
if (!canvasState) return null
return (
canvasState.nodes.find((n) => String(n.id) === executingNodeId.value) ??
null
// Use getNodeByExecutionId to find nodes even in subgraphs
// executingNodeId may be a simple ID like "123" or a hierarchical ID like "123:456"
const node = getNodeByExecutionId(
app.rootGraph,
String(executingNodeId.value)
)
return node ?? null
})
// This is the progress of the currently executing node (for backward compatibility)