Repository navigation
refactor: read widgeted-input connectivity from linkStore - #13455
Conversation
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1696 passed, 0 failed📊 Browser Reports
📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-07-14T20:31:27.645Z",
"gitSha": "82d6d9e8ba73ace6d52b6b03777e5bad858f0400",
"branch": "drjkl/the-body-in-the-library",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2038.6560000000031,
"styleRecalcs": 7,
"styleRecalcDurationMs": 4.935999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 416.292,
"heapDeltaBytes": -3925444,
"heapUsedBytes": 49082100,
"domNodes": -291,
"jsHeapTotalBytes": 16904192,
"scriptDurationMs": 20.580000000000002,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2041.7469999999867,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.081000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 361.19199999999995,
"heapDeltaBytes": 13119572,
"heapUsedBytes": 65887452,
"domNodes": -269,
"jsHeapTotalBytes": 15331328,
"scriptDurationMs": 20.648000000000003,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1802.0670000000223,
"styleRecalcs": 71,
"styleRecalcDurationMs": 34.64,
"layouts": 12,
"layoutDurationMs": 3.0059999999999993,
"taskDurationMs": 752.8249999999999,
"heapDeltaBytes": -12387412,
"heapUsedBytes": 57467408,
"domNodes": -244,
"jsHeapTotalBytes": 19288064,
"scriptDurationMs": 117.039,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1809.6030000000383,
"styleRecalcs": 72,
"styleRecalcDurationMs": 34.034,
"layouts": 12,
"layoutDurationMs": 3.0109999999999997,
"taskDurationMs": 752.652,
"heapDeltaBytes": -12394320,
"heapUsedBytes": 57328944,
"domNodes": -245,
"jsHeapTotalBytes": 19550208,
"scriptDurationMs": 116.366,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1730.7859999999664,
"styleRecalcs": 30,
"styleRecalcDurationMs": 15.328999999999999,
"layouts": 6,
"layoutDurationMs": 0.655,
"taskDurationMs": 309.45500000000004,
"heapDeltaBytes": 17252968,
"heapUsedBytes": 69880160,
"domNodes": -211,
"jsHeapTotalBytes": 13234176,
"scriptDurationMs": 22.207000000000004,
"eventListeners": -184,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1743.5509999999113,
"styleRecalcs": 31,
"styleRecalcDurationMs": 14.307000000000002,
"layouts": 6,
"layoutDurationMs": 0.625,
"taskDurationMs": 306.32,
"heapDeltaBytes": 17544068,
"heapUsedBytes": 69950576,
"domNodes": -211,
"jsHeapTotalBytes": 13496320,
"scriptDurationMs": 22.433,
"eventListeners": -184,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 591.4940000000115,
"styleRecalcs": 12,
"styleRecalcDurationMs": 8.471999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 365.677,
"heapDeltaBytes": -22650964,
"heapUsedBytes": 47275212,
"domNodes": -275,
"jsHeapTotalBytes": 6180864,
"scriptDurationMs": 53.63799999999999,
"eventListeners": -203,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 545.6749999999602,
"styleRecalcs": 12,
"styleRecalcDurationMs": 7.777999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 323.26500000000004,
"heapDeltaBytes": -12207740,
"heapUsedBytes": 53423436,
"domNodes": 20,
"jsHeapTotalBytes": 20733952,
"scriptDurationMs": 54.266,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2038.1830000000036,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.007,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 632.334,
"heapDeltaBytes": -7193116,
"heapUsedBytes": 56350932,
"domNodes": -268,
"jsHeapTotalBytes": -1089536,
"scriptDurationMs": 223.329,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2071.986000000038,
"styleRecalcs": 10,
"styleRecalcDurationMs": 15.251000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 651.3959999999998,
"heapDeltaBytes": -13011328,
"heapUsedBytes": 57466652,
"domNodes": -267,
"jsHeapTotalBytes": -2105344,
"scriptDurationMs": 236.35699999999997,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2123.2290000000376,
"styleRecalcs": 69,
"styleRecalcDurationMs": 14.937,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1205.404,
"heapDeltaBytes": 10859352,
"heapUsedBytes": 82842664,
"domNodes": -275,
"jsHeapTotalBytes": -327680,
"scriptDurationMs": 583.621,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2130.7919999999285,
"styleRecalcs": 69,
"styleRecalcDurationMs": 16.441,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1168.68,
"heapDeltaBytes": 16967904,
"heapUsedBytes": 82010952,
"domNodes": -275,
"jsHeapTotalBytes": 425984,
"scriptDurationMs": 558.537,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-zoom",
"durationMs": 3093.3950000000436,
"styleRecalcs": 64,
"styleRecalcDurationMs": 14.757999999999997,
"layouts": 60,
"layoutDurationMs": 6.390000000000001,
"taskDurationMs": 1371.412,
"heapDeltaBytes": 22905252,
"heapUsedBytes": 77235272,
"domNodes": -279,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 663.632,
"eventListeners": -195,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-zoom",
"durationMs": 3088.581999999974,
"styleRecalcs": 63,
"styleRecalcDurationMs": 14.038000000000002,
"layouts": 60,
"layoutDurationMs": 6.362,
"taskDurationMs": 1375.026,
"heapDeltaBytes": 21586648,
"heapUsedBytes": 76856052,
"domNodes": 8,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 679.876,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2026.5529999999785,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.3130000000000015,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 614.9440000000001,
"heapDeltaBytes": -8361952,
"heapUsedBytes": 57411264,
"domNodes": -271,
"jsHeapTotalBytes": -1843200,
"scriptDurationMs": 224.48200000000003,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 1998.960000000011,
"styleRecalcs": 7,
"styleRecalcDurationMs": 4.810000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 564.2420000000001,
"heapDeltaBytes": 5091976,
"heapUsedBytes": 58458084,
"domNodes": -273,
"jsHeapTotalBytes": 4194304,
"scriptDurationMs": 214.48099999999997,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 582.4109999999791,
"styleRecalcs": 45,
"styleRecalcDurationMs": 10.511999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 379.46999999999997,
"heapDeltaBytes": -4640080,
"heapUsedBytes": 47706484,
"domNodes": -276,
"jsHeapTotalBytes": 1175552,
"scriptDurationMs": 113.766,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 579.8950000000787,
"styleRecalcs": 48,
"styleRecalcDurationMs": 11.299,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 369.747,
"heapDeltaBytes": -22316476,
"heapUsedBytes": 47501836,
"domNodes": -273,
"jsHeapTotalBytes": 6180864,
"scriptDurationMs": 111.973,
"eventListeners": -193,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66666666666665,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-idle",
"durationMs": 2052.336999999966,
"styleRecalcs": 12,
"styleRecalcDurationMs": 12.615000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 399.325,
"heapDeltaBytes": -7319608,
"heapUsedBytes": 62437388,
"domNodes": -269,
"jsHeapTotalBytes": 19812352,
"scriptDurationMs": 16.351000000000003,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2027.592000000027,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.524999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 370.135,
"heapDeltaBytes": -7286948,
"heapUsedBytes": 62630228,
"domNodes": -272,
"jsHeapTotalBytes": 19025920,
"scriptDurationMs": 15.759000000000002,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1724.9820000000113,
"styleRecalcs": 77,
"styleRecalcDurationMs": 33.756,
"layouts": 16,
"layoutDurationMs": 4.119000000000001,
"taskDurationMs": 602.084,
"heapDeltaBytes": -4854580,
"heapUsedBytes": 58775200,
"domNodes": 62,
"jsHeapTotalBytes": 15466496,
"scriptDurationMs": 86.257,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1707.8470000000152,
"styleRecalcs": 75,
"styleRecalcDurationMs": 32.722,
"layouts": 16,
"layoutDurationMs": 3.9120000000000004,
"taskDurationMs": 639.6800000000001,
"heapDeltaBytes": 18659184,
"heapUsedBytes": 70968396,
"domNodes": -252,
"jsHeapTotalBytes": 15855616,
"scriptDurationMs": 82.91100000000002,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 949.3290000000343,
"styleRecalcs": 18,
"styleRecalcDurationMs": 30.335999999999995,
"layouts": 14,
"layoutDurationMs": 14.586000000000002,
"taskDurationMs": 721.175,
"heapDeltaBytes": 29858400,
"heapUsedBytes": 96888172,
"domNodes": 13673,
"jsHeapTotalBytes": 14417920,
"scriptDurationMs": 24.717000000000002,
"eventListeners": 2533,
"totalBlockingTimeMs": 138,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8157.893000000002,
"styleRecalcs": 250,
"styleRecalcDurationMs": 46.238,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3873.3399999999997,
"heapDeltaBytes": 24884980,
"heapUsedBytes": 88439364,
"domNodes": -274,
"jsHeapTotalBytes": 1736704,
"scriptDurationMs": 1722.2499999999998,
"eventListeners": -183,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.669999999999952,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8163.317000000006,
"styleRecalcs": 250,
"styleRecalcDurationMs": 48.108,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3959.088,
"heapDeltaBytes": 4998716,
"heapUsedBytes": 65259520,
"domNodes": -265,
"jsHeapTotalBytes": 5959680,
"scriptDurationMs": 1765.353,
"eventListeners": -110,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 11148.814000000017,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11136.982,
"heapDeltaBytes": -39433716,
"heapUsedBytes": 169160124,
"domNodes": -3302,
"jsHeapTotalBytes": 20680704,
"scriptDurationMs": 823.697,
"eventListeners": -16373,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 10640.557000000059,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10628.255000000001,
"heapDeltaBytes": -28253372,
"heapUsedBytes": 167140880,
"domNodes": -3300,
"jsHeapTotalBytes": 12292096,
"scriptDurationMs": 802.494,
"eventListeners": -16380,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333326,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 14199.482999999986,
"styleRecalcs": 65,
"styleRecalcDurationMs": 15.179000000000025,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14175.518,
"heapDeltaBytes": -46706876,
"heapUsedBytes": 173068248,
"domNodes": -8314,
"jsHeapTotalBytes": 19918848,
"scriptDurationMs": 1125.055,
"eventListeners": -16370,
"totalBlockingTimeMs": 3,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 14677.569000000061,
"styleRecalcs": 66,
"styleRecalcDurationMs": 15.021000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14658.376,
"heapDeltaBytes": -48620504,
"heapUsedBytes": 155066324,
"domNodes": -3300,
"jsHeapTotalBytes": 8126464,
"scriptDurationMs": 1161.128,
"eventListeners": -16366,
"totalBlockingTimeMs": 8,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "workflow-execution",
"durationMs": 502.89199999997436,
"styleRecalcs": 18,
"styleRecalcDurationMs": 23.708,
"layouts": 4,
"layoutDurationMs": 1.0190000000000001,
"taskDurationMs": 206.90200000000004,
"heapDeltaBytes": -21713920,
"heapUsedBytes": 49284232,
"domNodes": -161,
"jsHeapTotalBytes": 4870144,
"scriptDurationMs": 16.599,
"eventListeners": -134,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 450.7969999999659,
"styleRecalcs": 18,
"styleRecalcDurationMs": 21.66,
"layouts": 4,
"layoutDurationMs": 1.1380000000000001,
"taskDurationMs": 104.706,
"heapDeltaBytes": 4990948,
"heapUsedBytes": 64722628,
"domNodes": 157,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 16.78,
"eventListeners": 69,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## feature/ecs-migration #13455 +/- ##
========================================================
Coverage ? 78.70%
========================================================
Files ? 1651
Lines ? 111016
Branches ? 40586
========================================================
Hits ? 87377
Misses ? 22786
Partials ? 853
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
c1f9c5d to
20fef21
Compare
1466cd2 to
fe199d2
Compare
20fef21 to
d072488
Compare
fe199d2 to
a6b9d4e
Compare
d072488 to
67948e9
Compare
NodeSlots.linkedWidgetedInputs, usePartitionedBadges, and trackNodePrice queried the input.link slot mirror, which only stayed reactive through the node:slot-links:changed -> refreshNodeInputs reprojection. All three now query linkStore.isInputSlotConnected by root graph id and slot index, so the slot-links handler and the emitter-less node:slot-errors:changed handler are deleted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The refresh-all loop existed to poke inputs[].link readers after a neighbor's links were torn down. Those readers now query linkStore, which unregisters link state reactively during removal, so the loop and refreshNodeInputs go. Verified against the vue-nodes legacy widget e2e spec that motivated the loop. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Decisions 1 (single NodeState object, proxy-returning registration) is agreed; field set, slot scope, and consumer contract are drafted pending review. Records the shipped inputs[].link reader migration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review follow-ups: drop comments that paraphrased the call, type the graphId params as UUID, unify the undefined guard, hoist the mocked graph id, and thread the shared pinia through renderUnified. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Badges go straight to plain BadgeData rows in a dedicated store, written by a reactive badge system; core badges materialize as rows too, killing the dual derivation and positional slice(1). Adds badge vocabulary to the domain glossary and repoints the node-data-store badges row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
a6b9d4e to
4fab502
Compare
- canvasStore.rootGraphId computed replaces per-site canvas?.graph?.rootGraph.id chains (non-reactive .graph reads) - delete node:slot-links:changed and node:slot-errors:changed outright: emitters, event map, types (zero listeners; badge system reads linkStore) - dedupe usePartitionedBadges inline pricing block into trackNodePrice; narrow nodeDataUtils params to Pick - test hygiene: seed real canvasStore instead of module mocks, drop redundant NodeSlots/nodeDataUtils tests, cover SubgraphInput connect via linkedWidgetedInputs
7754105 to
abe1cf7
Compare
configure() reassigns the graph id in place on every workflow load, but canvasStore.rootGraphId memoized the untracked field read, so every consumer keyed widget/link store queries by the previous workflow's id and Vue node widgets vanished after loading a workflow.
abe1cf7 to
c757a23
Compare
christian-byrne
left a comment
There was a problem hiding this comment.
issue: the PR description claims to "migrate the last inputs[].link mirror readers to linkStore queries," but buildJsonataContext in useNodePricing.ts still reads slot?.link != null (line 255) and inp.link != null (line 265) to build the evaluation context sent to the pricing engine. trackNodePrice in usePartitionedBadges now triggers on linkStore changes, but the actual price computation still reads the mirror field. The two sources can diverge during subgraph load ordering: reactive tracking fires, a new price is computed, but buildJsonataContext reads stale inp.link data.
| import { isSlotObject } from '@/utils/typeGuardUtil' | ||
| import type { UUID } from '@/utils/uuid' | ||
|
|
||
| function coerceINodeSlot(input: INodeInputSlot): INodeSlot { |
There was a problem hiding this comment.
question: when a computed first evaluates isInputSlotConnected(graphId, nodeId, slot) before any link for that graphId has been registered (bucket absent), targetIndex.value.get(graphId) returns undefined and short-circuits before reaching the reactive inner Map. Because targetIndex is ref<Map<...>> (not reactive(Map)), calling .get() on the unwrapped outer Map does not register a key-access Vue dependency. If the bucket is created later (first link for that graphId), does the calling computed re-run? The existing tests all seed useLinkStore() before the computed is first read, sidestepping this ordering. A test where the computed reads isInputSlotConnected before any link for that graph exists -- then a link is added -- would either confirm or expose this gap.
There was a problem hiding this comment.
ref(new Map()) deep-wraps its value via reactive(), so targetIndex.value is a reactive Map proxy, not a raw Map. Vue's collection instrumentation tracks get/has per key even when the key is absent, and .set of a new key fires an ADD trigger for that key. A computed that reads isInputSlotConnected before any link for that graph exists registers a dep on the missing bucket key and re-runs when the first link creates it.
Confirmed with the test you described: computed reads absent bucket, returns false; registerLink re-evaluates to true; same for an absent key in an existing bucket; deleteLink invalidates back. Added to linkStore.test.ts (eab43ec). Mutation-checked: downgrading targetIndex to shallowRef fails it.
| ]) | ||
|
|
||
| id: UUID = zeroUuid | ||
| /** |
There was a problem hiding this comment.
suggestion: (non-blocking) LGraph now imports shallowRef/toRaw from Vue to back id with a reactive ref, coupling a core domain/engine class to Vue's reactivity at instantiation time. Two alternatives that would avoid the import: (a) dispatch a domain event on id change that canvasStore observes and writes into a Vue ref it owns, or (b) make configure() replace the graph instance so currentGraph (the existing shallowRef<LGraph>) triggers naturally without any Vue import in litegraph. If the current approach is intentional interim debt, trim the 5-line JSDoc explaining how toRaw works down to one line explaining why the shallowRef exists (so workflow-load id reassignment propagates to store buckets).
There was a problem hiding this comment.
LGraphNode/LGraphCanvas already import from vue, and LGraph.clear() already calls useLinkStore/useWidgetValueStore. On (b): configure() mutates the instance in place, so swapping instances touches every graph-reference holder. (a) adds an event plus observer for what one shallowRef does.
Took the JSDoc trim (352b1da): one line on why the ref exists.
| newValue: unknown | ||
| } | ||
| 'node:slot-errors:changed': { nodeId: SerializedNodeId } | ||
| 'node:slot-links:changed': { |
There was a problem hiding this comment.
suggestion: (non-blocking) node:slot-links:changed was only 47 days old (PR #12197, 2026-05-27) and is now hard-removed from LGraphTriggerActions. The "zero emitters repo-wide" scan covered internal code -- external custom nodes that used this event for cross-component coordination now silently no-op when they call graph.trigger('node:slot-links:changed', ...) (trigger validates against the actions array). Consider either a one-cycle deprecation shim with a console warning, or a changelog/migration note for extension authors.
There was a problem hiding this comment.
trigger() already silently drops unknown actions (if (!isLGraphTriggerAction(action)) return), so external callers of the removed event get the same no-op as any unknown string. No new failure mode. The event lived 47 days as internal badge plumbing, never documented as extension API. A shim would resurrect the plumbing this PR deletes.
| export function linkedWidgetedInputs( | ||
| nodeData: VueNodeData | undefined | ||
| nodeData: Pick<VueNodeData, 'id' | 'inputs'> | undefined, | ||
| graphId: UUID | undefined |
There was a problem hiding this comment.
suggestion: (non-blocking) linkedWidgetedInputs(nodeData, graphId) now has a required second parameter. Any caller passing only nodeData (including extension code via dynamic import) gets a TypeScript error or silently returns empty array. Making graphId?: UUID optional (falling back to the existing early-return empty path) would preserve call-site compatibility at no cost.
There was a problem hiding this comment.
Keeping it required. Every caller passes it (NodeSlots.vue passes rootGraphId; tests pass it explicitly), and nodeDataUtils isn't reachable from the extension API surface. Optional would trade a compile error for a silent [] when a future caller forgets to thread graphId, the failure mode this refactor removes.
| @@ -36,7 +61,8 @@ export function trackNodePrice(node: TrackableNode) { | |||
| getInputNames, | |||
| getNodeRevisionRef | |||
There was a problem hiding this comment.
suggestion: (non-blocking) trackNodePrice is exported and currently consumed by two call sites: usePartitionedBadges and PartnerNodesList.vue. The node-badge design doc (Decision 3) says this function "moves inside the BadgeSystem." Exporting it now means the eventual centralization must coordinate two external consumers rather than one -- it widens the coupling it says will be removed. Consider keeping it internal to usePartitionedBadges until the BadgeSystem lands; PartnerNodesList can get pricing data from the badge store at that point.
There was a problem hiding this comment.
Both the export and the PartnerNodesList consumer pre-date this PR (both unchanged from main). Un-exporting now would leave PartnerNodesList without a pricing source until the badge store exists. Centralization is the stack: #13458 introduces nodeBadgeStore, #13460 cuts renderers over to store rows; PartnerNodesList migrates then.
| const widgetStore = useWidgetValueStore() | ||
| const graphId = app.canvas?.graph?.rootGraph.id | ||
| const graphId = useCanvasStore().rootGraphId | ||
| if (relevantNames.length > 0 && node.id != null) { |
There was a problem hiding this comment.
question: trackNodePrice calls useCanvasStore().rootGraphId to obtain graphId. If rootGraphId is undefined when unpartitionedBadges first evaluates (canvas not yet set), touchPricingInputConnectivity returns early without touching reactive state -- no isInputSlotConnected dependency is registered for those nodes. The computed re-runs when rootGraphId becomes non-null. Is there a scenario (subgraph load ordering, deferred canvas assignment) where the reactive chain is established too late and pricing badges show stale connectivity for a frame or more?
There was a problem hiding this comment.
Transiently stale, self-healing, no lost frames beyond the re-run. For dynamic-pricing nodes, trackNodePrice reads useCanvasStore().rootGraphId before the undefined guards (usePartitionedBadges.ts:74), so even when it's undefined the badge computed registers a dep on it. When the canvas is set, or a workflow load reassigns the id (reactive as of this PR), the computed re-runs and touchPricingInputConnectivity registers the isInputSlotConnected deps. Verified with a test: rootGraphId undefined, evaluate, set graph, re-run, register relevant link, re-run again.
On subgraph ordering: registration and query use the same key. registerLinkTopology keys by graph.rootGraph.id (LLink.ts:623), including for subgraphs, and Subgraph.rootGraph resolves through nesting. Root configure() assigns the id before links are added, so links never land under a different key than the one queried.
| import { toLinkId } from '@/types/linkId' | ||
| import { toNodeId } from '@/types/nodeId' | ||
|
|
||
| const GRAPH_ID = 'graph-test' |
There was a problem hiding this comment.
suggestion: (non-blocking) the trackNodePrice re-run test connects slot 0 (image) which the mock declares relevant. A bug that inverted the relevance filter (!inputNames.includes) would still pass: the "irrelevant input does not re-run" assertion tests other separately, but there is no assertion within the connect/disconnect test that connecting a non-relevant slot first does not increment runs. Adding that check makes the filter's correctness load-bearing in this test rather than incidental.
There was a problem hiding this comment.
The inversion (!inputNames.includes) fails both existing tests. "does not re-run when an irrelevant input connects": inverted filter makes other relevant, runs goes to 2, expect(1) fails. "re-runs when a pricing-relevant input connects": the connect assertion passes incidentally (the first read tracks the absent bucket key, so bucket creation re-runs it), but the disconnect assertion fails (expect(3), stays 2). The mutant is caught today; an intra-test assertion would duplicate the second test. Can add it if you want each test standing alone.
|
|
||
| const currentGraph = shallowRef<LGraph | null>(null) | ||
| const rootGraphId = computed(() => currentGraph.value?.rootGraph.id) | ||
| const isInSubgraph = ref(false) |
There was a problem hiding this comment.
question: rootGraphId = computed(() => currentGraph.value?.rootGraph.id). Since currentGraph is shallowRef<LGraph>, Vue only tracks the top-level .value -- not deep property reads off that object. The computed only gets a dependency on LGraph._id because the class getter calls toRaw(this)._id.value, and a shallowRef.value read inside a computed registers a dep even on the raw object. This chain works today, but it is a non-local invariant: if toRaw is ever removed from the getter, or rootGraph is not the same object as the LGraph instance, the computed silently stops updating. A test that verifies rootGraphId updates when rootGraph.id is reassigned without currentGraph being swapped would make this invariant regression-proof.
There was a problem hiding this comment.
That test exists: canvasStore.test.ts:127-143. It sets the canvas once, never swaps currentGraph, and calls graph.configure({...serialize(), id: workflowId}), which reassigns id in place on the same instance. Mutation-tested: replacing the _id shallowRef with a plain field fails the test with a stale cached value, so it exercises computed invalidation, not a fresh getter read.
On toRaw: currentGraph is a shallowRef, so graphs are raw instances where toRaw is identity (no reactive()-wrapped graph exists in src/). If a graph were ever read through a reactive proxy, a missing toRaw surfaces as id === undefined (ref auto-unwrap), loud rather than stale. It's defensive, per the comment above the getter.
| toRaw(this)._id.value = value | ||
| } | ||
|
|
||
| revision: number = 0 |
There was a problem hiding this comment.
question: the node-removal refresh-all loop was the fix for #5834 (widgets not disabling when linked). Tracing the actual disable path: buildSlotMetadata -> linkStore.getInputSlotLink is independently reactive, so the loop deletion is correct if _removeLink is always called during node removal. The deleted node:slot-links:changed triggers were at sites where input.link = null is written. Are there any disconnect paths that write input.link = null without going through link_info.disconnect(graph, ...) -> _removeLink? If so, the linkStore would retain a stale entry and the widget-disable computed would show the widget as still-disabled after the upstream node is removed.
There was a problem hiding this comment.
Audited every .link = write in src/, not just litegraph. Three categories, all safe:
- Paired with
LLink.disconnect():disconnectInput,disconnectOutput(both branches, including missing-target),SubgraphInputNode._disconnectNodeInput.disconnect()→unregisterLinkTopology→linkStore.deleteLink. (_removeLinkduplicates the same cleanup forlinkDeduplication/linkFixer.) - Endpoint moves without disconnect (
useNodeReplacement,dynamicWidgets, subgraph boundary re-pointing): these mutatelink.target_id/target_slot, which are accessors routing throughupdateEndpoint, so the store re-keys old to new atomically. - Serialized/cloned plain data (
unpackSubgraphclone data,node.clone(),migrateReroute,linkFixeronISerialisedGraph): never registered, can't strand entries.
LGraph.remove disconnects every connected input and output, removes floating links, and on last-instance subgraph-node removal calls unregisterAllLinkTopologies. Undo/redo goes through configure() without keep_old, which runs clear() and wipes the root graph's bucket via linkStore.clearGraph. Verified by test: removing an upstream node (including fan-out to two consumers) leaves getInputSlotLink undefined and the widget-disable computed re-enables. The #5834 path holds without the refresh-all loop.
| @@ -0,0 +1,145 @@ | |||
| # Node Data Store | |||
There was a problem hiding this comment.
nitpick: (non-blocking) both node-data-store.md and node-badge-store.md mix shipped decisions (Decision 3, marked "Shipped ahead of the store itself 2026-07-05") with unimplemented future work in the same document without a clear boundary. Future contributors reading these as an architecture reference may treat aspirational decisions as live constraints. A "Current State / Shipped" section before "Planned" sections, or a prominent "Draft -- partially implemented" callout at the top, would help. Also: the "Supporting Documents" table in ADR 0008 lists link-topology-store.md and reroute-chain-store.md but not these two new docs.
There was a problem hiding this comment.
I plan on trimming or deleting a lot of the docs before merging the feature branch in.
There was a problem hiding this comment.
Also noting the ADR 0008 supporting-docs table gap: gets fixed if these docs survive the pre-merge trim.
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts (1)
56-63: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
trackNodePriceexport still widens BadgeSystem-migration coupling.Still exported and consumed by two call sites (
usePartitionedBadgeshere, andPartnerNodesList.vue). The badge design doc's Decision 3 states this function moves inside the BadgeSystem — keeping it exported now means centralization later has to coordinate two external consumers instead of one.🤖 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/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts` around lines 56 - 63, Remove the public export from trackNodePrice and update its consumers in usePartitionedBadges and PartnerNodesList.vue to access the behavior through the BadgeSystem-owned interface instead. Keep the pricing behavior unchanged while ensuring only BadgeSystem remains coupled to the implementation.
🤖 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`:
- Line 37: Label the code fences containing BadgeData in
docs/architecture/node-badge-store.md (line 37) and NodeState in
docs/architecture/node-data-store.md (line 28) with the TypeScript language
identifier, using ts or typescript.
In `@docs/architecture/node-data-store.md`:
- Around line 69-80: The migration description in the architecture documentation
overstates removal of inputs[].link readers and slot-link trigger contracts.
Narrow the claim to the renderer paths actually migrated, and explicitly
document that useNodePricing.buildJsonataContext still reads input.link while
its emitters and trigger types remain retained.
In `@src/renderer/extensions/vueNodes/utils/nodeDataUtils.ts`:
- Around line 30-33: Update the linkedWidgetedInputs function signature so
graphId is an optional UUID parameter, allowing callers to omit it while
preserving the existing early-return behavior for undefined graph IDs.
---
Outside diff comments:
In `@src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts`:
- Around line 56-63: Remove the public export from trackNodePrice and update its
consumers in usePartitionedBadges and PartnerNodesList.vue to access the
behavior through the BadgeSystem-owned interface instead. Keep the pricing
behavior unchanged while ensuring only BadgeSystem remains coupled to the
implementation.
🪄 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: 92fd3370-d3d6-4bf0-a7c5-4e40bb6569cd
📒 Files selected for processing (23)
docs/architecture/domain-glossary.mddocs/architecture/node-badge-store.mddocs/architecture/node-data-store.mdsrc/composables/graph/useGraphNodeManager.test.tssrc/composables/graph/useGraphNodeManager.tssrc/composables/useUpstreamValue.tssrc/lib/litegraph/src/LGraph.tssrc/lib/litegraph/src/LGraphNode.tssrc/lib/litegraph/src/infrastructure/LGraphEventMap.tssrc/lib/litegraph/src/subgraph/SubgraphInput.tssrc/lib/litegraph/src/subgraph/SubgraphInputNode.tssrc/lib/litegraph/src/types/graphTriggers.tssrc/renderer/core/canvas/canvasStore.test.tssrc/renderer/core/canvas/canvasStore.tssrc/renderer/extensions/vueNodes/components/NodeSlots.test.tssrc/renderer/extensions/vueNodes/components/NodeSlots.vuesrc/renderer/extensions/vueNodes/components/NodeWidgets.test.tssrc/renderer/extensions/vueNodes/composables/usePartitionedBadges.test.tssrc/renderer/extensions/vueNodes/composables/usePartitionedBadges.tssrc/renderer/extensions/vueNodes/composables/useProcessedWidgets.test.tssrc/renderer/extensions/vueNodes/composables/useProcessedWidgets.tssrc/renderer/extensions/vueNodes/utils/__tests__/nodeDataUtils.test.tssrc/renderer/extensions/vueNodes/utils/nodeDataUtils.ts
💤 Files with no reviewable changes (5)
- src/lib/litegraph/src/subgraph/SubgraphInputNode.ts
- src/lib/litegraph/src/subgraph/SubgraphInput.ts
- src/lib/litegraph/src/infrastructure/LGraphEventMap.ts
- src/composables/graph/useGraphNodeManager.ts
- src/lib/litegraph/src/types/graphTriggers.ts
|
|
||
| The store holds only plain data (ADR 0008 component rule): | ||
|
|
||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add languages to the architecture-document code fences.
docs/architecture/node-badge-store.md#L37-L37: label theBadgeDatafence astsortypescript.docs/architecture/node-data-store.md#L28-L28: label theNodeStatefence astsortypescript.
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)
[warning] 37-37: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
📍 Affects 2 files
docs/architecture/node-badge-store.md#L37-L37(this comment)docs/architecture/node-data-store.md#L28-L28
🤖 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` at line 37, Label the code fences
containing BadgeData in docs/architecture/node-badge-store.md (line 37) and
NodeState in docs/architecture/node-data-store.md (line 28) with the TypeScript
language identifier, using ts or typescript.
Source: Linters/SAST tools
| What this phase does remove is the last `inputs[].link` dependency: the | ||
| three remaining readers (`nodeDataUtils.linkedWidgetedInputs` used by | ||
| `NodeSlots`, and `usePartitionedBadges`' badge computed plus its | ||
| 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 | ||
| (zero emitters repo-wide), and the node-removal refresh-all loop. | ||
| With their last listeners gone, both trigger actions are deleted | ||
| outright — emitters, event-map entries, and types (the badge system | ||
| sources connectivity from `linkStore`, not events; resurrect from git | ||
| if a consumer ever materialises). Readers get the root graph id from |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Align the migration claim with the retained contracts.
This section says the last inputs[].link readers and slot-link trigger contracts are deleted, but the PR retains computation-path reads in useNodePricing.buildJsonataContext, the input.link emitters, and their trigger types. Narrow the claim to the renderer paths actually migrated and document the retained paths.
🤖 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-data-store.md` around lines 69 - 80, The migration
description in the architecture documentation overstates removal of
inputs[].link readers and slot-link trigger contracts. Narrow the claim to the
renderer paths actually migrated, and explicitly document that
useNodePricing.buildJsonataContext still reads input.link while its emitters and
trigger types remain retained.
Computed reads of isInputSlotConnected before a graph bucket exists must re-evaluate when the first link registers. Fails if targetIndex is downgraded to shallowRef.
|
Re: the Description updated: "last mirror readers" now reads "mirror-based reactivity tracking", and the "Not removed" list names the |
Summary
Migrates the
inputs[].linkmirror-based reactivity tracking tolinkStorequeries and deletes the slot-link reprojection machinery inuseGraphNodeManager.Changes
NodeSlots.linkedWidgetedInputs,usePartitionedBadges' pricing pokes, andtrackNodePricenow querylinkStore.isInputSlotConnected(root graph id + unfiltered slot index). Deletes thenode:slot-links:changedhandler and its load-bearing comment, the emitter-lessnode:slot-errors:changedhandler,refreshNodeInputs, and the node-removal refresh-all loop. Adds unified-mode NodeSlots tests (none existed) and atrackNodePricereactivity test. Draftsdocs/architecture/node-data-store.mdfor the next phase.node:slot-links:changedemitters and trigger type entries, theinput.linkmirror itself, the computation-pathinp.linkreads inuseNodePricing.buildJsonataContext(migrated in refactor!: delete the input.link runtime mirror #13498 alongside the mirror deletion), and thenode:slot-label:changedhandler — those belong to the Slot extraction / nodeDataStore phases.Review Focus
🤖 Generated with Claude Code