mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 23:50:08 +00:00
[fix] Preserve per-workflow subgraph navigation state (#4616)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,8 @@ export class ChangeTracker {
|
||||
offset: [app.canvas.ds.offset[0], app.canvas.ds.offset[1]]
|
||||
}
|
||||
const navigation = useSubgraphNavigationStore().exportState()
|
||||
this.subgraphState = navigation.length ? { navigation } : undefined
|
||||
// Always store the navigation state, even if empty (root level)
|
||||
this.subgraphState = { navigation }
|
||||
}
|
||||
|
||||
restore() {
|
||||
@@ -90,8 +91,14 @@ export class ChangeTracker {
|
||||
|
||||
const activeId = navigation.at(-1)
|
||||
if (activeId) {
|
||||
// Navigate to the saved subgraph
|
||||
const subgraph = app.graph.subgraphs.get(activeId)
|
||||
if (subgraph) app.canvas.setGraph(subgraph)
|
||||
if (subgraph) {
|
||||
app.canvas.setGraph(subgraph)
|
||||
}
|
||||
} else {
|
||||
// Empty navigation array means root level
|
||||
app.canvas.setGraph(app.graph)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user