Skip to content

refactor!: make nodeDataStore the source of truth for node shell state - #13963

Merged
DrJKL merged 42 commits into
feature/ecs-migrationfrom
drjkl/node-data-store
Jul 29, 2026
Merged

DrJKL merged 42 commits into
feature/ecs-migrationfrom
drjkl/node-data-store

Conversation

@DrJKL

@DrJKL DrJKL commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Makes nodeDataStore the single source of truth for node shell state, deleting the VueNodeData mirror and all of useGraphNodeManager. Continues ADR 0008 after the link topology and reroute chain stores; design record in docs/architecture/node-data-store.md.

Stacked on #13528.

Changes

  • What:

nodeDataStore holds one plain NodeState per node in root-graph-scoped buckets keyed by NodeId, registered by reference with proxy-returning registration — the BaseWidget pattern. LGraphNode's shell fields (title, mode, flags, color, bgcolor, titleMode, …) become accessors over _state, so the class and the store are the same object rather than two copies kept in step. Registration refuses to overwrite a live entry: it logs and returns undefined rather than letting a throwaway node hijack a registered id, and the refused caller keeps its own untracked state.

VueNodeData and useGraphNodeManager are gone (439 lines plus 683 of tests). All four of the manager's responsibilities were resolved rather than relocated: getNode/nodeRefs became store reads plus getNodeById; the slot-array graft became class-side reactivity from construction; slot-label reprojection became unnecessary once slot objects are reactive; and layoutStore seeding moved to the renderer.

Slot arrays and slot objects are shallowReactive from construction, and nodeDataStore holds the arrays by reference beside the states — the same shape widgetValueStore already uses for widget order. Because the arrays are the node's own, array order is slot order and there is nothing to keep in step.

node:added / node:removed graph events replace four concurrent wrappers of the single graph.onNodeAdded slot (renderer bootstrap, error-clearing hooks, minimap, telemetry). Whichever restored first put back the pre-its-own-install value and silently discarded the others, order-dependent, on every graph switch. The onNodeAdded / onNodeRemoved callbacks still fire, so extension behaviour is unchanged.

Two consequences of the above, both found by CI rather than by inspection: layoutStore is seeded from the renderer's event listeners rather than from LGraph.add, so it stays empty when Vue nodes are off; and the minimap picks its data source by render mode instead of by store emptiness, scoping membership to the viewed graph.

The node error ring derives from the error stores rather than the untracked node.has_errors field.

  • Breaking: useGraphNodeManager and the VueNodeData type are removed. Both were internal; no entity callback, node.widgets access, node.serialize, or graph._version behaviour changes, so the ADR 0008 extension-impact surface is untouched.

Review Focus

Register-by-reference, not copy. The store returns the reactive proxy it holds and the node adopts it as _state. This is what removes the mirror: there is no write-through, no diffing, and no direction to get wrong. The refusal path is the interesting edge — see registerNode and its tests.

Why slot arrays are held by reference and not keyed. An index-keyed SlotState was drafted and rejected: slot index is a property of the containing array, not of the slot, and ~25 sites permute it — including reorderSubgraphInputs, a pure permutation reachable by dragging subgraph inputs in the right panel. An index-keyed store must re-key on every one of them; linkStore shows the price.

A memoisation that was removed for being slower. The WeakMap cache over input slot index cost more than the indexOf it avoided: Vue routes indexOf to the raw array at ~0.8ns/element, while validating the cache needs a proxied element read plus a WeakMap lookup — 345ns vs 277ns at 3 slots, still slower at 20. Measured, then reverted.

Test relocations. Tests moved to the code they now exercise: error flags to useNodeErrorFlagSync, widget-store reactivity to widgetValueStore.graphReactivity, layout seeding to LGraph, slot reactivity to NodeSlot.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d3bd645c-a251-48ea-b0e5-2d10082d54c6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
🚥 Pre-merge checks | ✅ 4 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
End-To-End Regression Coverage For Fixes ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Adr Compliance For Entity/Litegraph Changes ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely states the main change: making nodeDataStore the source of truth for node shell state.
Description check ✅ Passed The description matches the template well, covering Summary, Changes, and Review Focus with a clear What and Breaking note.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch drjkl/node-data-store

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 07/28/2026, 10:52:04 PM UTC

Links

🎭 Playwright: ✅ 1693 passed, 0 failed · 2 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1672 / ❌ 0 / ⚠️ 2 / ⏭️ 5)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 55.7 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 54.0 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 64.0 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 50.2 MB heap
large-graph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 56.1 MB heap
large-graph-pan: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 81.8 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 67.0 MB heap
minimap-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 64.0 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 47.1 MB heap
subgraph-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 60.1 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 50.2 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 164ms TBT · 93.4 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 71.8 MB heap
vue-large-graph-idle: · 56.3 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 159.8 MB heap
vue-large-graph-pan: · 57.1 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 80ms TBT · 165.6 MB heap
workflow-execution: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 46.9 MB heap

ℹ️ No baseline found — significance unavailable.

Absolute values
Metric Value
canvas-idle: avg frame time 17ms
canvas-idle: p95 frame time 17ms
canvas-idle: layout duration 0ms
canvas-idle: style recalc duration 6ms
canvas-idle: layout count 0
canvas-idle: style recalc count 7
canvas-idle: task duration 433ms
canvas-idle: script duration 26ms
canvas-idle: TBT 0ms
canvas-idle: heap used 55.7 MB
canvas-idle: DOM nodes -282
canvas-idle: event listeners -202
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 4ms
canvas-mouse-sweep: style recalc duration 38ms
canvas-mouse-sweep: layout count 12
canvas-mouse-sweep: style recalc count 74
canvas-mouse-sweep: task duration 826ms
canvas-mouse-sweep: script duration 173ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 54.0 MB
canvas-mouse-sweep: DOM nodes 57
canvas-mouse-sweep: event listeners 4
canvas-zoom-sweep: avg frame time 17ms
canvas-zoom-sweep: p95 frame time 17ms
canvas-zoom-sweep: layout duration 1ms
canvas-zoom-sweep: style recalc duration 18ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 30
canvas-zoom-sweep: task duration 389ms
canvas-zoom-sweep: script duration 27ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 64.0 MB
canvas-zoom-sweep: DOM nodes -223
canvas-zoom-sweep: event listeners -188
dom-widget-clipping: avg frame time 17ms
dom-widget-clipping: p95 frame time 17ms
dom-widget-clipping: layout duration 0ms
dom-widget-clipping: style recalc duration 11ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 12
dom-widget-clipping: task duration 403ms
dom-widget-clipping: script duration 87ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 50.2 MB
dom-widget-clipping: DOM nodes -126
dom-widget-clipping: event listeners -104
large-graph-idle: avg frame time 17ms
large-graph-idle: p95 frame time 17ms
large-graph-idle: layout duration 0ms
large-graph-idle: style recalc duration 8ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 8
large-graph-idle: task duration 708ms
large-graph-idle: script duration 244ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 56.1 MB
large-graph-idle: DOM nodes -128
large-graph-idle: event listeners -98
large-graph-pan: avg frame time 17ms
large-graph-pan: p95 frame time 17ms
large-graph-pan: layout duration 0ms
large-graph-pan: style recalc duration 16ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 67
large-graph-pan: task duration 1648ms
large-graph-pan: script duration 953ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 81.8 MB
large-graph-pan: DOM nodes -276
large-graph-pan: event listeners -100
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 8ms
large-graph-zoom: style recalc duration 15ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 62
large-graph-zoom: task duration 1872ms
large-graph-zoom: script duration 1065ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 67.0 MB
large-graph-zoom: DOM nodes -283
large-graph-zoom: event listeners -95
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 6ms
minimap-idle: layout count 0
minimap-idle: style recalc count 7
minimap-idle: task duration 685ms
minimap-idle: script duration 244ms
minimap-idle: TBT 0ms
minimap-idle: heap used 64.0 MB
minimap-idle: DOM nodes -130
minimap-idle: event listeners -98
subgraph-dom-widget-clipping: avg frame time 17ms
subgraph-dom-widget-clipping: p95 frame time 17ms
subgraph-dom-widget-clipping: layout duration 0ms
subgraph-dom-widget-clipping: style recalc duration 13ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 47
subgraph-dom-widget-clipping: task duration 451ms
subgraph-dom-widget-clipping: script duration 161ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 47.1 MB
subgraph-dom-widget-clipping: DOM nodes -273
subgraph-dom-widget-clipping: event listeners -201
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 10ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 11
subgraph-idle: task duration 433ms
subgraph-idle: script duration 19ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 60.1 MB
subgraph-idle: DOM nodes -270
subgraph-idle: event listeners -203
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 4ms
subgraph-mouse-sweep: style recalc duration 39ms
subgraph-mouse-sweep: layout count 16
subgraph-mouse-sweep: style recalc count 77
subgraph-mouse-sweep: task duration 753ms
subgraph-mouse-sweep: script duration 117ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 50.2 MB
subgraph-mouse-sweep: DOM nodes -67
subgraph-mouse-sweep: event listeners -100
subgraph-transition-enter: avg frame time 17ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 12ms
subgraph-transition-enter: style recalc duration 27ms
subgraph-transition-enter: layout count 4
subgraph-transition-enter: style recalc count 7
subgraph-transition-enter: task duration 814ms
subgraph-transition-enter: script duration 40ms
subgraph-transition-enter: TBT 164ms
subgraph-transition-enter: heap used 93.4 MB
subgraph-transition-enter: DOM nodes 13134
subgraph-transition-enter: event listeners 1660
viewport-pan-sweep: avg frame time 17ms
viewport-pan-sweep: p95 frame time 17ms
viewport-pan-sweep: layout duration 0ms
viewport-pan-sweep: style recalc duration 54ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 251
viewport-pan-sweep: task duration 5851ms
viewport-pan-sweep: script duration 3219ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 71.8 MB
viewport-pan-sweep: DOM nodes -267
viewport-pan-sweep: event listeners -185
vue-large-graph-idle: avg frame time 18ms
vue-large-graph-idle: p95 frame time 17ms
vue-large-graph-idle: layout duration 0ms
vue-large-graph-idle: style recalc duration 0ms
vue-large-graph-idle: layout count 0
vue-large-graph-idle: style recalc count 0
vue-large-graph-idle: task duration 12919ms
vue-large-graph-idle: script duration 1060ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 159.8 MB
vue-large-graph-idle: DOM nodes -1536
vue-large-graph-idle: event listeners -7455
vue-large-graph-pan: avg frame time 18ms
vue-large-graph-pan: p95 frame time 17ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 19ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 81
vue-large-graph-pan: task duration 15816ms
vue-large-graph-pan: script duration 1544ms
vue-large-graph-pan: TBT 80ms
vue-large-graph-pan: heap used 165.6 MB
vue-large-graph-pan: DOM nodes -1536
vue-large-graph-pan: event listeners -7450
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 1ms
workflow-execution: style recalc duration 26ms
workflow-execution: layout count 5
workflow-execution: style recalc count 20
workflow-execution: task duration 210ms
workflow-execution: script duration 19ms
workflow-execution: TBT 0ms
workflow-execution: heap used 46.9 MB
workflow-execution: DOM nodes -157
workflow-execution: event listeners -142
Raw data
{
  "timestamp": "2026-07-28T23:01:49.635Z",
  "gitSha": "f6e1b620e96b9987bcac56e8657004e034de2c6e",
  "branch": "drjkl/node-data-store",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2077.150999999958,
      "styleRecalcs": 4,
      "styleRecalcDurationMs": 4.154000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 438.429,
      "heapDeltaBytes": 13771952,
      "heapUsedBytes": 66306156,
      "domNodes": -278,
      "jsHeapTotalBytes": 15855616,
      "scriptDurationMs": 26.307000000000002,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-idle",
      "durationMs": 2047.3200000000134,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 8.562999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 427.7320000000001,
      "heapDeltaBytes": -1402888,
      "heapUsedBytes": 50487508,
      "domNodes": -286,
      "jsHeapTotalBytes": 16904192,
      "scriptDurationMs": 25.089,
      "eventListeners": -203,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1841.540000000009,
      "styleRecalcs": 74,
      "styleRecalcDurationMs": 38.766000000000005,
      "layouts": 12,
      "layoutDurationMs": 5.461,
      "taskDurationMs": 839.5250000000001,
      "heapDeltaBytes": -2833448,
      "heapUsedBytes": 56732788,
      "domNodes": 58,
      "jsHeapTotalBytes": 26214400,
      "scriptDurationMs": 171.52599999999998,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1809.8899999999958,
      "styleRecalcs": 74,
      "styleRecalcDurationMs": 36.7,
      "layouts": 12,
      "layoutDurationMs": 3.5190000000000006,
      "taskDurationMs": 813.218,
      "heapDeltaBytes": -2950732,
      "heapUsedBytes": 56542012,
      "domNodes": 56,
      "jsHeapTotalBytes": 25165824,
      "scriptDurationMs": 173.498,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1773.6530000000243,
      "styleRecalcs": 29,
      "styleRecalcDurationMs": 16.948999999999998,
      "layouts": 6,
      "layoutDurationMs": 0.6330000000000001,
      "taskDurationMs": 398.386,
      "heapDeltaBytes": -3350536,
      "heapUsedBytes": 67027048,
      "domNodes": -226,
      "jsHeapTotalBytes": 12734464,
      "scriptDurationMs": 27.834999999999997,
      "eventListeners": -188,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1741.4430000000038,
      "styleRecalcs": 31,
      "styleRecalcDurationMs": 19.110000000000003,
      "layouts": 6,
      "layoutDurationMs": 0.7110000000000001,
      "taskDurationMs": 380.244,
      "heapDeltaBytes": -3405060,
      "heapUsedBytes": 67166380,
      "domNodes": -220,
      "jsHeapTotalBytes": 12996608,
      "scriptDurationMs": 26.925000000000004,
      "eventListeners": -188,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 561.2980000000221,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 9.280000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 386.86299999999994,
      "heapDeltaBytes": -10914732,
      "heapUsedBytes": 55811852,
      "domNodes": 20,
      "jsHeapTotalBytes": 20733952,
      "scriptDurationMs": 87.15799999999999,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000273
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 616.359999999986,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 12.074,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 418.67900000000003,
      "heapDeltaBytes": -21193496,
      "heapUsedBytes": 49438040,
      "domNodes": -271,
      "jsHeapTotalBytes": 6180864,
      "scriptDurationMs": 86.973,
      "eventListeners": -207,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2014.848000000029,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 8.669999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 715.7370000000001,
      "heapDeltaBytes": -16087764,
      "heapUsedBytes": 60723088,
      "domNodes": 18,
      "jsHeapTotalBytes": 6410240,
      "scriptDurationMs": 243.60399999999998,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2056.447999999932,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 6.7860000000000005,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 699.4789999999999,
      "heapDeltaBytes": -15996072,
      "heapUsedBytes": 56989500,
      "domNodes": -273,
      "jsHeapTotalBytes": -1843200,
      "scriptDurationMs": 245.32999999999998,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66999999999998,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2260.9789999999634,
      "styleRecalcs": 66,
      "styleRecalcDurationMs": 14.853000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1623.978,
      "heapDeltaBytes": 32068940,
      "heapUsedBytes": 85327348,
      "domNodes": -278,
      "jsHeapTotalBytes": 1515520,
      "scriptDurationMs": 944.773,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2306.6390000000183,
      "styleRecalcs": 68,
      "styleRecalcDurationMs": 16.397,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1672.306,
      "heapDeltaBytes": 11823704,
      "heapUsedBytes": 86165128,
      "domNodes": -273,
      "jsHeapTotalBytes": 720896,
      "scriptDurationMs": 960.2499999999999,
      "eventListeners": -205,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3636.693999999977,
      "styleRecalcs": 62,
      "styleRecalcDurationMs": 15.812999999999997,
      "layouts": 60,
      "layoutDurationMs": 7.726,
      "taskDurationMs": 1879.5949999999998,
      "heapDeltaBytes": 25490628,
      "heapUsedBytes": 79893676,
      "domNodes": -281,
      "jsHeapTotalBytes": 1310720,
      "scriptDurationMs": 1068.96,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3643.2629999999335,
      "styleRecalcs": 61,
      "styleRecalcDurationMs": 14.580999999999996,
      "layouts": 60,
      "layoutDurationMs": 7.5649999999999995,
      "taskDurationMs": 1864.5299999999997,
      "heapDeltaBytes": 5413572,
      "heapUsedBytes": 60565400,
      "domNodes": -285,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 1061.5800000000002,
      "eventListeners": 10,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2028.8029999999821,
      "styleRecalcs": 5,
      "styleRecalcDurationMs": 4.543000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 693.368,
      "heapDeltaBytes": -18123380,
      "heapUsedBytes": 57330320,
      "domNodes": -276,
      "jsHeapTotalBytes": -1318912,
      "scriptDurationMs": 245.145,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 1993.614999999977,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 8.228000000000003,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 676.3389999999999,
      "heapDeltaBytes": 9237524,
      "heapUsedBytes": 76842984,
      "domNodes": 16,
      "jsHeapTotalBytes": 6348800,
      "scriptDurationMs": 242.90099999999998,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 644.6640000000343,
      "styleRecalcs": 47,
      "styleRecalcDurationMs": 13.384,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 446.7,
      "heapDeltaBytes": -21046764,
      "heapUsedBytes": 49386192,
      "domNodes": -271,
      "jsHeapTotalBytes": 5656576,
      "scriptDurationMs": 157.835,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 622.6990000000114,
      "styleRecalcs": 46,
      "styleRecalcDurationMs": 13.04,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 455.79900000000004,
      "heapDeltaBytes": -21172704,
      "heapUsedBytes": 49412944,
      "domNodes": -275,
      "jsHeapTotalBytes": 5918720,
      "scriptDurationMs": 163.66400000000002,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2040.6580000000076,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 10.328000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 445.089,
      "heapDeltaBytes": -7385496,
      "heapUsedBytes": 63153504,
      "domNodes": -268,
      "jsHeapTotalBytes": 19288064,
      "scriptDurationMs": 20.217,
      "eventListeners": -203,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2024.5720000000347,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 10.113999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 421.7730000000001,
      "heapDeltaBytes": -7793980,
      "heapUsedBytes": 62785416,
      "domNodes": -272,
      "jsHeapTotalBytes": 19550208,
      "scriptDurationMs": 18.211000000000006,
      "eventListeners": -203,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1699.0339999999833,
      "styleRecalcs": 75,
      "styleRecalcDurationMs": 34.864999999999995,
      "layouts": 16,
      "layoutDurationMs": 4.032,
      "taskDurationMs": 709.029,
      "heapDeltaBytes": -9013840,
      "heapUsedBytes": 50441232,
      "domNodes": 63,
      "jsHeapTotalBytes": 24641536,
      "scriptDurationMs": 113.49399999999999,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1759.2860000000883,
      "styleRecalcs": 79,
      "styleRecalcDurationMs": 43.169,
      "layouts": 16,
      "layoutDurationMs": 4.5249999999999995,
      "taskDurationMs": 796.439,
      "heapDeltaBytes": -15772216,
      "heapUsedBytes": 54892608,
      "domNodes": -196,
      "jsHeapTotalBytes": 20074496,
      "scriptDurationMs": 120.9,
      "eventListeners": -203,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 999.6479999999792,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 26.937999999999988,
      "layouts": 4,
      "layoutDurationMs": 12.073,
      "taskDurationMs": 814.0340000000001,
      "heapDeltaBytes": 14366040,
      "heapUsedBytes": 97904760,
      "domNodes": 13134,
      "jsHeapTotalBytes": 19922944,
      "scriptDurationMs": 39.501999999999995,
      "eventListeners": 1660,
      "totalBlockingTimeMs": 164,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8381.804000000046,
      "styleRecalcs": 251,
      "styleRecalcDurationMs": 53.687999999999995,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5780.211,
      "heapDeltaBytes": 2020916,
      "heapUsedBytes": 75096936,
      "domNodes": -267,
      "jsHeapTotalBytes": 1245184,
      "scriptDurationMs": 3163.434,
      "eventListeners": -185,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8461.203999999952,
      "styleRecalcs": 251,
      "styleRecalcDurationMs": 54.631,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5922.482000000001,
      "heapDeltaBytes": -6071512,
      "heapUsedBytes": 75489836,
      "domNodes": -266,
      "jsHeapTotalBytes": 806912,
      "scriptDurationMs": 3275.4539999999997,
      "eventListeners": -185,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 12963.030000000002,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 12946.435000000001,
      "heapDeltaBytes": -19196324,
      "heapUsedBytes": 167810524,
      "domNodes": -1536,
      "jsHeapTotalBytes": 11272192,
      "scriptDurationMs": 1025.7350000000001,
      "eventListeners": -7450,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.223333333333358,
      "p95FrameDurationMs": 16.80000000000291
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 12911.888999999974,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 12891.982000000002,
      "heapDeltaBytes": -17011032,
      "heapUsedBytes": 167339568,
      "domNodes": -1536,
      "jsHeapTotalBytes": -1077248,
      "scriptDurationMs": 1094.7479999999998,
      "eventListeners": -7460,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 18.329999999999927,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 15902.958000000013,
      "styleRecalcs": 81,
      "styleRecalcDurationMs": 19.852000000000036,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 15880.979,
      "heapDeltaBytes": -20754736,
      "heapUsedBytes": 165723916,
      "domNodes": -1536,
      "jsHeapTotalBytes": 6553600,
      "scriptDurationMs": 1604.241,
      "eventListeners": -7446,
      "totalBlockingTimeMs": 106,
      "frameDurationMs": 17.223333333333237,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 15772.933999999965,
      "styleRecalcs": 80,
      "styleRecalcDurationMs": 18.108999999999988,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 15750.142999999998,
      "heapDeltaBytes": 1573028,
      "heapUsedBytes": 181583544,
      "domNodes": -1536,
      "jsHeapTotalBytes": -638976,
      "scriptDurationMs": 1484.712,
      "eventListeners": -7454,
      "totalBlockingTimeMs": 53,
      "frameDurationMs": 17.779999999999927,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "workflow-execution",
      "durationMs": 523.5519999999951,
      "styleRecalcs": 22,
      "styleRecalcDurationMs": 26.556000000000004,
      "layouts": 4,
      "layoutDurationMs": 1.171,
      "taskDurationMs": 216.56900000000002,
      "heapDeltaBytes": -22159596,
      "heapUsedBytes": 49205368,
      "domNodes": -140,
      "jsHeapTotalBytes": 5132288,
      "scriptDurationMs": 19.341,
      "eventListeners": -148,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.663333333333338,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "workflow-execution",
      "durationMs": 527.9689999999846,
      "styleRecalcs": 17,
      "styleRecalcDurationMs": 26.120000000000005,
      "layouts": 5,
      "layoutDurationMs": 1.256,
      "taskDurationMs": 202.544,
      "heapDeltaBytes": -22187628,
      "heapUsedBytes": 49220416,
      "domNodes": -174,
      "jsHeapTotalBytes": 4345856,
      "scriptDurationMs": 17.773,
      "eventListeners": -136,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    }
  ]
}

@DrJKL
DrJKL force-pushed the drjkl/ecs-stack-audit-fixes branch from ec1a75c to 643c7ed Compare July 23, 2026 23:54
@DrJKL
DrJKL force-pushed the drjkl/node-data-store branch from a77bea6 to 2ff883d Compare July 23, 2026 23:59
@DrJKL
DrJKL force-pushed the drjkl/ecs-stack-audit-fixes branch from 643c7ed to 1c3c6fe Compare July 24, 2026 07:21
@DrJKL
DrJKL force-pushed the drjkl/node-data-store branch 2 times, most recently from e4f3421 to b180e6e Compare July 24, 2026 22:25
@DrJKL DrJKL added the preview label Jul 24, 2026
@codecov

codecov Bot commented Jul 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.16071% with 31 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...erer/extensions/vueNodes/components/LGraphNode.vue 50.00% 9 Missing and 1 partial ⚠️
src/components/graph/GraphCanvas.vue 0.00% 9 Missing ⚠️
src/composables/graph/useVueNodeLifecycle.ts 82.75% 5 Missing ⚠️
src/platform/missingMedia/missingMediaStore.ts 0.00% 3 Missing ⚠️
...nsions/vueNodes/composables/useProcessedWidgets.ts 70.00% 3 Missing ⚠️
src/lib/litegraph/src/node/NodeOutputSlot.ts 92.30% 1 Missing ⚠️
@@                   Coverage Diff                    @@
##             feature/ecs-migration   #13963   +/-   ##
========================================================
  Coverage                         ?   66.26%           
========================================================
  Files                            ?     1568           
  Lines                            ?    79862           
  Branches                         ?    20813           
========================================================
  Hits                             ?    52920           
  Misses                           ?    26603           
  Partials                         ?      339           
Flag Coverage Δ
unit 66.26% <86.16%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/components/builder/AppModeWidgetList.vue 0.00% <ø> (ø)
src/composables/graph/useErrorClearingHooks.ts 96.39% <100.00%> (ø)
src/lib/litegraph/src/node/NodeInputSlot.ts 82.05% <100.00%> (ø)
src/lib/litegraph/src/node/NodeSlot.ts 17.93% <100.00%> (ø)
src/lib/litegraph/src/node/slotLinks.ts 93.50% <ø> (ø)
src/lib/litegraph/src/subgraph/SubgraphNode.ts 82.79% <100.00%> (ø)
src/platform/nodeReplacement/useNodeReplacement.ts 92.85% <100.00%> (ø)
...m/telemetry/nodeAdded/installNodeAddedTelemetry.ts 100.00% <100.00%> (ø)
.../extensions/minimap/composables/useMinimapGraph.ts 91.00% <100.00%> (ø)
...r/extensions/minimap/data/LayoutStoreDataSource.ts 100.00% <100.00%> (ø)
... and 22 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/litegraph/src/LGraphNodeProperties.test.ts (1)

14-23: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use a real LGraphNode here so the accessor path is covered. createMockLGraphNode() returns plain data properties, so these tests still exercise the fallback descriptor branch for title/mode instead of _instrumentAccessor. Switch this suite to a real node instance or a helper that preserves the prototype accessors.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/litegraph/src/LGraphNodeProperties.test.ts` around lines 14 - 23,
Update the test setup in the beforeEach block to construct a real LGraphNode, or
use a helper that preserves LGraphNode’s prototype accessors, instead of
createMockLGraphNode. Keep the existing test values and mockGraph assignment so
title/mode access goes through _instrumentAccessor rather than the fallback
descriptor branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/architecture/ecs-migration-plan.md`:
- Around line 117-127: The Phase 1 store-keying description must distinguish
stores using composite string IDs from graph-scoped stores such as
nodeDataStore. Update the relevant prose to accurately state that nodeDataStore
uses NodeId keys within root-graph-scoped buckets, while preserving the existing
composite-key description for applicable stores.

In `@src/composables/graph/useErrorClearingHooks.ts`:
- Around line 50-51: The NodeLifecycleEvent payload type is duplicated and
should be centralized. Export a shared NodeLifecycleEvent type alongside the
event map definitions in LGraphEventMap.ts, then remove the local aliases and
import the shared type in src/composables/graph/useErrorClearingHooks.ts (lines
50-51) and src/composables/graph/useVueNodeLifecycle.ts (line 17).

In `@src/composables/graph/useVueNodeLifecycle.test.ts`:
- Around line 8-9: Fix test isolation in useVueNodeLifecycle.test.ts by making
the shouldRenderVueNodes and canvas mocks reactive with ref or shallowRef, and
ensure each test receives a fresh createSharedComposable instance by resetting
modules and re-importing the composable per test when needed. Update the
affected tests so initialization and disposal operate on each test’s own graph,
preserving assertions that specifically verify listeners stop seeding after
dispose.

In `@src/lib/litegraph/src/LGraphNode.ts`:
- Around line 1008-1012: Update the type-specific branch in configure() to apply
the same null/missing-value guard as the general property loop before assigning
this._state.type. Preserve the constructor-assigned type when info.type is null
or undefined, and only convert and assign valid serialized type values.
- Around line 4363-4381: Move the node._state.graphId assignment in
registerNodeState until after store.registerNode succeeds, keeping the early
return untouched so refused nodes retain their original state. Preserve the
successful registration flow by assigning the graph ID before updating
node._graphId and registering slots.

In `@src/platform/nodeReplacement/useNodeReplacement.test.ts`:
- Around line 20-22: Update the tests around replaceWithMapping to assert the
registration handoff using the registerNodeState and unregisterNodeState mocks:
verify unregisterNodeState for the old id occurs before registerNodeState for
the replacement node’s id, while preserving the existing no-op stubs.

In `@src/renderer/extensions/minimap/data/LayoutStoreDataSource.ts`:
- Around line 55-61: Update LayoutStoreDataSource’s hasData() and getNodeCount()
to derive their results from the same renderable node set produced by
getNodes(), excluding registered states without layout entries. Avoid
independently rescanning or reallocating layout references for the count; reuse
a single computed node collection per change-check cycle so emptiness and count
remain consistent without duplicate work.
- Around line 47-49: Update the executionState lookup to first store or validate
the result of createNodeLocatorId(null, state.id), and only index
nodeProgressStates when that locator is non-null; otherwise preserve the null
fallback.

In `@src/renderer/extensions/minimap/data/MinimapDataSource.test.ts`:
- Around line 81-96: Replace the local graphNode helper in the minimap tests
with the shared createMockLGraphNode utility from litegraphTestUtils. Update the
test call sites and arguments as needed while preserving the existing node IDs,
positions, sizes, outputs, and other behavior, and remove the duplicated helper
definition.

In `@src/renderer/extensions/vueNodes/components/LGraphNode.vue`:
- Around line 49-53: Update the AppOutput visibility condition for the
output-node selection path to use the reactive hasAnyError computed value
instead of lgraphNode?.has_errors. Also review the related logic around
hasAnyError so all error-dependent visibility checks consistently use that
computed state and clear reactively.

---

Outside diff comments:
In `@src/lib/litegraph/src/LGraphNodeProperties.test.ts`:
- Around line 14-23: Update the test setup in the beforeEach block to construct
a real LGraphNode, or use a helper that preserves LGraphNode’s prototype
accessors, instead of createMockLGraphNode. Keep the existing test values and
mockGraph assignment so title/mode access goes through _instrumentAccessor
rather than the fallback descriptor branch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e1ce3188-d06c-43c2-9884-350107d198f8

📥 Commits

Reviewing files that changed from the base of the PR and between 19e52bd and e789ac9.

📒 Files selected for processing (87)
  • browser_tests/tests/propertiesPanel/errorsTabCloudMissingModels.spec.ts
  • browser_tests/tests/propertiesPanel/errorsTabModeAware.spec.ts
  • docs/architecture/ecs-migration-plan.md
  • docs/architecture/node-badge-store.md
  • docs/architecture/node-data-store.md
  • docs/architecture/proto-ecs-stores.md
  • src/components/builder/AppModeWidgetList.vue
  • src/components/graph/GraphCanvas.vue
  • src/components/rightSidePanel/parameters/WidgetItem.test.ts
  • src/components/rightSidePanel/subgraph/SubgraphEditor.test.ts
  • src/composables/graph/useErrorClearingHooks.test.ts
  • src/composables/graph/useErrorClearingHooks.ts
  • src/composables/graph/useGraphNodeManager.test.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/composables/graph/useNodeErrorFlagSync.test.ts
  • src/composables/graph/useVueNodeLifecycle.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/core/graph/subgraph/migration/proxyWidgetMigration.test.ts
  • src/core/graph/subgraph/promotionUtils.test.ts
  • src/extensions/core/saveImageExtraOutput.test.ts
  • src/lib/litegraph/src/LGraph.test.ts
  • src/lib/litegraph/src/LGraph.ts
  • src/lib/litegraph/src/LGraphCanvas.cloneZIndex.test.ts
  • src/lib/litegraph/src/LGraphCanvas.ghost.test.ts
  • src/lib/litegraph/src/LGraphCanvas.groupSelection.test.ts
  • src/lib/litegraph/src/LGraphCanvas.slotHitDetection.test.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/lib/litegraph/src/LGraphNode.nodeState.test.ts
  • src/lib/litegraph/src/LGraphNode.test.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/lib/litegraph/src/LGraphNodeProperties.test.ts
  • src/lib/litegraph/src/LGraphNodeProperties.ts
  • src/lib/litegraph/src/LiteGraphGlobal.ts
  • src/lib/litegraph/src/infrastructure/LGraphEventMap.ts
  • src/lib/litegraph/src/litegraph.ts
  • src/lib/litegraph/src/node/NodeInputSlot.test.ts
  • src/lib/litegraph/src/node/NodeInputSlot.ts
  • src/lib/litegraph/src/node/NodeSlot.test.ts
  • src/lib/litegraph/src/node/NodeSlot.ts
  • src/lib/litegraph/src/node/slotLinks.ts
  • src/lib/litegraph/src/subgraph/ExecutableNodeDTO.test.ts
  • src/lib/litegraph/src/subgraph/SubgraphNode.ts
  • src/platform/missingMedia/missingMediaStore.ts
  • src/platform/nodeReplacement/useNodeReplacement.test.ts
  • src/platform/nodeReplacement/useNodeReplacement.ts
  • src/platform/telemetry/nodeAdded/installNodeAddedTelemetry.test.ts
  • src/platform/telemetry/nodeAdded/installNodeAddedTelemetry.ts
  • src/renderer/extensions/minimap/composables/useMinimap.test.ts
  • src/renderer/extensions/minimap/composables/useMinimapGraph.test.ts
  • src/renderer/extensions/minimap/composables/useMinimapGraph.ts
  • src/renderer/extensions/minimap/data/LayoutStoreDataSource.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/extensions/minimap/data/MinimapDataSourceFactory.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.subgraph.test.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.test.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.vue
  • src/renderer/extensions/vueNodes/components/LGraphNodePreview.vue
  • src/renderer/extensions/vueNodes/components/NodeContent.vue
  • src/renderer/extensions/vueNodes/components/NodeHeader.test.ts
  • src/renderer/extensions/vueNodes/components/NodeHeader.vue
  • src/renderer/extensions/vueNodes/components/NodeSlots.test.ts
  • src/renderer/extensions/vueNodes/components/NodeSlots.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.test.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/renderer/extensions/vueNodes/composables/useNodeEventHandlers.test.ts
  • src/renderer/extensions/vueNodes/composables/useNodeEventHandlers.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/usePartitionedBadges.test.ts
  • src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts
  • src/renderer/extensions/vueNodes/composables/useProcessedWidgets.test.ts
  • src/renderer/extensions/vueNodes/composables/useProcessedWidgets.ts
  • src/renderer/extensions/vueNodes/utils/__tests__/nodeDataUtils.test.ts
  • src/renderer/extensions/vueNodes/utils/nodeDataUtils.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useImageUploadWidget.test.ts
  • src/stores/appModeStore.test.ts
  • src/stores/linkStore.ts
  • src/stores/nodeDataStore.test.ts
  • src/stores/nodeDataStore.ts
  • src/stores/widgetValueStore.graphReactivity.test.ts
  • src/systems/badgeSystem.pricing.test.ts
  • src/systems/badgeSystem.test.ts
  • src/systems/badgeSystem.ts
  • src/types/nodeState.ts
  • src/utils/__tests__/litegraphTestUtils.ts
  • src/utils/graphTraversalUtil.ts
  • src/utils/searchAndReplace.test.ts
💤 Files with no reviewable changes (4)
  • src/components/rightSidePanel/parameters/WidgetItem.test.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/graph/useGraphNodeManager.test.ts

Comment thread docs/architecture/ecs-migration-plan.md Resolved
Comment thread src/lib/litegraph/src/LGraphNode.ts Resolved
Comment thread src/lib/litegraph/src/LGraphNode.ts Resolved
@DrJKL DrJKL changed the title Quietly, the nodes agree refactor!: make nodeDataStore the source of truth for node shell state Jul 26, 2026
@DrJKL DrJKL added the refactor label Jul 27, 2026
Base automatically changed from drjkl/ecs-stack-audit-fixes to feature/ecs-migration July 27, 2026 23:33
github-actions and others added 16 commits July 27, 2026 23:35
Introduce a dedicated node shell-state store (nodeDataStore) holding one
plain NodeState per node in root-graph-scoped buckets, and make LGraphNode
adopt the store's reactive proxy as _state via the LLink/Reroute trio
pattern. id/type/title/mode/flags/color/bgcolor/shape/resizable/showAdvanced
become accessors over _state; LGraph add/remove/clear and subgraph teardown
register/unregister/clear the store. LGraphNodeProperties instrumentation is
redirected to write through _state instead of shadowing closures.

Scalar getters read through a toRaw view (_stateRaw) so hot litegraph and
legacy-canvas paths skip the reactive proxy trap; flags keeps the reactive
proxy for nested-mutation tracking.

Foundation only; the VueNodeData mirror and useGraphNodeManager sync logic
are removed in a follow-up commit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the VueNodeData snapshot map and its node:property:changed sync
handlers with direct consumption of the NodeState store proxy. GraphCanvas
now sources nodes from nodeDataStore.getGraphNodesFor(rootGraphId, graphId);
the prop-drilled components retype from VueNodeData to NodeState.

Fields the store excludes migrate to their owners: hasErrors -> live
node.has_errors, inputs/outputs -> live node (with the shallowReactive slot
graft relocated into the slimmed useGraphNodeManager), subgraphId derived
from graphId via subgraphIdFromGraphId. useGraphNodeManager keeps only the
layout seeding, slot graft, and slot-label reprojection; extractVueNodeData,
the vueNodeData map, syncWithGraph, and the property-sync handlers are gone.

Node replacement registers/unregisters node state by hand since it bypasses
graph.add. NodeSlots gains inputs/outputs override props for synthetic
preview nodes with no live graph node.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the _stateRaw raw-view mirror so LGraphNode scalar getters read the
reactive _state proxy directly - node.title/mode/color/etc now track in
Vue effects, matching NodeState (computeExecutionOrder hoists id locally
for its tight loop).

Make node type read-only across all node classes now that _state backs
it: configure special-cases type like id, createNode and the missing-node
placeholder write _state.type, redundant SubgraphNode assignment removed.

Consolidate the duplicated { id, subgraphId } locator shape into
nodeLocatorFromState. Escalate the node-data-store registration-collision
log to console.error. Document the enumerability change and type
immutability for extension authors.
Object.create(SubgraphNode.prototype) skips the constructor, so the node has
no _state; assigning id then hit the store-backed accessor on undefined. Seed
_state/_stateRaw on the mock and read id through them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Both suites passed object literals to `graph.add`, which crashed in
`registerNodeState` once nodes adopted store-held `_state`. Use real
`LGraphNode` instances instead of fakes the graph does not own.
`inputs`/`outputs` become accessors over lazily-created `shallowReactive`
arrays; assignment replaces contents in place so the identity the renderer
subscribed to survives `configure`, `clone`, and the `node.inputs =
node.inputs.filter(...)` call sites. `NodeSlot`'s constructor returns
`shallowReactive(this)`, so every reference to a slot is the tracked one
and a rename reaches the renderer without a reprojection pass.

Shallow is deliberate: nested values (`boundingRect`, `_widget`, `pos`)
stay raw, keeping `input._widget === widget` and `NodeInputSlot`'s WeakMap
index cache correct. A deep `reactive()` would break both.

Replaces the runtime `Object.defineProperty` grafting that only ran for
nodes present while the Vue renderer was mounted.
All four responsibilities are resolved rather than relocated:

- `getNode`/`nodeRefs`: `flags.pinned` reads nodeDataStore; live-node
  lookups use `canvasStore.currentGraph.getNodeById`.
- slot-array graft: reactivity is now class-side from construction.
- `node:slot-label:changed` reprojection: slot objects are reactive, so
  `slot.label = ...` is already a tracked write.
- layoutStore seeding: moves to the `LGraph.add`/`LGraph.remove`
  chokepoints, matching `LGraph.createReroute`.

The `configuringGraph` deferral is unnecessary: `add` seeds the entry with
whatever geometry the node has, and the `pos`/`size` setters already write
through, so `configure` updates it as real values land.

The `onNodeAdded` replay loop is gone with it. It re-fired node-added for
every pre-existing node on each graph switch, leaking notifications to
unrelated subscribers; per-graph bootstrap is solely
`layoutStore.initializeFromLiteGraph`. The ancestor guard in
useErrorClearingHooks stays — it is reachable by any interior add — but its
comment no longer cites the deleted replay.

Tests move to the code they exercise: error flags to useNodeErrorFlagSync,
widget-store reactivity to widgetValueStore.graphReactivity, layout seeding
to LGraph, slot reactivity to NodeSlot.
- `NodeHeader.displayTitle`: ref + watch mirror becomes a computed. The
  title write path already round-trips through the store accessor, so the
  optimistic copy had nothing left to optimise.
- `showAdvanced`: the customRef seeded its snapshot once at setup, so an
  external `node.showAdvanced` write never reached the UI. Now a computed
  over the NodeState proxy.
- Drop the `error` prop: it compared the same executionErrorStore field as
  `hasExecutionError`, which `hasAnyError` already folds in.
- `unregisterAllNodeStates` had no barrel importer.
- Five types were exported but only used inside their own file.
- A `_stateRaw` mock field and a comment citing a "raw view" that no
  longer exists.
- WidgetItem.test mocked a module that no longer exists, for a symbol it
  never exported.
Adds migration-plan sections 2c (node shell state), 2d (renderer node
lifecycle) and 2e (slot reactivity), and rewrites node-data-store
Decisions 3, 6 and 7 — the original plan kept a slimmed successor
composable and a `shallowReactive` graft; neither survived.

Also corrects the phantom `nodeBadgeStore`: it shipped in #13458 and was
deleted in favour of derive-on-read, but three docs still described the
file as existing.
The renderer can now ask what slots a node has without resolving the live
LGraphNode: `NodeSlots.vue` drops `getNodeByLocatorId` and `app.rootGraph`,
and `LGraphNode.vue`'s hasInputs/hasOutputs/hasVideoInput read the store.

Slots live in a sibling map beside `graphNodeStates`, the shape
widgetValueStore already uses for widget order, rather than a new store. The
arrays are held BY REFERENCE — the node's own arrays — so array order is slot
order and there is nothing to keep in step.

No per-slot key and no slot ids. Index is a property of the containing array,
not of the slot, and ~25 sites permute it (including reorderSubgraphInputs, a
pure permutation reachable by drag). linkStore shows the cost of keying on an
index: six re-keying mechanisms, one a load-time corruption-repair pass added
for the reorder case that was originally missed.

This rests on `reactive()` returning an already-shallowReactive value
unchanged, so the store neither swaps the array's identity nor deep-wraps the
slots inside it. Pinned by test; a plain array in the same position WOULD be
wrapped, which is why the arrays must stay shallowReactive.

Also fixes registerNodeState's ownership marker: `registerNode` now signals
refusal with `undefined` instead of returning the caller's own state, so
`_graphId` no longer depends on proxy identity differing. Slot cleanup on
remove relies on that marker.

ExecutableNodeDTO's scale test now bulk-adds with skipComputeOrder, as
LGraph.configure does; the per-add updateExecutionOrder is O(n^2) and
unrelated to the id generation under test (2.9s -> 0.27s).
MinimapDataSource.test.ts had its own createMockGraph, createMockLinks
and graphNode, each ending in `as unknown as`. All three already exist in
litegraphTestUtils, so use those and drop the casts.

createMockLGraph gains the pieces the minimap needed — node list, groups,
links, a getNodeById wired from the nodes, and a self-referencing
rootGraph — and both it and createMockLGraphNode build through
shoehorn's fromPartial rather than a double cast. Same for
createMockLoadedWorkflow, the last `as unknown as` in the file.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@DrJKL
DrJKL marked this pull request as ready for review July 28, 2026 22:24
Required fields first, then optional, alphabetical within each group;
the `_state` literal in the LGraphNode ctor and `createNodeState` follow
the same order, as does the nodeDataStore return object.

Comments cut to what the code cannot say: the NodeState header, the
store header, and `nodeHasError` — which keeps only the note that
`has_errors` is deliberately not consulted.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dosubot dosubot Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Jul 28, 2026
@DrJKL

DrJKL commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Third pass, in 09377fd and 43eae3d.

as unknown as in the minimap test — all three gone. createMockGraph, createMockLinks and graphNode already existed in litegraphTestUtils, so the local copies are deleted and the test calls the shared ones. createMockLGraph gained what the minimap needed (node list, groups, links, a getNodeById wired from the nodes, self-referencing rootGraph), and both it and createMockLGraphNode now build through fromPartial instead of a double cast. Also took out createMockLoadedWorkflow's as unknown as — it was the last one in the file. All 51 suites that consume those helpers pass (1199 tests).

NodeState sorting — required first then optional, alphabetical within each group. The _state literal in the LGraphNode constructor and createNodeState follow the same order, and nodeDataStore's return object is alphabetical.

Comments — NodeState's header is 3 lines, the store's is 3, and nodeHasError keeps only the one thing the code can't say: that has_errors is deliberately not consulted. To your question — no, most of that block was restating the body, so it's gone.

Deferrals, no action — useVueNodeLifecycle.ts / .test.ts, useNodeErrorFlagSync.test.ts, and MinimapDataSourceFactory's two-homes note all resolve further down the stack.

CI is green on bcd88b8 — all eight Playwright shards pass, including 1, 2, 6 and 7, which were the ones failing on f851722. That confirms the slot getter collision fixed in 5b58d12 was the cause.

One local-only note: ColorWidget.test.ts fails intermittently in a full parallel run on Windows and passes alone (12/12). It does vi.resetModules() plus a dynamic import in beforeEach. Unrelated to this branch — CI's unit job is green — but it is a real flake if you want it hardened separately.

DrJKL and others added 2 commits July 28, 2026 15:32
Also folds the duplicate inline instanceof check in the reordering test
into the same helper.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`mountLifecycle` returns null rather than throwing, and the two
"expected a link" guards become `expect(...).not.toBeNull()` — an
assertion is what they were standing in for. The two widget-state guards
go away entirely; `state?.value` reads the same and a missing state still
fails the assertion below.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@christian-byrne christian-byrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. We arguably want to remove some of these modules out of the litegraph folder now
  2. Can you do a pass that adds asserts? Ideally, we add datadog/Rum as a reporter. On cloud prod, we can check if any invariants throughout the code are failing. Example: trying to LGraph.add node that is structurally identical.

Comment on lines +289 to +299
**Why no keyed `SlotState` and no slot ids.** The draft above proposed
`getSlotKey(nodeId, index, isInput)`. That is not viable: slot index is a
property of the containing array, not of the slot, and ~25 sites permute it —
including `reorderSubgraphInputs` (`subgraphUtils.ts`), a _pure permutation_ with
no add or remove, reachable by dragging subgraph inputs in the right panel. An
index-keyed store must re-key on every one of them. `linkStore` shows the price:
it survives reorder only via six separate mechanisms, one of which
(`realignInputLinkSlots`, `linkDeduplication.ts`) is a load-time
corruption-repair pass added for the reorder case that was originally missed
(#3348). A link's key is derived from fields the link genuinely owns; a slot's
index is not slot state, so keying on it would be a mirror.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable for index to be owned by the container.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to not ever need to know the index. If inputs/outputs were always name addressed instead, we wouldn't need to worry about order/insertion/deletion.

Comment on lines +233 to +248
Two consequences worth recording:

- The **`configuringGraph` deferral is gone.** The `node:added` listener seeds
the layout entry with whatever geometry the node has; the `pos`/`size` setters
already write through to `layoutStore`, so `configure()` updates the entry as
the real values land. No `onAfterGraphConfigured` chaining, no `window.app`
read.
- The **`onNodeAdded` replay loop is gone.** It re-fired `onNodeAdded` for every
pre-existing node on each graph switch, which leaked spurious node-added
notifications to unrelated subscribers (`useErrorClearingHooks` still carries
a guard written for exactly that). Per-graph layout bootstrap is now solely
`layoutStore.initializeFromLiteGraph`, called from `useVueNodeLifecycle` on
graph entry — which is what makes subgraph navigation seed the right nodes.

`useVueNodeLifecycle` keeps only layout bootstrap and the Layout↔LiteGraph sync
lifecycle, and no longer patches anything — see 2g.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great

Comment on lines +317 to +335
### 2g. node:added / node:removed events ✅ Shipped

`LGraphEventMap` had `node:before-removed` but no add-side counterpart, so every
consumer that needed to know about a node add wrapped the single
`graph.onNodeAdded` callback slot, saving and restoring the previous value.
**Four** did so concurrently: the renderer's empty-graph bootstrap, the
error-clearing hooks, the minimap, and node-added telemetry. Whichever restored
first put back the _pre-its-own-install_ value and silently discarded the others
— order-dependent, per graph switch.

`LGraph.add` now dispatches `node:added` (after the node is attached and
registered) and `LGraph.remove` dispatches `node:removed` (after detach, so
`node.graph` is already null and execution ids must be derived from the
dispatching graph plus `node.id`). All four consumers are plain
`addEventListener` subscribers; none touches the callback slot. `onNodeAdded` /
`onNodeRemoved` remain for extension compatibility.

`useNodeReplacement` bypasses `graph.add` by design (it swaps a node in place,
preserving the id), so `replaceWithMapping` announces the add itself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if these new events are private. Then we will expose things properly in the public API. Lest people will build on them.

Comment on lines +282 to +296
private setTrackedState<K extends keyof NodeState>(
property: K,
value: NodeState[K]
): void {
const oldValue = this._state[property]
if (oldValue === value) return

this._state[property] = value
this.graph?.trigger('node:property:changed', {
nodeId: this.id,
property,
oldValue,
newValue: value
})
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it might want to be refactored out of LGraphNode.ts

node = new base_class(title)
node._state.type = type
} catch (error) {
if (!this.catch_exceptions) throw error

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this.catch_exceptions even used?

Comment on lines +72 to +77
function hasMissingMediaOnNode(nodeLocatorId: NodeLocatorId): boolean {
const executionId =
useWorkflowStore().nodeLocatorIdToNodeExecutionId(nodeLocatorId)
return executionId ? missingMediaNodeIds.value.has(executionId) : false
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like it should be computed

@DrJKL

DrJKL commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author
  1. We arguably want to remove some of these modules out of the litegraph folder now

    1. Can you do a pass that adds asserts? Ideally, we add datadog/Rum as a reporter. On cloud prod, we can check if any invariants throughout the code are failing. Example: trying to LGraph.add node that is structurally identical.

I'll add both of these as TODOs on the stack 🫡

@DrJKL

DrJKL commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@christian-byrne thanks for the pass. DrJKL will follow up on the architectural items:

  • Keep the new node lifecycle notifications internal until there is an intentional public extension API, so extensions do not build against node:added / node:removed directly.
  • Move the app-owned shell-state/event coordination out of the LiteGraph boundary as a coherent responsibility. That pass will include setTrackedState; extracting that helper alone would just create a one-use wrapper.
  • Add targeted graph/store invariants, including duplicate node-instance and registration-identity checks, and wire the assertion reporter to Datadog/RUM for cloud production visibility.

For the two local questions: catch_exceptions is still behaviorally active in createNode (it controls rethrow versus log-and-return-null), so removing it needs a separate compatibility audit. hasMissingMediaOnNode is a parameterized lookup over the already-computed node-ID set and mirrors the missing-model store, so it will stay a function unless a later store cleanup introduces a computed locator-ID index.

@DrJKL
DrJKL merged commit 6d1cd8e into feature/ecs-migration Jul 29, 2026
48 checks passed
@DrJKL
DrJKL deleted the drjkl/node-data-store branch July 29, 2026 00:49

@AustinMroz AustinMroz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed the train, but the changes have my approval.

Comment on lines +18 to +20
{
tag: '@vue-nodes'
},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{
tag: '@vue-nodes'
},
{ tag: '@vue-nodes' },

お疲れ様でした

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll assume you're saying I should add newlines to more of these?

Comment on lines -142 to -145
const nodeData = extractVueNodeData(node)

return {
...nodeData,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

const layoutMutations = useLayoutMutations()
const { shouldRenderVueNodes } = useVueFeatureFlags()
const nodeManager = shallowRef<GraphNodeManager | null>(null)
const isInitialized = shallowRef(false)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this just be a ref now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shallowRef and ref aren't too terribly different for a boolean value.

watch(names, onChange)
expect(names.value).toBe('a,b,c')

// Extensions mutate this array directly, with no store call to notice.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now.

DrJKL added a commit that referenced this pull request Aug 12, 2026
Collapses the twelve reviewed slices of the ECS migration into one
commit so the series can be replayed onto main as a unit. Each slice
kept its own review on GitHub:

- ECS: Moving widgets out of the Node data (#13322)
- ECS: Link topology store (single source of truth for link data) (#13436)
- ECS: Reroute chain store with derived link membership (#13449)
- ECS: derive slot floating links; reroute cleanup follow-ups (#13451)
- refactor: read widgeted-input connectivity from linkStore (#13455)
- feat: nodeBadgeStore + badge system (slice A) (#13458)
- refactor: derive badge rows on read, delete the badge store (#13686)
- refactor: host-scoped promoted widget rows (no source traversal) (#13434)
- refactor!: delete the output.links runtime mirror (#13479)
- refactor!: delete the input.link runtime mirror (#13498)
- fix: ECS stack audit fixes (#13528)
- refactor!: make nodeDataStore the source of truth for node shell state (#13963)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ff78d-80f9-73e1-986a-5e4abc9f9d6a
christian-byrne added a commit that referenced this pull request Aug 24, 2026
…Shell (#14257)

**STACKED — merging lands on `feature/ecs-migration` (owned by @DrJKL,
PR #13963's base), NOT `main`.**

## ELI-5

The code that wires a node's "shell state" (title, mode, colours,
shape…) into the app's Pinia stores was living inside the vendored
`src/lib/litegraph` folder, even though it is entirely app-owned. This
moves those definitions into `src/core/graph/nodeShell/` and leaves
one-line call sites behind in litegraph. Nothing changes at runtime —
same functions, same order, same events.

Fulfils the TODO committed to in
#13963 (comment).
cc @DrJKL

## What moved

`src/core/graph/nodeShell/nodeShellState.ts`

- `createNodeShellState(title, type, titleMode)` — the object literal
that was inline in the `LGraphNode` constructor.
- `setTrackedNodeState(node, property, value)` — the body of the former
private `LGraphNode.setTrackedState`; the six accessors (`title`,
`mode`, `color`, `bgcolor`, `showAdvanced`, `shape`) now call it.
- `registerNodeState` / `unregisterNodeState` /
`unregisterAllNodeStates` — moved verbatim.

`src/core/graph/nodeShell/nodeShellLifecycle.ts`

- `attachNodeToStores(graph, node)` — `registerNodeState` plus the
widget `setNodeId` / `setNodeWidgetOrder` block that was inline in
`LGraph.add`. `LGraph.add` is now a single call, in exactly the position
`registerNodeState` occupied (after `node.graph = this`, before
`_nodes.push` / `onAdded` / `node:added`).
- `releaseGraphStores(graph)` — the store-teardown block from
`LGraph.clear`. `LGraph.clear` is now a single call.

Also: `LGraph.remove` imports `unregisterNodeState` /
`unregisterAllNodeStates` from the new module, `LGraphNode.ts` no longer
imports `useNodeDataStore`, and the litegraph barrel no longer
re-exports `registerNodeState` / `unregisterNodeState` (new in #13963,
nothing external can depend on them yet — keeping the surface private
per review feedback). `useNodeReplacement` imports them from the new
module instead.

`fireNodeRemovalLifecycle` stays in `LGraph.ts` (litegraph events only,
no store access), and the link/reroute helpers stay in `LLink.ts` /
`Reroute.ts` — `releaseGraphStores` imports them from their current
homes.

## Judgment calls

- **Two files rather than one.** `nodeShellState.ts` holds the
node-level definitions and imports only `nodeDataStore`;
`nodeShellLifecycle.ts` holds the graph-level attach/release
coordination and is the only one that reaches for `LLink` / `Reroute` /
the other stores. That keeps `LGraphNode`'s new runtime import off the
`Reroute → litegraph barrel → LGraphNode` cycle. A production `vite
build` was run to confirm the module graph still resolves.
- **Skipped the optional `graphTriggers.ts` move.** DrJKL's stack
(#14110 → #14128 → #14133) is still open against this base, so the diff
is kept to a strict definitions-move to keep those rebases cheap. Moving
`graphTriggers.ts` would touch the barrel's export path and
`LGraph.ts`'s import block for no functional gain in this pass.
- **Tests.** The two registration/unregistration cases from
`LGraphNode.nodeState.test.ts` moved to
`src/core/graph/nodeShell/nodeShellState.test.ts` with assertions
unchanged; the accessor and `configure` cases stay where they are. Two
new cases cover `createNodeShellState`'s defaults. No test was deleted
or weakened. `useNodeReplacement.test.ts`'s barrel mock split into a
second `vi.mock` for the new module.

## Verification

`pnpm typecheck`, `pnpm lint` (0 errors), `pnpm knip`, and `vite build`
are clean. Targeted suites (litegraph, nodeShell, nodeDataStore,
nodeReplacement, minimap) — 91 files / 1341 tests pass.

Full `vitest run`: 14260 passed, 1 failed —
`src/platform/cloud/onboarding/onboardingCloudRoutes.test.ts > lazily
resolves the /oauth layout and consent view components`, a 5s timeout on
a dynamic route import. It passes in isolation, is untouched by this
diff, and an earlier full run under load failed a different pair of
tests, so it reads as a load-dependent flake rather than a regression.
Flagging rather than hiding it.

---------

Co-authored-by: Christian Byrne <cbyrne@comfy.org>
balpreetgrowthnatives pushed a commit to balpreetgrowthnatives/ComfyUI_frontend that referenced this pull request Aug 24, 2026
## Summary

Still-draft feature branch for migrating entity state from LiteGraph
objects and runtime mirrors into dedicated stores with derived, reactive
views.

This consolidates the reviewed ECS migration slices, strengthens their
coverage, incorporates the layout-state follow-up, and documents the
current migration status and remaining work.

## Changes

- Move widget values and node shell state into dedicated stores.
- Make link topology the source of truth for connectivity.
- Store reroute chains while deriving membership and floating-link
state.
- Derive widgeted input connectivity, badges, and promoted widget rows
from store-backed state.
- Remove the input and output runtime link mirrors.
- Keep DOM measurements separate from persisted node layout state.
- Add migration coverage, extension guidance, and architecture/status
documentation.

Reviewed PRs merged into this feature branch:

- [Comfy-Org#13322 — Move widgets out of node
data](Comfy-Org#13322)
- [Comfy-Org#13434 — Host-scoped promoted widget
rows](Comfy-Org#13434)
- [Comfy-Org#13436 — Link topology
store](Comfy-Org#13436)
- [Comfy-Org#13449 — Reroute chain
store](Comfy-Org#13449)
- [Comfy-Org#13451 — Derived floating links and reroute
cleanup](Comfy-Org#13451)
- [Comfy-Org#13455 — Store-backed widgeted input
connectivity](Comfy-Org#13455)
- [Comfy-Org#13458 — Badge store and
system](Comfy-Org#13458)
- [Comfy-Org#13479 — Remove the output-link runtime
mirror](Comfy-Org#13479)
- [Comfy-Org#13498 — Remove the input-link runtime
mirror](Comfy-Org#13498)
- [Comfy-Org#13528 — Cross-stack migration audit
fixes](Comfy-Org#13528)
- [Comfy-Org#13686 — Derive badges on
read](Comfy-Org#13686)
- [Comfy-Org#13963 — Node data
store](Comfy-Org#13963)
- [Comfy-Org#14110 — Centralize node, group, and reroute
geometry](Comfy-Org#14110)
- [Comfy-Org#14128 — Register node geometry at
attach](Comfy-Org#14128)
- [Comfy-Org#14133 — Read node geometry from the
store](Comfy-Org#14133)
- [Comfy-Org#14758 — Keep DOM measurements out of saved node
sizes](Comfy-Org#14758)
- [Comfy-Org#15001 — Extract entity ID
allocation](Comfy-Org#15001)
- [Comfy-Org#15009 — Scope link and reroute topology by owning
graph](Comfy-Org#15009)
- [Comfy-Org#15017 — Centralize layout ownership and command
submission](Comfy-Org#15017)
- [Comfy-Org#15018 — Preserve subgraph topology during
unpack](Comfy-Org#15018)
- [Comfy-Org#15019 — Transfer node ownership during
replacement](Comfy-Org#15019)
- [Comfy-Org#15330 — Map migration status and remaining
work](Comfy-Org#15330)

## Review Focus

- Store ownership and synchronization boundaries.
- Serialization, undo/redo, subgraph, and extension compatibility.
- Whether remaining direct entity state should migrate before this
feature leaves draft.

## Status

Still draft. The branch is rebased onto `main`; CI is running against
the rebased history.

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Christian Byrne <cbyrne@comfy.org>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Matt Miller <mattmiller@comfy.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview refactor size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants