Compare commits

...

1 Commits

Author SHA1 Message Date
Johnpaul
f9f2c6edd7 feat: restore running job context on page refresh
Extend ExecutionStartWsMessage schema with optional outputs_to_execute
and executed_node_ids fields. Populate node tracking in
handleExecutionStart so progress bars and node highlighting restore
correctly when the backend replays catch-up events on WS reconnect.
2026-02-16 23:54:07 +01:00
2 changed files with 21 additions and 1 deletions

View File

@@ -88,7 +88,10 @@ const zExecutionWsMessageBase = z.object({
timestamp: z.number().int()
})
const zExecutionStartWsMessage = zExecutionWsMessageBase
const zExecutionStartWsMessage = zExecutionWsMessageBase.extend({
outputs_to_execute: z.array(zNodeId).optional(),
executed_node_ids: z.array(zNodeId).optional()
})
const zExecutionSuccessWsMessage = zExecutionWsMessageBase
const zExecutionCachedWsMessage = zExecutionWsMessageBase.extend({
nodes: z.array(zNodeId)

View File

@@ -289,6 +289,23 @@ export const useExecutionStore = defineStore('execution', () => {
lastExecutionError.value = null
activePromptId.value = e.detail.prompt_id
queuedPrompts.value[activePromptId.value] ??= { nodes: {} }
const outputsToExecute = e.detail.outputs_to_execute
if (outputsToExecute?.length) {
const qp = queuedPrompts.value[activePromptId.value]
for (const nodeId of outputsToExecute) {
qp.nodes[nodeId] ??= false
}
}
const executedNodeIds = e.detail.executed_node_ids
if (executedNodeIds?.length) {
const qp = queuedPrompts.value[activePromptId.value]
for (const nodeId of executedNodeIds) {
qp.nodes[nodeId] = true
}
}
clearInitializationByPromptId(activePromptId.value)
}