Repository navigation
refactor: derive badge rows on read, delete the badge store - #13686
Conversation
Renderers own presentation: legacy joins id/lifecycle/source in its own order with brackets intact, Vue trims and reorders. Rows carry the raw projected text plus a part discriminator instead of pre-trimmed text. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SubgraphNode wrappers project their credits row from the inner nodes' store rows: several priced inner nodes collapse to 'Partner Nodes x N', a single one shows its price with the wrapper's promoted widget values overriding the inner node's own. The aggregation tracks inner rows, the registered-node set, and an exported structure revision for the events stores cannot observe. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Legacy drawBadges renders the store rows through a per-node memoized LGraphBadge cache (core parts joined id/lifecycle/source and truncated, icons resolved via a badge icon registry) followed by the raw node.badges extension surface, whose thunks still evaluate per frame. The Vue partition reads the same rows — trimming lifecycle brackets and swapping a built-in node's source row for the Comfy logo chip — plus the raw extension surface. useNodeBadge now bootstraps the badge system per root graph and forwards the subgraph structure events; dynamic-pricing recalculation wiring is kept. The usePriceBadge closures, the VueNodeData.badges mirror, its property trigger, and node.badgePosition (no ecosystem uses; single writer/reader) are deleted. node.badges itself stays: three custom-node packs actively push to it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wrapper aggregation counts inner api nodes (the old unconditional per-api-node badge basis) rather than resolved credits rows, so a pending async price still yields 'Partner Nodes x N'; the label is localized via nodeBadge.partnerNodesCount. useNodePricing now caches labels per signature: a leaf's own read and its wrapper's promoted-override read previously shared one cache slot and evicted each other, re-scheduling evaluations forever once both ran in eager system effects. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
LGraph.clear() and configure() reassign the root graph id, so the badge system now resolves it on every recompute instead of capturing it at start; a captured id stranded the system on a dead bucket after Clear Workflow, dropping every badge on nodes added afterwards. LGraph.add registers the node in the badge store only after onNodeAdded: the store write wakes the system watcher and queues Vue's flush, which must not overtake the deferred paste scan that surfaces missing-model errors before selection-scoped tabs recalculate. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The system's watch tracked only the current graph id's bucket key; a workflow load buckets nodes under a brand-new graph id the watcher had never observed, so it never fired again and no badges were written after any configure. registeredNodeIds now also reads the bucket map size, so bucket creation and deletion wake readers regardless of which id they last saw. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- registeredNodeIds tracks bucket size only on get() miss, sparing hit-path readers spurious invalidations from unrelated buckets - replace mutable-accumulator walk with collectApiLeaves flatMap; keeps definition-dedupe and cycle guard from legacy usePriceBadge
Subgraph instances share their definition's nodes, so mapAllNodes revisits shared internals per instance. mapUniqueNodes visits each definition once and terminates on cycles. Replaces the local walk in badgeSystem and fixes duplicate PartnerNodesList entries (and v-for keys) when a subgraph is instanced more than once.
Extension badge kind deleted: node.badges is the raw extension surface, sampled by the Vue partition on recompute. Store rows are replaced wholesale per write so the draw cache keys on array identity instead of JSON. wirePricingRecalculation and its onConnectionsChange patch were redundant with the system's tracked sources. badgePosition returns as a deprecated no-op accessor. BadgeData and pricing sources are discriminated unions.
Badge rows are derived presentation, not entity state; the store was a materialized cache and its registration/watcher/scope machinery was cache invalidation. nodeBadges(node) is now one lazy computed per node instance in a WeakMap: entries die with their nodes, so registration, teardown, and the stale-bucket bug class do not exist. A single graphStructureRevision (bumped at add/remove/clear chokepoints and structure events) replaces bucket membership, subgraphCreditsRevision, and the live-graph-id seams. Litegraph consumes rows through a one-function provider seam, keeping its import graph acyclic; the identity-keyed draw cache is unchanged.
|
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:
📝 WalkthroughWalkthroughThis PR replaces the node badge store with memoized per-node derivation, updates badge data and pricing contracts, adds provider-based LiteGraph rendering, rewires Vue and linear-mode consumers, removes obsolete pricing and badge APIs, and adds graph-aware derivation and rendering tests. ChangesNode badge derivation and rendering
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Canvas as Legacy canvas
participant Node as LGraphNode
participant Draw as nodeBadgeDraw
participant System as badgeSystem
Canvas->>Node: drawBadges()
Node->>Draw: badgeRows(node)
Draw->>System: call registered nodeBadges provider
System-->>Draw: derived core and credits rows
Draw-->>Node: memoized LGraphBadge objects
Node-->>Canvas: render right-aligned badges
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🎭 Playwright: ✅ 1691 passed, 0 failed · 2 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-07-16T18:23:19.286Z",
"gitSha": "2f7c48e603238ef3cc99cda73c211ea3b7523220",
"branch": "drjkl/and-then-there-was-no-store",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2090.238999999997,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.276,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 453.52799999999996,
"heapDeltaBytes": -6579724,
"heapUsedBytes": 63219884,
"domNodes": -277,
"jsHeapTotalBytes": 18763776,
"scriptDurationMs": 23.369,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2059.921000000031,
"styleRecalcs": 10,
"styleRecalcDurationMs": 10.53,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 442.494,
"heapDeltaBytes": -7047764,
"heapUsedBytes": 62785720,
"domNodes": -270,
"jsHeapTotalBytes": 19550208,
"scriptDurationMs": 24.464,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1940.6549999999925,
"styleRecalcs": 72,
"styleRecalcDurationMs": 40.056999999999995,
"layouts": 12,
"layoutDurationMs": 3.613,
"taskDurationMs": 944.428,
"heapDeltaBytes": -12021200,
"heapUsedBytes": 57732788,
"domNodes": -242,
"jsHeapTotalBytes": 19288064,
"scriptDurationMs": 123.59200000000001,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1830.964999999992,
"styleRecalcs": 75,
"styleRecalcDurationMs": 38.688,
"layouts": 12,
"layoutDurationMs": 3.8609999999999998,
"taskDurationMs": 790.5230000000001,
"heapDeltaBytes": -5816688,
"heapUsedBytes": 53281680,
"domNodes": 57,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 121.112,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1746.1379999999735,
"styleRecalcs": 29,
"styleRecalcDurationMs": 16.707,
"layouts": 6,
"layoutDurationMs": 0.7740000000000001,
"taskDurationMs": 366.24600000000004,
"heapDeltaBytes": 11377676,
"heapUsedBytes": 63043208,
"domNodes": -236,
"jsHeapTotalBytes": 7467008,
"scriptDurationMs": 24.964999999999996,
"eventListeners": -184,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1749.3769999999813,
"styleRecalcs": 31,
"styleRecalcDurationMs": 15.616000000000001,
"layouts": 6,
"layoutDurationMs": 0.626,
"taskDurationMs": 365.79699999999997,
"heapDeltaBytes": 8738776,
"heapUsedBytes": 61493844,
"domNodes": -235,
"jsHeapTotalBytes": 7204864,
"scriptDurationMs": 26.206,
"eventListeners": -182,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 575.540999999987,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.612,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 359.10699999999997,
"heapDeltaBytes": -1291072,
"heapUsedBytes": 50654360,
"domNodes": -268,
"jsHeapTotalBytes": -659456,
"scriptDurationMs": 52.969,
"eventListeners": -203,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66666666666665,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 606.1490000000163,
"styleRecalcs": 10,
"styleRecalcDurationMs": 10.872,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 390.59599999999995,
"heapDeltaBytes": -4538036,
"heapUsedBytes": 47413836,
"domNodes": -275,
"jsHeapTotalBytes": 389120,
"scriptDurationMs": 54.35999999999999,
"eventListeners": -203,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "large-graph-idle",
"durationMs": 2029.4269999999983,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.416000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 662.0570000000001,
"heapDeltaBytes": -6620560,
"heapUsedBytes": 57121816,
"domNodes": -269,
"jsHeapTotalBytes": -1089536,
"scriptDurationMs": 219.38599999999997,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2028.4829999999943,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.400999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 715.517,
"heapDeltaBytes": 3277436,
"heapUsedBytes": 77437824,
"domNodes": -106,
"jsHeapTotalBytes": 6713344,
"scriptDurationMs": 230.533,
"eventListeners": -68,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2115.0930000000017,
"styleRecalcs": 68,
"styleRecalcDurationMs": 15.988,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1208.2079999999999,
"heapDeltaBytes": 15652424,
"heapUsedBytes": 81059564,
"domNodes": -273,
"jsHeapTotalBytes": 163840,
"scriptDurationMs": 525.299,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2118.7949999999773,
"styleRecalcs": 69,
"styleRecalcDurationMs": 17.008000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1263.671,
"heapDeltaBytes": 16547928,
"heapUsedBytes": 81917612,
"domNodes": -271,
"jsHeapTotalBytes": 425984,
"scriptDurationMs": 548.631,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3230.8649999999943,
"styleRecalcs": 62,
"styleRecalcDurationMs": 15.118,
"layouts": 60,
"layoutDurationMs": 7.361,
"taskDurationMs": 1469.708,
"heapDeltaBytes": 26850820,
"heapUsedBytes": 81844292,
"domNodes": 4,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 683.951,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3341.4679999999635,
"styleRecalcs": 65,
"styleRecalcDurationMs": 17.769,
"layouts": 60,
"layoutDurationMs": 7.786999999999999,
"taskDurationMs": 1575.777,
"heapDeltaBytes": 29196676,
"heapUsedBytes": 83050512,
"domNodes": -275,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 726.039,
"eventListeners": -195,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2004.694000000029,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.002999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 617.9229999999999,
"heapDeltaBytes": 5391472,
"heapUsedBytes": 58236408,
"domNodes": -268,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 210.85000000000002,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2037.097000000017,
"styleRecalcs": 7,
"styleRecalcDurationMs": 5.777000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 676.5479999999999,
"heapDeltaBytes": -8711464,
"heapUsedBytes": 57547456,
"domNodes": -271,
"jsHeapTotalBytes": -1843200,
"scriptDurationMs": 222.47199999999998,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 610.4740000000106,
"styleRecalcs": 46,
"styleRecalcDurationMs": 14.671000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 417.103,
"heapDeltaBytes": -22134456,
"heapUsedBytes": 47736476,
"domNodes": -275,
"jsHeapTotalBytes": 5394432,
"scriptDurationMs": 128.613,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 610.4589999999916,
"styleRecalcs": 47,
"styleRecalcDurationMs": 12.406,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 406.948,
"heapDeltaBytes": -22467676,
"heapUsedBytes": 47277476,
"domNodes": -273,
"jsHeapTotalBytes": 5656576,
"scriptDurationMs": 131.612,
"eventListeners": -197,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "subgraph-idle",
"durationMs": 2020.7240000000013,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.329999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 387.025,
"heapDeltaBytes": 12506228,
"heapUsedBytes": 65224060,
"domNodes": -265,
"jsHeapTotalBytes": 17428480,
"scriptDurationMs": 18.700000000000003,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-idle",
"durationMs": 2039.8439999999596,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.855,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 421.3829999999999,
"heapDeltaBytes": -7387612,
"heapUsedBytes": 62481384,
"domNodes": -273,
"jsHeapTotalBytes": 18501632,
"scriptDurationMs": 18.741,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1740.5860000000075,
"styleRecalcs": 77,
"styleRecalcDurationMs": 39.088,
"layouts": 16,
"layoutDurationMs": 4.056,
"taskDurationMs": 697.225,
"heapDeltaBytes": 15516652,
"heapUsedBytes": 73186028,
"domNodes": 65,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 91.55099999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 2097.6949999999874,
"styleRecalcs": 75,
"styleRecalcDurationMs": 41.632000000000005,
"layouts": 16,
"layoutDurationMs": 4.619999999999999,
"taskDurationMs": 990.809,
"heapDeltaBytes": 3840460,
"heapUsedBytes": 55467168,
"domNodes": -224,
"jsHeapTotalBytes": 16904192,
"scriptDurationMs": 126.62599999999999,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 951.7660000000205,
"styleRecalcs": 17,
"styleRecalcDurationMs": 28.711999999999996,
"layouts": 13,
"layoutDurationMs": 13.321,
"taskDurationMs": 748.6290000000002,
"heapDeltaBytes": 27606496,
"heapUsedBytes": 97523412,
"domNodes": 13673,
"jsHeapTotalBytes": 16252928,
"scriptDurationMs": 24.895,
"eventListeners": 2531,
"totalBlockingTimeMs": 137,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8169.515999999987,
"styleRecalcs": 249,
"styleRecalcDurationMs": 52.632,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4531.029,
"heapDeltaBytes": 7313268,
"heapUsedBytes": 70852880,
"domNodes": -271,
"jsHeapTotalBytes": 6455296,
"scriptDurationMs": 1944.4859999999999,
"eventListeners": -183,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333338,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8174.1309999999885,
"styleRecalcs": 250,
"styleRecalcDurationMs": 53.633,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4417.609,
"heapDeltaBytes": -5427556,
"heapUsedBytes": 65129960,
"domNodes": -269,
"jsHeapTotalBytes": 1245184,
"scriptDurationMs": 1821.47,
"eventListeners": -183,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 10914.340999999979,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10882.261,
"heapDeltaBytes": -42293608,
"heapUsedBytes": 165770920,
"domNodes": -3300,
"jsHeapTotalBytes": 12554240,
"scriptDurationMs": 883.8430000000002,
"eventListeners": -16350,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333338,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 11120.847000000027,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11105.655,
"heapDeltaBytes": -45152004,
"heapUsedBytes": 168924912,
"domNodes": -3301,
"jsHeapTotalBytes": 4194304,
"scriptDurationMs": 955.2049999999999,
"eventListeners": -16376,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 13662.65999999996,
"styleRecalcs": 65,
"styleRecalcDurationMs": 19.346000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13644.342999999999,
"heapDeltaBytes": -42175484,
"heapUsedBytes": 154713652,
"domNodes": -3300,
"jsHeapTotalBytes": 4952064,
"scriptDurationMs": 1209.339,
"eventListeners": -16376,
"totalBlockingTimeMs": 1,
"frameDurationMs": 16.66333333333338,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 13809.311999999976,
"styleRecalcs": 65,
"styleRecalcDurationMs": 21.421999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13791.96,
"heapDeltaBytes": -25224460,
"heapUsedBytes": 164469040,
"domNodes": -3301,
"jsHeapTotalBytes": 17301504,
"scriptDurationMs": 1279.16,
"eventListeners": -16369,
"totalBlockingTimeMs": 43,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 436.10100000000784,
"styleRecalcs": 16,
"styleRecalcDurationMs": 20.812,
"layouts": 5,
"layoutDurationMs": 1.5070000000000001,
"taskDurationMs": 110.546,
"heapDeltaBytes": 5208548,
"heapUsedBytes": 63840584,
"domNodes": 168,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 16.83,
"eventListeners": 69,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 535.8459999999923,
"styleRecalcs": 14,
"styleRecalcDurationMs": 27.059,
"layouts": 5,
"layoutDurationMs": 1.855,
"taskDurationMs": 194.075,
"heapDeltaBytes": -2218564,
"heapUsedBytes": 50981808,
"domNodes": -147,
"jsHeapTotalBytes": -659456,
"scriptDurationMs": 23.718000000000004,
"eventListeners": -132,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
🎨 Storybook: 🚧 Building... |
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## feature/ecs-migration #13686 +/- ##
========================================================
Coverage ? 78.70%
========================================================
Files ? 1653
Lines ? 110924
Branches ? 39862
========================================================
Hits ? 87299
Misses ? 22775
Partials ? 850
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/composables/node/useNodePricing.ts (1)
500-530: 🚀 Performance & Scalability | 🟠 Major | ⚡ Quick winTrack in-flight evaluations per signature.
inflightretains only one signature per node. Starting signature B replaces pending A, so another A read schedules a duplicate evaluation. Multiple wrappers with alternating overrides can fan out redundant JSONata work. Use a per-nodeMap<signature, promise>and remove only the completed signature.🤖 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/composables/node/useNodePricing.ts` around lines 500 - 530, Update scheduleEvaluation and the inflight state to track promises in a per-node Map keyed by signature, rather than a single { sig, promise } entry. Skip scheduling only when the requested signature already has an in-flight promise, store each new signature independently, and in finally remove only that completed signature while preserving the existing cache and revision updates.
🤖 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/adr/0008-entity-component-system.md`:
- Around line 40-53: Update the amendment paragraph in
0008-entity-component-system.md to remove the obsolete “store” reference from
the registration seam description, leaving litegraph independent from the badge
system’s pricing and node-definition dependencies. Keep the surrounding
explanation of lazy projections and transient badge rows unchanged.
In `@docs/architecture/node-badge-store.md`:
- Around line 222-227: Monitor the global graphStructureRevision invalidation
behavior in nodeBadges and the legacy LGraphBadge draw cache, profiling large
graphs with frequent structural edits to detect app-wide recomputation or redraw
costs; preserve the current accepted global invalidation design unless profiling
reveals a regression.
In `@src/lib/litegraph/src/LGraph.ts`:
- Around line 305-311: Document `_versionRef` beside its declaration, explaining
that `_version` is ref-backed so `nodes`-getter consumers such as
`mapUniqueNodes` react to version changes. Update the `incrementVersion()`
documentation to describe both its debug-display use and its role in driving
`nodes` getter reactivity, replacing the stale “only read” wording.
In `@src/lib/litegraph/src/nodeBadgeDraw.test.ts`:
- Around line 13-24: The test `joins core parts into one badge in id, lifecycle,
source order` does not distinguish which core row supplies the badge colors
because every `coreRow` uses identical colors. Assign distinct foreground and
background colors to the lifecycle, id, and source rows, then assert the
expected colors from the join-order-selected `firstCore` while preserving the
existing text-order assertion.
In `@src/locales/en/main.json`:
- Around line 2249-2251: Update the nodeBadge.partnerNodesCount locale entry to
provide vue-i18n singular and plural forms instead of hardcoding “Nodes”. Ensure
the corresponding node-count translation call uses the pluralization overload
and passes the count so one renders the singular form and other counts render
the plural form.
In `@src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts`:
- Around line 24-33: Move the node definition lookup from the outer scope into
the computed callback in usePartitionedBadges, using nodeData.type with the
reactive node-definition store there. Keep the existing showComfyLogo logic
unchanged so additions or replacements in nodeDefsByName trigger recomputation.
In `@src/systems/badgeSystem.subgraph.test.ts`:
- Around line 116-131: Move the promoted-widget-override setup out of the test’s
direct wrapper._internalConfigureAfterSlots() call and into subgraphHelpers,
preferably through createTestSubgraphNode or a focused helper. Update this test
to use that public test utility for connecting the promoted input, reconfiguring
slots, and applying the widget override, while preserving the existing
wrapperCredits() assertion.
In `@src/systems/badgeSystem.ts`:
- Around line 231-249: Update nodeBadges to read the graph-level reactive
revision or identity inside its computed callback before gatherSources(node),
ensuring cached badge rows recompute when a node moves between graphs or a
subgraph reloads. Reuse the existing reactive graph source and preserve the
current memoization and gatherSources flow.
---
Outside diff comments:
In `@src/composables/node/useNodePricing.ts`:
- Around line 500-530: Update scheduleEvaluation and the inflight state to track
promises in a per-node Map keyed by signature, rather than a single { sig,
promise } entry. Skip scheduling only when the requested signature already has
an in-flight promise, store each new signature independently, and in finally
remove only that completed signature while preserving the existing cache and
revision updates.
🪄 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: 8cacb438-185f-45c8-86db-f5da6a643326
⛔ Files ignored due to path filters (1)
browser_tests/tests/nodeBadge.spec.ts-snapshots/node-badge-left-chromium-linux.pngis excluded by!**/*.png
📒 Files selected for processing (29)
browser_tests/tests/nodeBadge.spec.tsdocs/adr/0008-entity-component-system.mddocs/architecture/node-badge-store.mdsrc/composables/graph/useGraphNodeManager.tssrc/composables/node/useNodeBadge.tssrc/composables/node/useNodePricing.test.tssrc/composables/node/useNodePricing.tssrc/composables/node/usePriceBadge.test.tssrc/composables/node/usePriceBadge.tssrc/lib/litegraph/src/LGraph.badges.test.tssrc/lib/litegraph/src/LGraph.tssrc/lib/litegraph/src/LGraphBadge.tssrc/lib/litegraph/src/LGraphNode.tssrc/lib/litegraph/src/litegraph.tssrc/lib/litegraph/src/nodeBadgeDraw.test.tssrc/lib/litegraph/src/nodeBadgeDraw.tssrc/locales/en/main.jsonsrc/renderer/extensions/linearMode/PartnerNodesList.vuesrc/renderer/extensions/vueNodes/composables/usePartitionedBadges.test.tssrc/renderer/extensions/vueNodes/composables/usePartitionedBadges.tssrc/stores/nodeBadgeStore.test.tssrc/stores/nodeBadgeStore.tssrc/systems/badgeSystem.pricing.test.tssrc/systems/badgeSystem.subgraph.test.tssrc/systems/badgeSystem.test.tssrc/systems/badgeSystem.tssrc/types/badgeData.tssrc/utils/graphTraversalUtil.test.tssrc/utils/graphTraversalUtil.ts
💤 Files with no reviewable changes (8)
- src/stores/nodeBadgeStore.test.ts
- src/composables/node/usePriceBadge.test.ts
- src/stores/nodeBadgeStore.ts
- src/lib/litegraph/src/LGraph.badges.test.ts
- src/lib/litegraph/src/LGraphBadge.ts
- src/composables/node/usePriceBadge.ts
- src/composables/graph/useGraphNodeManager.ts
- browser_tests/tests/nodeBadge.spec.ts
| private readonly _versionRef = shallowRef(-1) | ||
| get _version(): number { | ||
| return toRaw(this)._versionRef.value | ||
| } | ||
| set _version(value: number) { | ||
| toRaw(this)._versionRef.value = value | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
_version's new reactive role isn't documented, and incrementVersion()'s doc is now stale.
The _id field (just above) has a comment explaining why it's ref-backed ("propagates to reactive consumers keyed by root graph id"). _versionRef has no equivalent rationale, even though this diff gives _version a new job: the nodes getter (line 561) now touches it to drive reactive badge/credits derivation for consumers like mapUniqueNodes. Meanwhile incrementVersion()'s existing doc still says _version is "Currently only read for debug display in {@link LGraphCanvas.renderInfo}" — that's no longer accurate and could mislead a future refactor into thinking it's safe to drop/batch increments.
📝 Suggested doc update
+ /**
+ * Ref-backed so structural changes (node/group add, remove, connect) are
+ * observable by reactive consumers that read {`@link` nodes} inside a
+ * computed (e.g. subgraph credit-badge derivation).
+ */
private readonly _versionRef = shallowRef(-1)And update the incrementVersion() doc to note it now also drives nodes-getter reactivity, not just debug display.
🤖 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` around lines 305 - 311, Document
`_versionRef` beside its declaration, explaining that `_version` is ref-backed
so `nodes`-getter consumers such as `mapUniqueNodes` react to version changes.
Update the `incrementVersion()` documentation to describe both its debug-display
use and its role in driving `nodes` getter reactivity, replacing the stale “only
read” wording.
There was a problem hiding this comment.
@christian-byrne See what happens? You document one field...
| const { t } = useI18n() | ||
| const canvasStore = useCanvasStore() | ||
|
|
||
| const creditsBadges = computed(() => |
There was a problem hiding this comment.
Worth moving this into the store?
I've got a current PR that also needs this information, and I've run into some lifecycle/reactivity issues that could benefit from some ECS love.
There was a problem hiding this comment.
There was a problem hiding this comment.
Moved it into badgeSystem
| const { t } = useI18n() | ||
| const canvasStore = useCanvasStore() | ||
|
|
||
| const creditsBadges = computed(() => |
There was a problem hiding this comment.
Reactive version bump before onNodeAdded scheduled the Vue flush ahead of the hook's microtask-deferred missing-model scan; the errors tab was evicted on paste before the pasted node's candidate existed.
Ref-backed graph fields make node instances non-serializable, so Playwright resolves them to undefined; project the type inline instead.
Captured once at composable creation, core-node defs registered or replaced after mount never re-partitioned (logo, source suppression).
Remove claims that drifted from code: _version 'debug only', badge computed 'tracks graph structure revision', the never-built graphStructureRevision module, and the deleted badge store.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/architecture/node-badge-store.md (1)
215-218: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUse the actual provider API name.
The implementation exports
registerBadgeRowsProvider, notsetBadgeRowsProvider. Update this documentation so the architecture description matches the current seam and remains searchable.Proposed wording fix
-- `setBadgeRowsProvider` (in `nodeBadgeDraw.ts`) — a one-function seam +- `registerBadgeRowsProvider` (in `nodeBadgeDraw.ts`) — a one-function seam🤖 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 215 - 218, Update the architecture description to replace setBadgeRowsProvider with the actual exported API name registerBadgeRowsProvider, preserving the existing explanation of the provider seam and keeping the symbol searchable.
🤖 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.
Outside diff comments:
In `@docs/architecture/node-badge-store.md`:
- Around line 215-218: Update the architecture description to replace
setBadgeRowsProvider with the actual exported API name
registerBadgeRowsProvider, preserving the existing explanation of the provider
seam and keeping the symbol searchable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a1c95d2e-81ad-482b-8ea6-2876f957ce15
📒 Files selected for processing (9)
browser_tests/fixtures/helpers/NodeOperationsHelper.tsbrowser_tests/tests/workflowPersistence.spec.tsdocs/adr/0008-entity-component-system.mddocs/architecture/node-badge-store.mdsrc/composables/node/useNodePricing.tssrc/lib/litegraph/src/LGraph.tssrc/renderer/extensions/vueNodes/composables/usePartitionedBadges.test.tssrc/renderer/extensions/vueNodes/composables/usePartitionedBadges.tssrc/systems/badgeSystem.ts
💤 Files with no reviewable changes (2)
- src/composables/node/useNodePricing.ts
- browser_tests/fixtures/helpers/NodeOperationsHelper.ts
PartnerNodesList mounts twice and PR 13657's free-tier quota needs the same list; one memoized per-graph computed replaces per-component traversals.
|
Going to merge to the feature branch for now, but if you have comments I'll follow up before trying to merge into main. |
Summary
Prototype: badge rows are derived presentation, not entity state, so this replaces the materialized
nodeBadgeStore(and its registration/watcher/scope machinery, which amounted to cache invalidation) with a per-node memoized derivation.Changes
nodeBadges(node)— one lazycomputedper node instance in aWeakMap; entries die with their nodes, so registration, teardown, and the stale-bucket bug class do not exist. A singlegraphStructureRevision(litegraph leaf, bumped atadd/remove/clearchokepoints and structure events) replaces bucket membership,subgraphCreditsRevision, and theresolveGraphId/resolveNodeseams. Litegraph consumes rows through a one-functionsetBadgeRowsProviderseam, keeping its import graph acyclic.computeBadgesstays pure/plain-data; the identity-keyed draw cache is unchanged. Net −456 lines.node.badgesand settings behavior unchanged.Review Focus
docs/architecture/node-badge-store.md("Prototype: derive-on-read") records the reasoning and trade-offs.pricingRevisionwatch inuseNodeBadge, same as the parent branch.Child of #13460 — compare against
drjkl/and-then-there-were-none, notfeature/ecs-migration.