Repository navigation
feat: nodeBadgeStore + badge system (slice A) - #13458
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds graph-scoped node badge storage, LiteGraph lifecycle registration, reactive core and credits badge generation, pricing updates, test coverage, Pinia test setup, and slice A architecture documentation. ChangesNode badge infrastructure
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant LGraph
participant useNodeBadgeStore
participant startBadgeSystem
participant gatherSources
participant computeBadges
LGraph->>useNodeBadgeStore: registerNode(graphId, nodeId)
startBadgeSystem->>useNodeBadgeStore: watch registeredNodeIds(graphId)
startBadgeSystem->>gatherSources: resolve node badge sources
gatherSources->>computeBadges: project visible rows
computeBadges->>useNodeBadgeStore: update core and credits rows
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🎭 Playwright: ✅ 1694 passed, 0 failed · 1 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-07-15T01:24:01.673Z",
"gitSha": "ab796b0bfb639cc7ec786d15fd020ba37cb0fe9e",
"branch": "drjkl/a-badge-is-announced",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2014.7049999999922,
"styleRecalcs": 7,
"styleRecalcDurationMs": 4.694999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 378.79100000000005,
"heapDeltaBytes": -944800,
"heapUsedBytes": 57472384,
"domNodes": 14,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 19.598999999999997,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-idle",
"durationMs": 2060.217000000023,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.772000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 407.973,
"heapDeltaBytes": -6591424,
"heapUsedBytes": 63314096,
"domNodes": -283,
"jsHeapTotalBytes": 17453056,
"scriptDurationMs": 22.259,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1859.3199999999968,
"styleRecalcs": 74,
"styleRecalcDurationMs": 40.064,
"layouts": 12,
"layoutDurationMs": 3.6109999999999998,
"taskDurationMs": 777.111,
"heapDeltaBytes": 8175280,
"heapUsedBytes": 59518268,
"domNodes": -235,
"jsHeapTotalBytes": 17952768,
"scriptDurationMs": 119.309,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1808.0940000000396,
"styleRecalcs": 72,
"styleRecalcDurationMs": 34.902,
"layouts": 12,
"layoutDurationMs": 3.5530000000000004,
"taskDurationMs": 750.126,
"heapDeltaBytes": -3567724,
"heapUsedBytes": 55111080,
"domNodes": 54,
"jsHeapTotalBytes": 19398656,
"scriptDurationMs": 129.276,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1772.9160000000093,
"styleRecalcs": 33,
"styleRecalcDurationMs": 15.934999999999997,
"layouts": 6,
"layoutDurationMs": 0.5920000000000001,
"taskDurationMs": 305.284,
"heapDeltaBytes": 2991548,
"heapUsedBytes": 62045756,
"domNodes": 79,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 25.579000000000004,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1723.7250000000586,
"styleRecalcs": 32,
"styleRecalcDurationMs": 17.332,
"layouts": 6,
"layoutDurationMs": 0.6040000000000001,
"taskDurationMs": 340.48100000000005,
"heapDeltaBytes": -3548844,
"heapUsedBytes": 66406312,
"domNodes": -225,
"jsHeapTotalBytes": 12472320,
"scriptDurationMs": 22.968000000000004,
"eventListeners": -184,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 593.6809999999753,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.536,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 361.89,
"heapDeltaBytes": -2666816,
"heapUsedBytes": 49389624,
"domNodes": -272,
"jsHeapTotalBytes": 1437696,
"scriptDurationMs": 57.27600000000001,
"eventListeners": -203,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 575.9239999999863,
"styleRecalcs": 12,
"styleRecalcDurationMs": 8.957999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 360.588,
"heapDeltaBytes": 11695196,
"heapUsedBytes": 64360172,
"domNodes": -289,
"jsHeapTotalBytes": 5369856,
"scriptDurationMs": 59.436,
"eventListeners": -203,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2015.7809999999472,
"styleRecalcs": 11,
"styleRecalcDurationMs": 9.628,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 638.865,
"heapDeltaBytes": -12330592,
"heapUsedBytes": 65662880,
"domNodes": 22,
"jsHeapTotalBytes": 8007680,
"scriptDurationMs": 229.659,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2044.1190000000233,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 644.6879999999999,
"heapDeltaBytes": -7138556,
"heapUsedBytes": 56494224,
"domNodes": -270,
"jsHeapTotalBytes": -1875968,
"scriptDurationMs": 231.328,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2118.072999999981,
"styleRecalcs": 68,
"styleRecalcDurationMs": 15.541999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1213.8629999999998,
"heapDeltaBytes": 15815820,
"heapUsedBytes": 81311716,
"domNodes": -278,
"jsHeapTotalBytes": -360448,
"scriptDurationMs": 548.627,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2122.5689999999986,
"styleRecalcs": 69,
"styleRecalcDurationMs": 16.282,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1194.197,
"heapDeltaBytes": -9604528,
"heapUsedBytes": 55917788,
"domNodes": -275,
"jsHeapTotalBytes": 745472,
"scriptDurationMs": 558.184,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3212.557000000004,
"styleRecalcs": 66,
"styleRecalcDurationMs": 19.385999999999996,
"layouts": 60,
"layoutDurationMs": 7.384999999999999,
"taskDurationMs": 1530.21,
"heapDeltaBytes": 865940,
"heapUsedBytes": 60260796,
"domNodes": 14,
"jsHeapTotalBytes": 8388608,
"scriptDurationMs": 740.623,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3111.503999999968,
"styleRecalcs": 62,
"styleRecalcDurationMs": 14.726999999999997,
"layouts": 60,
"layoutDurationMs": 6.871,
"taskDurationMs": 1442.627,
"heapDeltaBytes": 21579820,
"heapUsedBytes": 76900108,
"domNodes": 6,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 692.185,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2052.1759999999745,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.121999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 659.103,
"heapDeltaBytes": -20270072,
"heapUsedBytes": 57786668,
"domNodes": -272,
"jsHeapTotalBytes": 2961408,
"scriptDurationMs": 235.20000000000002,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2011.6519999999127,
"styleRecalcs": 7,
"styleRecalcDurationMs": 5.303999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 596.606,
"heapDeltaBytes": 5275200,
"heapUsedBytes": 59530352,
"domNodes": -267,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 221.829,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 605.214999999987,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.841999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 383.9920000000001,
"heapDeltaBytes": 15253624,
"heapUsedBytes": 68208400,
"domNodes": -289,
"jsHeapTotalBytes": 1961984,
"scriptDurationMs": 118.242,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66666666666665,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 529.8099999999977,
"styleRecalcs": 47,
"styleRecalcDurationMs": 11.088000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 343.45599999999996,
"heapDeltaBytes": 7596768,
"heapUsedBytes": 66799696,
"domNodes": 20,
"jsHeapTotalBytes": 20185088,
"scriptDurationMs": 120.86999999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2022.0259999999826,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.877000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 331.3,
"heapDeltaBytes": 4399452,
"heapUsedBytes": 67984932,
"domNodes": 18,
"jsHeapTotalBytes": 14942208,
"scriptDurationMs": 15.524000000000001,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 1992.2789999999964,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.467,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 336.19599999999997,
"heapDeltaBytes": -1376520,
"heapUsedBytes": 57741892,
"domNodes": 20,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 15.129,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1714.8300000000063,
"styleRecalcs": 77,
"styleRecalcDurationMs": 35.156,
"layouts": 16,
"layoutDurationMs": 3.8280000000000007,
"taskDurationMs": 678.697,
"heapDeltaBytes": -16646568,
"heapUsedBytes": 53126128,
"domNodes": -234,
"jsHeapTotalBytes": 19812352,
"scriptDurationMs": 86.69200000000001,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1680.5249999999887,
"styleRecalcs": 76,
"styleRecalcDurationMs": 36.455,
"layouts": 16,
"layoutDurationMs": 3.999,
"taskDurationMs": 643.265,
"heapDeltaBytes": -8846700,
"heapUsedBytes": 53460588,
"domNodes": 65,
"jsHeapTotalBytes": 26476544,
"scriptDurationMs": 90.051,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-transition-enter",
"durationMs": 1016.1939999999845,
"styleRecalcs": 18,
"styleRecalcDurationMs": 31.692999999999998,
"layouts": 14,
"layoutDurationMs": 15.533000000000001,
"taskDurationMs": 815.8429999999998,
"heapDeltaBytes": -709444,
"heapUsedBytes": 90621420,
"domNodes": 12228,
"jsHeapTotalBytes": 11812864,
"scriptDurationMs": 26.888999999999996,
"eventListeners": 844,
"totalBlockingTimeMs": 149,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8203.395,
"styleRecalcs": 250,
"styleRecalcDurationMs": 51.745,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4343.032999999999,
"heapDeltaBytes": 1587536,
"heapUsedBytes": 60656376,
"domNodes": -268,
"jsHeapTotalBytes": 8552448,
"scriptDurationMs": 1858.799,
"eventListeners": -118,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8178.772000000037,
"styleRecalcs": 250,
"styleRecalcDurationMs": 48.92400000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4158.005999999999,
"heapDeltaBytes": 2627104,
"heapUsedBytes": 66212008,
"domNodes": -271,
"jsHeapTotalBytes": -98304,
"scriptDurationMs": 1850.67,
"eventListeners": -183,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 12379.501000000004,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 12343.181999999999,
"heapDeltaBytes": -27988952,
"heapUsedBytes": 166572232,
"domNodes": -3300,
"jsHeapTotalBytes": -524288,
"scriptDurationMs": 891.9080000000001,
"eventListeners": -16370,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 12123.301999999967,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 12104.232,
"heapDeltaBytes": -50720604,
"heapUsedBytes": 171303400,
"domNodes": -8311,
"jsHeapTotalBytes": 23851008,
"scriptDurationMs": 913.4850000000001,
"eventListeners": -16374,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 15728.33700000001,
"styleRecalcs": 81,
"styleRecalcDurationMs": 17.588999999999967,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15707.719000000001,
"heapDeltaBytes": -41372048,
"heapUsedBytes": 164426952,
"domNodes": -8311,
"jsHeapTotalBytes": 16486400,
"scriptDurationMs": 1214.732,
"eventListeners": -16376,
"totalBlockingTimeMs": 20,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 15362.539000000084,
"styleRecalcs": 76,
"styleRecalcDurationMs": 16.751000000000015,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15339.827000000001,
"heapDeltaBytes": -57822192,
"heapUsedBytes": 155172328,
"domNodes": -3300,
"jsHeapTotalBytes": 14389248,
"scriptDurationMs": 1279.799,
"eventListeners": -16376,
"totalBlockingTimeMs": 19,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 449.36500000000024,
"styleRecalcs": 18,
"styleRecalcDurationMs": 24.776999999999997,
"layouts": 5,
"layoutDurationMs": 1.435,
"taskDurationMs": 113.098,
"heapDeltaBytes": 5217452,
"heapUsedBytes": 64500876,
"domNodes": 168,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 17.17,
"eventListeners": 69,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 513.8189999998986,
"styleRecalcs": 14,
"styleRecalcDurationMs": 20.276000000000003,
"layouts": 5,
"layoutDurationMs": 1.8429999999999997,
"taskDurationMs": 176.793,
"heapDeltaBytes": -1777684,
"heapUsedBytes": 51400976,
"domNodes": -146,
"jsHeapTotalBytes": -659456,
"scriptDurationMs": 16.8,
"eventListeners": -132,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
}
]
} |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## feature/ecs-migration #13458 +/- ##
========================================================
Coverage ? 78.71%
========================================================
Files ? 1654
Lines ? 111155
Branches ? 39977
========================================================
Hits ? 87499
Misses ? 22802
Partials ? 854
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
fe199d2 to
a6b9d4e
Compare
3410ae6 to
cb9ebec
Compare
abe1cf7 to
c757a23
Compare
| SUBGRAPH_OUTPUT_ID | ||
| } from '@/lib/litegraph/src/constants' | ||
| import { isNodeBindable } from '@/lib/litegraph/src/utils/type' | ||
| import type { UUID } from '@/utils/uuid' |
There was a problem hiding this comment.
issue: (blocking) Three computed() reads — useUpstreamValue.ts:24, useProcessedWidgets.ts:542, NodeSlots.vue:68 — now access canvas?.graph?.rootGraph.id through a shallowRef<LGraphCanvas>, losing reactive tracking when the graph id changes on workflow reload. The deleted canvasStore.rootGraphId computed was the reactive bridge. After a second workflow load those computeds return the stale old UUID, causing widgetValueStore/linkStore queries to hit the wrong bucket silently. The deleted test in canvasStore.test.ts that verified rootGraphId reactivity should be restored.
Also: startBadgeSystem (slice B) takes a fixed graphId — with the shallowRef gone, there is no reactive signal for a restart when graph.configure() reassigns the id. Either restore canvasStore.rootGraphId as a computed tracking via the 'configured' event, or re-promote LGraph.id to a shallowRef.
There was a problem hiding this comment.
This diff never touches LGraph.id — at HEAD it's shallowRef-backed (LGraph.ts:296), canvasStore.rootGraphId exists (canvasStore.ts:118) with its reactivity test, and all three computeds track through it. That work landed in #13455 ("fix: make LGraph.id reactive so graph-id reads track workflow loads"), now merged into feature/ecs-migration; the diff showing it deleted was against main. Slice-B restart concern is handled the same way: the bootstrap can watch(canvasStore.rootGraphId).
| @@ -395,6 +411,17 @@ | |||
| if (this.isRootGraph && graphId !== zeroUuid) { | |||
| usePreviewExposureStore().clearGraph(graphId) | |||
| useWidgetValueStore().clearGraph(graphId) | |||
There was a problem hiding this comment.
issue: (blocking) LGraph.id was a shallowRef<UUID> with reactive getter/setter; this PR replaces it with a plain id: UUID = zeroUuid field and also removes canvasStore.rootGraphId. Three computed() reads now access canvas?.graph?.rootGraph.id through a shallowRef<LGraphCanvas> — deep property reads through a shallowRef are not transitively tracked. On workflow reload (graph.configure() reassigns the id), those computeds return the stale old UUID silently: useUpstreamValue.ts:24 queries wrong upstream, useProcessedWidgets.ts:542 queries widgetValueStore under the old bucket, NodeSlots.vue:68 passes the wrong graphId to linkStore. The test deleted from canvasStore.test.ts that verified rootGraphId reactivity should not be removed without a replacement.
For slice B: startBadgeSystem takes a fixed graphId — with the reactive signal gone there is no mechanism to restart the system when configure() assigns a new id. The badge system would silently watch a dead bucket for the rest of the session. Either restore canvasStore.rootGraphId as a computed tracking via a 'configured' event, or re-promote LGraph.id to a shallowRef.
There was a problem hiding this comment.
This diff never touches LGraph.id — at HEAD it's shallowRef-backed (LGraph.ts:296), canvasStore.rootGraphId exists (canvasStore.ts:118) with its reactivity test, and all three computeds track through it. That work landed in #13455 ("fix: make LGraph.id reactive so graph-id reads track workflow loads"), now merged into feature/ecs-migration; the diff showing it deleted was against main. Slice-B restart concern is handled the same way: the bootstrap can watch(canvasStore.rootGraphId).
| const slotMetadata = new Map<string, WidgetSlotMetadata>() | ||
|
|
||
| function makeReactiveNodeArrays(node: LGraphNode): { | ||
| inputs: INodeInputSlot[] |
There was a problem hiding this comment.
issue: (blocking) The reactiveArrayNodes WeakSet that prevented makeReactiveNodeArrays from stacking getter layers on repeated calls was removed in this diff. During graph configuration (configuringGraph=true), handleNodeAdded calls extractVueNodeData(node) and then onAfterGraphConfigured calls it again -- makeReactiveNodeArrays fires twice per node on every workflow load, stacking a syncing getter on top of the existing one. The deleted test "does not re-wrap node.widgets on repeated extraction" proved this invariant and should be restored alongside the WeakSet guard.
There was a problem hiding this comment.
Guard is present at HEAD (useGraphNodeManager.ts:28,67-70) along with the "does not re-wrap node.widgets on repeated extraction" test (useGraphNodeManager.test.ts:69). It landed via #13455; this PR doesn't touch the file. Stale diff-vs-main.
| if (window.app?.configuringGraph) { | ||
| // During workflow loading - defer layout initialization until configure completes | ||
| // Chain our callback with any existing onAfterGraphConfigured callback | ||
| node.onAfterGraphConfigured = useChainCallback( |
There was a problem hiding this comment.
issue: (blocking) This second call to extractVueNodeData during onAfterGraphConfigured, combined with the earlier call in handleNodeAdded, double-invokes makeReactiveNodeArrays per node on every workflow load due to the removed WeakSet guard. See the comment above at the first call site.
There was a problem hiding this comment.
Guard is present at HEAD (useGraphNodeManager.ts:28,67-70) along with the "does not re-wrap node.widgets on repeated extraction" test (useGraphNodeManager.test.ts:69). It landed via #13455; this PR doesn't touch the file. Stale diff-vs-main.
| unregisterAllRerouteChains(this) | ||
| for (const node of this._nodes) { | ||
| useNodeBadgeStore().unregisterNode(this.rootGraph.id, node.id) | ||
| } |
There was a problem hiding this comment.
issue: The else-branch of clear() iterates this._nodes (direct nodes only) for unregisterNode calls. Nodes nested 2+ levels deep -- a SubgraphNode whose definition contains another SubgraphNode containing InnerNode -- are not unregistered and accumulate in the badge store indefinitely. When the badge system (slice B) starts, it creates per-node watchEffect scopes for these orphaned IDs and resolveNode returns undefined for them. Replace the flat for (const node of this._nodes) loop with forEachNode(this, ...) matching the pattern used at ~line 1149 for fireNodeRemovalLifecycle.
There was a problem hiding this comment.
Fixed in 3dcb36d — the else-branch now uses forEachNode, matching the removal-lifecycle pattern. Added a depth test in LGraph.badges.test.ts ("unregisters nodes at every nesting depth when a subgraph is cleared"), verified red on the old loop.
| import { useLinkStore } from '@/stores/linkStore' | ||
| import { useRerouteStore } from '@/stores/rerouteStore' | ||
| import { useNodeBadgeStore } from '@/stores/nodeBadgeStore' | ||
| import { usePreviewExposureStore } from '@/stores/previewExposureStore' |
There was a problem hiding this comment.
issue: node:slot-links:changed (emitted in the base PR) fires after this.inputs[slot].link = null but before the output-side removal completes. Handlers querying full link topology see a half-disconnected state -- the input reports disconnected but the output still claims the link exists. Moving the trigger after link_info.disconnect(graph, ...) completes, or documenting the partial-teardown ordering in LGraphEventMap.ts, would prevent future consumer bugs from the base PR (#13455).
There was a problem hiding this comment.
node:slot-links:changed no longer exists — #13455's final form deleted both slot events (zero occurrences in src/ at HEAD). Moot.
| queries — presence is all any of them needed — which deletes the | ||
| `node:slot-links:changed` → `refreshNodeInputs` reprojection in | ||
| `useGraphNodeManager`, the dead `node:slot-errors:changed` handler | ||
| (zero emitters repo-wide), and the node-removal refresh-all loop. |
There was a problem hiding this comment.
nitpick: (non-blocking) Decision 3 states the PR "deletes" node:slot-links:changed / node:slot-errors:changed and that the latter has "zero emitters repo-wide." The base PR (#13455) actually adds both events to LGraphEventMap.ts and graphTriggers.ts with emitter sites in LGraphNode.ts, SubgraphInput.ts, and SubgraphInputNode.ts. The refreshNodeInputs handler removal is accurate, but the "zero emitters" claim is now incorrect. A brief update noting that node:slot-links:changed is now live at widgeted-input chokepoints would align the doc with the shipped code.
There was a problem hiding this comment.
The doc is accurate at HEAD: #13455's merged form deletes both slot events (emitters, event map, types). The intermediate revision that added them didn't ship.
| exported `trackNodePrice`) move to `linkStore.isInputSlotConnected` | ||
| queries — presence is all any of them needed — which deletes the | ||
| `node:slot-links:changed` → `refreshNodeInputs` reprojection in | ||
| `useGraphNodeManager`, the dead `node:slot-errors:changed` handler |
There was a problem hiding this comment.
question: All four emit sites for node:slot-links:changed are gated on if (input.widget) -- non-widget inputs that connect/disconnect never fire this event. Would renaming to node:widget-slot-links:changed be more accurate? Or should the widget-only scope be documented in the JSDoc on LGraphEventMap.ts?
There was a problem hiding this comment.
Moot — the event was deleted before merge; there's nothing to rename. If a slot-links event returns in the node-data-store slice, widget-only scoping will be decided then.
| `node:slot-links:changed` → `refreshNodeInputs` reprojection in | ||
| `useGraphNodeManager`, the dead `node:slot-errors:changed` handler | ||
| (zero emitters repo-wide), and the node-removal refresh-all loop. | ||
| Shipped ahead of the store itself (2026-07-05). |
There was a problem hiding this comment.
question: node:slot-errors:changed is registered in graphTriggers.ts and LGraphEventMap.ts (base PR #13455) but has no emitter in any non-test code -- the architecture doc previously said to "resurrect from git if a consumer ever materialises." Would it be cleaner to remove the type now and restore it in the slice that adds an emitter? Or add a // TODO(slice-B) comment so reviewers know it is intentionally dormant?
There was a problem hiding this comment.
Already gone — node:slot-errors:changed was removed along with its registration before #13455 merged.
| target architecture, see [ECS Target Architecture](ecs-target-architecture.md). | ||
| For verified accuracy of these documents, see | ||
| [Appendix: Critical Analysis](appendix-critical-analysis.md). | ||
|
|
There was a problem hiding this comment.
nitpick: (non-blocking) The shipped-store inventory tables in proto-ecs-stores.md and ecs-migration-plan.md do not list nodeBadgeStore. Adding a row (following the linkStore/rerouteStore pattern) would keep the cross-reference docs accurate.
There was a problem hiding this comment.
Added to both tables (shipped stores + key format) in 0be6c32, proto-ecs-stores.md too.
| plain-data components, separation of data from behavior, command-driven | ||
| mutation, and no god-object growth — realized across those stores. Where the | ||
| text below says "the World," read "the set of dedicated stores"; where it shows | ||
| `world.getComponent(id, Component)`, read the matching store getter (for |
There was a problem hiding this comment.
nitpick: (non-blocking) The ADR amendment history records PR 12617 (widgetValueStore) and 2026-07-05 (linkStore/rerouteStore). Adding an entry for nodeBadgeStore (PR #13458) would complete the amendment log.
ff8a725 to
123c08b
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 `@src/lib/litegraph/src/LGraph.badges.test.ts`:
- Around line 31-40: Update the test around the root graph clear behavior to
configure the graph before calling clear, ensuring graph.id differs from
zeroUuid and the root-configured path invokes useNodeBadgeStore().clearGraph().
Keep the existing assertion against registeredNodeIds(graphId) to verify the
bucket is cleared.
In `@src/lib/litegraph/src/LGraph.ts`:
- Around line 480-488: Update the clear() else-branch to traverse every nested
node using the existing deep traversal approach from forEachNode, rather than
iterating only this._nodes. Unregister each visited node’s badge through
useNodeBadgeStore().unregisterNode(this.rootGraph.id, node.id), while leaving
link and reroute cleanup unchanged.
In `@src/systems/badgeSystem.ts`:
- Around line 190-197: Update the badge-writing loop in the relevant badge
system flow to derive its kinds from BADGE_KIND_ORDER, excluding 'extension',
instead of hardcoding ['core', 'credits']. Keep the existing setBadgesOfKind
call and row filtering behavior unchanged so all system-written kinds remain
synchronized with the defined order.
- Around line 89-92: Add JSDoc to BadgeSystemOptions.resolveNode documenting
that the resolver must traverse subgraphs, including nodes registered under
rootGraph.id, rather than searching only top-level nodes. Keep the interface and
resolver behavior unchanged.
🪄 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: 614fda36-7cd0-4998-9a8e-2a2c326e75d7
📒 Files selected for processing (16)
docs/architecture/node-badge-store.mdsrc/components/graph/widgets/domWidgetZIndex.test.tssrc/lib/litegraph/src/LGraph.badges.test.tssrc/lib/litegraph/src/LGraph.serialise.test.tssrc/lib/litegraph/src/LGraph.tssrc/lib/litegraph/src/LGraphCanvas.clipboard.test.tssrc/lib/litegraph/src/LGraphCanvas.cloneZIndex.test.tssrc/lib/litegraph/src/LGraphCanvas.ghost.test.tssrc/lib/litegraph/src/LGraphCanvas.groupSelection.test.tssrc/lib/litegraph/src/LGraphCanvas.slotHitDetection.test.tssrc/stores/nodeBadgeStore.test.tssrc/stores/nodeBadgeStore.tssrc/systems/badgeSystem.test.tssrc/systems/badgeSystem.tssrc/types/badgeData.tssrc/utils/litegraphUtil.test.ts
Root-graph-scoped buckets keyed by NodeId holding plain BadgeData rows, per docs/architecture/node-badge-store.md decisions 1-2. Reads are kind-ordered (core, credits, extension); the badge system rewrites its kinds wholesale via setBadgesOfKind, extension rows use identity-checked register/delete. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
startBadgeSystem watches the registered-node set of a root graph bucket and runs one effect scope per node: a pure computeBadges projection of nodeDef, badge-mode settings, palette, and pricing sources, written to nodeBadgeStore as core/credits rows (node-badge-store.md decisions 3-4). nodeBadgeStore gains the registerNode/unregisterNode/registeredNodeIds registration surface the system consumes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
add/remove/clear (and subgraph-definition GC) now maintain each node's nodeBadgeStore registration in the root bucket, following the linkStore/rerouteStore chokepoint convention. Tests that construct graphs without an active Pinia gain the standard testing-pinia setup. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A per-node effect flushing between unregisterNode and its scope being stopped could re-create the bucket key and resurrect a removed node's registration. Row writes (registerBadge, setBadgesOfKind) now require an existing registration; registerBadge returns undefined when refused. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
clear() unregistered only direct nodes; badge rows for nodes 2+ subgraph levels deep leaked in the shared root bucket.
Also document the two badge write paths: setBadgesOfKind is the system-internal bulk path; extensions use registerBadge/deleteBadge. Route deleteBadge/getBadges reads through the registeredRows guard.
786a688 to
c4ab44a
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/node-badge-store.md`:
- Around line 40-48: Update the BadgeData fenced code block in the architecture
documentation to include an explicit language identifier, using text for the
schematic (or typescript only if the block is made valid TypeScript), so
markdownlint no longer reports MD040.
In `@src/lib/litegraph/src/LGraph.ts`:
- Line 1094: Update the ID remapping logic in ensureGlobalIdUniqueness() to
unregister the node’s previous ID and register its reassigned ID in the root
graph bucket via useNodeBadgeStore(). Preserve the existing initial registration
in the node-loading path while keeping badge-store keys synchronized after every
remap.
🪄 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: fa726343-733f-4a15-87ed-d9dacb9103f2
📒 Files selected for processing (20)
docs/adr/0008-entity-component-system.mddocs/architecture/ecs-migration-plan.mddocs/architecture/node-badge-store.mddocs/architecture/proto-ecs-stores.mdsrc/components/graph/widgets/domWidgetZIndex.test.tssrc/lib/litegraph/src/LGraph.badges.test.tssrc/lib/litegraph/src/LGraph.serialise.test.tssrc/lib/litegraph/src/LGraph.tssrc/lib/litegraph/src/LGraphCanvas.clipboard.test.tssrc/lib/litegraph/src/LGraphCanvas.cloneZIndex.test.tssrc/lib/litegraph/src/LGraphCanvas.ghost.test.tssrc/lib/litegraph/src/LGraphCanvas.groupSelection.test.tssrc/lib/litegraph/src/LGraphCanvas.slotHitDetection.test.tssrc/renderer/extensions/vueNodes/composables/usePartitionedBadges.test.tssrc/stores/nodeBadgeStore.test.tssrc/stores/nodeBadgeStore.tssrc/systems/badgeSystem.test.tssrc/systems/badgeSystem.tssrc/types/badgeData.tssrc/utils/litegraphUtil.test.ts
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 2
🤖 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/node-badge-store.md`:
- Around line 40-48: Update the BadgeData fenced code block in the architecture
documentation to include an explicit language identifier, using text for the
schematic (or typescript only if the block is made valid TypeScript), so
markdownlint no longer reports MD040.
In `@src/lib/litegraph/src/LGraph.ts`:
- Line 1094: Update the ID remapping logic in ensureGlobalIdUniqueness() to
unregister the node’s previous ID and register its reassigned ID in the root
graph bucket via useNodeBadgeStore(). Preserve the existing initial registration
in the node-loading path while keeping badge-store keys synchronized after every
remap.
🪄 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: fa726343-733f-4a15-87ed-d9dacb9103f2
📒 Files selected for processing (20)
docs/adr/0008-entity-component-system.mddocs/architecture/ecs-migration-plan.mddocs/architecture/node-badge-store.mddocs/architecture/proto-ecs-stores.mdsrc/components/graph/widgets/domWidgetZIndex.test.tssrc/lib/litegraph/src/LGraph.badges.test.tssrc/lib/litegraph/src/LGraph.serialise.test.tssrc/lib/litegraph/src/LGraph.tssrc/lib/litegraph/src/LGraphCanvas.clipboard.test.tssrc/lib/litegraph/src/LGraphCanvas.cloneZIndex.test.tssrc/lib/litegraph/src/LGraphCanvas.ghost.test.tssrc/lib/litegraph/src/LGraphCanvas.groupSelection.test.tssrc/lib/litegraph/src/LGraphCanvas.slotHitDetection.test.tssrc/renderer/extensions/vueNodes/composables/usePartitionedBadges.test.tssrc/stores/nodeBadgeStore.test.tssrc/stores/nodeBadgeStore.tssrc/systems/badgeSystem.test.tssrc/systems/badgeSystem.tssrc/types/badgeData.tssrc/utils/litegraphUtil.test.ts
🛑 Comments failed to post (2)
docs/architecture/node-badge-store.md (1)
40-48: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add a language identifier to the
BadgeDatafence.
markdownlintreports MD040 at Line 40 because this fenced block has no language. Usetextfor the schematic, ortypescriptif it is intended to represent valid TypeScript.🧰 Tools
🪛 markdownlint-cli2 (0.23.0)
[warning] 40-40: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 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 `@docs/architecture/node-badge-store.md` around lines 40 - 48, Update the BadgeData fenced code block in the architecture documentation to include an explicit language identifier, using text for the schematic (or typescript only if the block is made valid TypeScript), so markdownlint no longer reports MD040.Source: Linters/SAST tools
src/lib/litegraph/src/LGraph.ts (1)
1094-1094: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Keep badge-store keys synchronized when node IDs are remapped.
Line 1094 registers the initial
node.id, but
ensureGlobalIdUniqueness()later reassigns IDs without moving this entry.
That leaves an orphaned old key while the new ID is unregistered and rejects
badge writes. Update the remapping path to unregister the old ID and register
the new ID under the root graph bucket.🤖 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/LGraph.ts` at line 1094, Update the ID remapping logic in ensureGlobalIdUniqueness() to unregister the node’s previous ID and register its reassigned ID in the root graph bucket via useNodeBadgeStore(). Preserve the existing initial registration in the node-loading path while keeping badge-store keys synchronized after every remap.
Summary
Extracts node badges into a dedicated store per ADR 0008 — slice A of
docs/architecture/node-badge-store.md: store, plainBadgeDatarows, reactive badge system, and LGraph chokepoint registration. Stacked on #13455.Changes
src/types/badgeData.ts— plainBadgeData { kind, text, fgColor?, bgColor?, iconKey? }rows (decision 1).src/stores/nodeBadgeStore.ts— root-scoped buckets keyed byNodeId, kind-ordered reads, identity-checked row deletes,registerNode/unregisterNode/clearGraphregistration trio; row writes refused for unregistered nodes (decision 2).src/systems/badgeSystem.ts— purecomputeBadges(sources)+ effect-scope-per-node shell watchingregisteredNodeIds; writes core and credits rows from nodeDef/settings/palette/pricing/widget-value/link-connectivity sources (decisions 3–4).LGraph.add/remove/clear+ subgraph-definition GC maintain the store registration (linkStore/rerouteStore convention).node.badges/useNodeBadgeclosures untouched; nothing starts the system in production until slice B's consumer cutover.Review Focus
registeredNodeIds, so litegraph never imports pricing/nodeDef modules (no import cycle via the litegraph barrel).node.badgessurface, andbadgePositionare open decisions in the design record and deliberately not in this PR.registerBadge/deleteBadge) land now because the slice-B shim consumes them.🤖 Generated with Claude Code