From ebbdfa4249faf7056d74ea6e782c5755364c816c Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Thu, 26 Feb 2026 13:53:58 +0100 Subject: [PATCH] Fix workflow picker not switching active workflow The store's openWorkflow only updates Pinia state without switching the canvas. Use app.loadGraphData with the workflow object instead, matching ComfyUI's internal workflow service pattern. Co-Authored-By: Claude Opus 4.6 --- js/snapshot_manager.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/snapshot_manager.js b/js/snapshot_manager.js index c67fd49..14e30f7 100644 --- a/js/snapshot_manager.js +++ b/js/snapshot_manager.js @@ -2836,15 +2836,17 @@ async function buildSidebar(el) { // Try to switch to the workflow in ComfyUI const wfStore = app.extensionManager?.workflow; const openWfs = wfStore?.openWorkflows; - if (openWfs && wfStore.openWorkflow) { + if (openWfs) { const target = openWfs.find(wf => (wf.key || wf.filename || wf.path) === entry.workflowKey ); if (target) { try { + if (!target.isLoaded && target.load) await target.load(); collapsePicker(); - await wfStore.openWorkflow(target); - // openWorkflow listener handles viewingWorkflowKey reset + refresh + await app.loadGraphData(target.activeState, true, true, target); + // loadGraphData triggers the openWorkflow store action, + // whose listener handles viewingWorkflowKey reset + refresh return; } catch { /* fall through to view-only */ } }