Skip to content

Commit 81126fb

Browse files
fix: close the error overlay when the active graph changes
clean() used to call clearRunErrors(), which also reset isErrorOverlayOpen. setActiveGraph(null) left that global bit set, so a destination workflow whose cached missing-model/media warnings are restored with silent: true would still pop the overlay. setActiveGraph() now dismisses the overlay on every move, restoring the old clean() behaviour and keeping it scoped to the graph in front. Addresses #15361 (comment)
1 parent ad4d328 commit 81126fb

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

src/stores/executionErrorStore.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,20 @@ describe('setActiveGraph', () => {
963963
expect(store.lastNodeErrors).toBeNull()
964964
})
965965

966+
it('closes the error overlay when the active graph changes', () => {
967+
const store = useExecutionErrorStore()
968+
969+
store.setActiveGraph(graphAId)
970+
store.recordNodeErrors(nodeErrors)
971+
store.showErrorOverlay()
972+
973+
store.setActiveGraph(null)
974+
expect(store.isErrorOverlayOpen).toBe(false)
975+
976+
store.setActiveGraph(graphAId)
977+
expect(store.isErrorOverlayOpen).toBe(false)
978+
})
979+
966980
it('ignores errors recorded while no graph is active', () => {
967981
const store = useExecutionErrorStore()
968982

src/stores/executionErrorStore.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const useExecutionErrorStore = defineStore('executionError', () => {
7070
*/
7171
const runErrorsByGraphId = ref(new Map<UUID, RunErrorState>())
7272
const activeGraphId = ref<UUID | null>(zeroUuid)
73+
const isErrorOverlayOpen = ref(false)
7374

7475
const activeRunErrors = computed<RunErrorState | undefined>(() =>
7576
activeGraphId.value === null
@@ -108,13 +109,15 @@ export const useExecutionErrorStore = defineStore('executionError', () => {
108109

109110
/**
110111
* Point the store at the run errors of `graphId`. `null` detaches it, so a
111-
* discarded graph shows nothing until the next one is loaded.
112+
* discarded graph shows nothing until the next one is loaded. The overlay is
113+
* dismissed on every move so it only ever reopens for the graph in front.
112114
*/
113115
function setActiveGraph(graphId: UUID | null) {
116+
if (graphId === activeGraphId.value) return
114117
activeGraphId.value = graphId
118+
isErrorOverlayOpen.value = false
115119
}
116120

117-
const isErrorOverlayOpen = ref(false)
118121
const pendingAddedNodeScans = new WeakMap<
119122
LGraph,
120123
Map<NodeExecutionId, number>

0 commit comments

Comments
 (0)