diff --git a/src/components/graph/GraphCanvas.vue b/src/components/graph/GraphCanvas.vue index d6cddc0407..92dc81ba9b 100644 --- a/src/components/graph/GraphCanvas.vue +++ b/src/components/graph/GraphCanvas.vue @@ -363,7 +363,14 @@ watch( } ) -// Update the progress of executing nodes +/** + * Propagates execution progress from the store to LiteGraph node objects + * and triggers a canvas redraw. + * + * No `deep: true` needed — `nodeLocationProgressStates` is a computed that + * returns a new `Record` object on every progress event (the underlying + * `nodeProgressStates` ref is replaced wholesale by the WebSocket handler). + */ watch( () => [executionStore.nodeLocationProgressStates, canvasStore.canvas] as const, @@ -381,8 +388,7 @@ watch( // Force canvas redraw to ensure progress updates are visible canvas.setDirty(true, false) - }, - { deep: true } + } ) // Update node slot errors for LiteGraph nodes diff --git a/src/views/GraphView.vue b/src/views/GraphView.vue index cc75b6c9a1..90eec04b7d 100644 --- a/src/views/GraphView.vue +++ b/src/views/GraphView.vue @@ -142,11 +142,18 @@ watch( { immediate: true } ) +/** + * Reports task completion telemetry to Electron analytics when tasks + * transition from running to history. + * + * No `deep: true` needed — `queueStore.tasks` is a computed that spreads + * three `shallowRef` arrays into a new array on every change, and + * `TaskItemImpl` instances are immutable (replaced, never mutated). + */ if (isDesktop) { watch( () => queueStore.tasks, (newTasks, oldTasks) => { - // Report tasks that previously running but are now completed (i.e. in history) const oldRunningTaskIds = new Set( oldTasks.filter((task) => task.isRunning).map((task) => task.jobId) ) @@ -161,8 +168,7 @@ if (isDesktop) { status: task.displayStatus.toLowerCase() }) }) - }, - { deep: true } + } ) }