Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7ef0059
fix: make ComfyApp root-graph readiness reactive
mattmillerai Aug 9, 2026
37abbf4
test: cover rootGraph listener rebinding on graph replacement
mattmillerai Aug 9, 2026
d94c094
test: drop unused Pinia setup from rootGraphReadiness test
mattmillerai Aug 10, 2026
d5cb571
style: merge duplicate vue import in app.ts
mattmillerai Aug 10, 2026
dd7e216
Merge remote-tracking branch 'origin/main' into matt/fe-6860-root-gra…
mattmillerai Aug 12, 2026
24fa82d
Merge remote-tracking branch 'origin/main' into matt/fe-6860-root-gra…
mattmillerai Aug 12, 2026
8f189dc
Merge remote-tracking branch 'origin/main' into matt/fe-6860-root-gra…
mattmillerai Aug 12, 2026
967997d
test: drop the type assertions from the root-graph test seam
mattmillerai Aug 16, 2026
85744ec
Merge remote-tracking branch 'origin/main' into matt/fe-6860-root-gra…
mattmillerai Aug 25, 2026
3a0983f
test: drop redundant vi.restoreAllMocks from rootGraphReadiness after…
mattmillerai Aug 25, 2026
f9a9c50
Merge remote-tracking branch 'origin/main' into matt/fe-6860-root-gra…
mattmillerai Oct 9, 2026
2f9ce28
test: use rootGraphOrUndefined and drop redundant console.error spy
mattmillerai Oct 9, 2026
e2c2d4e
fix: seed matrix runner root graph through rootGraphRef
mattmillerai Oct 9, 2026
c647645
Merge remote-tracking branch 'origin/main' into matt/fe-6860-root-gra…
mattmillerai Oct 9, 2026
2c7a7fd
Merge origin/main into matt/fe-6860-root-graph-shallow-ref
mattmillerai Oct 16, 2026
bfad298
Merge origin/main into matt/fe-6860-root-graph-shallow-ref
mattmillerai Oct 22, 2026
c9dfd67
Merge origin/main into matt/fe-6860-root-graph-shallow-ref
mattmillerai Oct 25, 2026
c415bf6
Merge origin/main into matt/fe-6860-root-graph-shallow-ref
mattmillerai Oct 31, 2026
b513d3b
Merge remote-tracking branch 'origin/main' into matt/fe-6860-root-gra…
mattmillerai Nov 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/registry-census/matrix_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type { PointTuple as Point } from '@comfyorg/shared-frontend-utils/geomet
import type { CanvasPointerEvent } from '@comfyorg/graph-model/events'
import type { IBaseWidget } from '@comfyorg/graph-model/widgets'
import type { ComfyNodeDef, InputSpec } from '@comfyorg/object-info-parser'
import { setRootGraph } from '@/scripts/__tests__/appTestUtils'
import type { useWidgetValueStore } from '@/stores/widgetValueStore'
import type * as WidgetValuesForm from '@/workbench/extensions/agent/crdt/widgetValuesForm'

Expand Down Expand Up @@ -459,8 +460,8 @@ export async function runPack(
const graph = new LGraph()
// ComfyApp.setup() non-null-asserts five DOM elements and needs a 2D
// context, so it cannot boot here. DOM widgets read app.rootGraph while
// graph.configure runs, so the private field has to be seeded directly.
Reflect.set(app, 'rootGraphInternal', graph)
// graph.configure runs, so the root graph has to be seeded directly.
setRootGraph(app, graph)
const byType = (t: string) => graph._nodes.find((n) => n.type === t)

let wvStore: WidgetValueStore | undefined
Expand Down
9 changes: 4 additions & 5 deletions src/extensions/core/customWidgets.clone.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { beforeAll, beforeEach, describe, expect, it } from 'vitest'
import { LGraph, LGraphNode, LiteGraph } from '@/lib/litegraph/src/litegraph'
import type { ComfyNodeDef } from '@comfyorg/object-info-parser'
import { app } from '@/scripts/app'
import { getRootGraph, setRootGraph } from '@/scripts/__tests__/appTestUtils'

import { customWidgetsExtension } from './customWidgets'

Expand Down Expand Up @@ -40,10 +41,8 @@ describe('CustomCombo copy/paste', () => {

it('preserves combo options and selected value through clone and paste', () => {
const graph = new LGraph()
type AppWithRootGraph = { rootGraphInternal?: LGraph }
const appWithRootGraph = app as unknown as AppWithRootGraph
const previousRootGraph = appWithRootGraph.rootGraphInternal
appWithRootGraph.rootGraphInternal = graph
const previousRootGraph = getRootGraph(app)
setRootGraph(app, graph)

try {
const original = LiteGraph.createNode(TEST_CUSTOM_COMBO_TYPE)!
Expand Down Expand Up @@ -72,7 +71,7 @@ describe('CustomCombo copy/paste', () => {
'gamma'
])
} finally {
appWithRootGraph.rootGraphInternal = previousRootGraph
setRootGraph(app, previousRootGraph)
}
})
})
17 changes: 7 additions & 10 deletions src/extensions/core/customWidgets.subgraphPromotion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@/lib/litegraph/src/subgraph/__fixtures__/subgraphHelpers'
import type { ComfyNodeDef } from '@comfyorg/object-info-parser'
import { app } from '@/scripts/app'
import { getRootGraph, setRootGraph } from '@/scripts/__tests__/appTestUtils'
import { useWidgetValueStore } from '@/stores/widgetValueStore'
import { graphToPrompt } from '@/utils/executionUtil'

Expand Down Expand Up @@ -89,10 +90,8 @@ describe('CustomCombo index widget after subgraph promotion', () => {

it('resolves INDEX from the promoted host choice, not the frozen interior value', async () => {
const rootGraph = new LGraph()
type AppWithRootGraph = { rootGraphInternal?: LGraph }
const appWithRootGraph = app as unknown as AppWithRootGraph
const previousRootGraph = appWithRootGraph.rootGraphInternal
appWithRootGraph.rootGraphInternal = rootGraph
const previousRootGraph = getRootGraph(app)
setRootGraph(app, rootGraph)

try {
const subgraph = createTestSubgraph({ rootGraph })
Expand Down Expand Up @@ -134,16 +133,14 @@ describe('CustomCombo index widget after subgraph promotion', () => {
// "four" is index 3 of ["one", "two", "three", "four"].
expect(promptInputs.index).toBe(3)
} finally {
appWithRootGraph.rootGraphInternal = previousRootGraph
setRootGraph(app, previousRootGraph)
}
})

it('resolves INDEX from the interior widget when choice was never promoted', async () => {
const rootGraph = new LGraph()
type AppWithRootGraph = { rootGraphInternal?: LGraph }
const appWithRootGraph = app as unknown as AppWithRootGraph
const previousRootGraph = appWithRootGraph.rootGraphInternal
appWithRootGraph.rootGraphInternal = rootGraph
const previousRootGraph = getRootGraph(app)
setRootGraph(app, rootGraph)

try {
const comboNode = LiteGraph.createNode(
Expand All @@ -162,7 +159,7 @@ describe('CustomCombo index widget after subgraph promotion', () => {
// "two" is index 1 of ["one", "two", "three"].
expect(promptInputs.index).toBe(1)
} finally {
appWithRootGraph.rootGraphInternal = previousRootGraph
setRootGraph(app, previousRootGraph)
}
})
})
15 changes: 15 additions & 0 deletions src/scripts/__tests__/appTestUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { LGraph } from '@/lib/litegraph/src/litegraph'
import type { ComfyApp } from '@/scripts/app'

/**
* `ComfyApp.setup` is the only production writer of the root graph, and it needs
* a real canvas. Tests that just need a graph in place reach the same storage
* through this seam instead.
*/
export function setRootGraph(app: ComfyApp, graph: LGraph | undefined) {
app['rootGraphRef'].value = graph
}

export function getRootGraph(app: ComfyApp) {
return app['rootGraphRef'].value
}
9 changes: 2 additions & 7 deletions src/scripts/app.graphReadiness.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ import { beforeEach, describe, expect, it } from 'vitest'
import { effectScope, nextTick, watch } from 'vue'

import { LGraph } from '@/lib/litegraph/src/litegraph'
import { setRootGraph } from '@/scripts/__tests__/appTestUtils'
import { app } from '@/scripts/app'

const setGraph = (graph: LGraph | undefined) => {
;(
app as unknown as {
rootGraphInternal: LGraph | undefined
}
).rootGraphInternal = graph
}
const setGraph = (graph: LGraph | undefined) => setRootGraph(app, graph)

describe('ComfyApp graph-readiness reactivity', () => {
beforeEach(() => setGraph(undefined))
Expand Down
Loading
Loading