Repository navigation
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019de596-2219-76a4-96fc-0350ab5a83cc Co-authored-by: Amp <amp@ampcode.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughPromoted subgraph widgets now use per-instance widget-state cells keyed by graphId + subgraphNode.id + storeName. Reads fall back to interior defaults; writes persist per-instance and write-through to the representative interior. Subgraph configure/serialize replay and emit per-instance values without mutating unrelated interiors. ChangesPer-Instance Promoted Widget Values
Sequence Diagram(s)sequenceDiagram
actor User
participant SubgraphNode as rgba(70,130,180,0.5)
participant PromotedWidgetView as rgba(34,139,34,0.5)
participant WidgetValueStore as rgba(255,165,0,0.5)
participant Serializer as rgba(128,0,128,0.5)
User->>SubgraphNode: instantiate host (nodeId)
SubgraphNode->>PromotedWidgetView: create promoted view (per-instance)
User->>PromotedWidgetView: set value ("Alpha\n")
PromotedWidgetView->>WidgetValueStore: getOrRegister(graphId,nodeId,storeName)
WidgetValueStore->>PromotedWidgetView: return per-instance WidgetState
PromotedWidgetView->>PromotedWidgetView: write per-instance cell.value
Note over PromotedWidgetView,SubgraphNode: interior widget value also write-through
User->>SubgraphNode: serialize()
SubgraphNode->>PromotedWidgetView: request per-instance values
PromotedWidgetView->>WidgetValueStore: read per-instance cell.value
WidgetValueStore->>SubgraphNode: return value
SubgraphNode->>Serializer: project into serialized.widgets_values
User->>SubgraphNode: reload / configure(serialized)
SubgraphNode->>PromotedWidgetView: replay widgets_values[i]
PromotedWidgetView->>WidgetValueStore: restore per-instance cell from value
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🎨 Storybook: ✅ Built — View Storybook |
🎭 Playwright: ✅ 1496 passed, 0 failed📊 Browser Reports
|
📦 Bundle: 5.26 MB gzip 🔴 +1.99 kBDetailsSummary
Category Glance App Entry Points — 22.6 kB (baseline 22.6 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.24 MB (baseline 1.24 MB) • 🟢 -67 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 82.3 kB (baseline 82.3 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed / 2 unchanged Panels & Settings — 489 kB (baseline 489 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 11 unchanged User & Accounts — 17.6 kB (baseline 17.6 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 5 added / 5 removed / 2 unchanged Editors & Dialogs — 112 kB (baseline 112 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 4 added / 4 removed UI Components — 62.9 kB (baseline 62.9 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed / 9 unchanged Data & Services — 3.06 MB (baseline 3.05 MB) • 🔴 +6.51 kBStores, services, APIs, and repositories
Status: 13 added / 13 removed / 4 unchanged Utilities & Hooks — 365 kB (baseline 365 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 13 added / 13 removed / 18 unchanged Vendor & Third-Party — 9.94 MB (baseline 9.94 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 16 unchanged Other — 8.82 MB (baseline 8.82 MB) • ⚪ 0 BBundles that do not match a named category
Status: 57 added / 57 removed / 79 unchanged ⚡ Performance Report
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-05-05T05:37:29.451Z",
"gitSha": "f2f7dc06f212b85d41e6ff88fb68da73ec9e2748",
"branch": "drjkl/subgraph-instance-store",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2047.646000000043,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.263999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 456.91499999999996,
"heapDeltaBytes": 23722016,
"heapUsedBytes": 72336996,
"domNodes": 18,
"jsHeapTotalBytes": 15204352,
"scriptDurationMs": 26.093999999999998,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2023.8650000000007,
"styleRecalcs": 8,
"styleRecalcDurationMs": 8.487000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 399.393,
"heapDeltaBytes": 22732240,
"heapUsedBytes": 71448848,
"domNodes": 16,
"jsHeapTotalBytes": 15204352,
"scriptDurationMs": 22.781999999999996,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2018.16000000008,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.841999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 441.322,
"heapDeltaBytes": 23611128,
"heapUsedBytes": 72327256,
"domNodes": 16,
"jsHeapTotalBytes": 14942208,
"scriptDurationMs": 25.995,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2033.1960000000322,
"styleRecalcs": 80,
"styleRecalcDurationMs": 52.748000000000005,
"layouts": 12,
"layoutDurationMs": 4.930000000000001,
"taskDurationMs": 990.647,
"heapDeltaBytes": -1655880,
"heapUsedBytes": 67027756,
"domNodes": 64,
"jsHeapTotalBytes": 19660800,
"scriptDurationMs": 157.193,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1867.3469999999952,
"styleRecalcs": 73,
"styleRecalcDurationMs": 39.227,
"layouts": 12,
"layoutDurationMs": 3.5329999999999995,
"taskDurationMs": 852.6270000000001,
"heapDeltaBytes": -220304,
"heapUsedBytes": 48272824,
"domNodes": -266,
"jsHeapTotalBytes": 16379904,
"scriptDurationMs": 133.786,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1831.7049999999426,
"styleRecalcs": 73,
"styleRecalcDurationMs": 41.117,
"layouts": 12,
"layoutDurationMs": 3.887,
"taskDurationMs": 853.37,
"heapDeltaBytes": -1345380,
"heapUsedBytes": 47323900,
"domNodes": -264,
"jsHeapTotalBytes": 15593472,
"scriptDurationMs": 134.689,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1724.0699999999833,
"styleRecalcs": 32,
"styleRecalcDurationMs": 18.275999999999996,
"layouts": 6,
"layoutDurationMs": 0.5889999999999999,
"taskDurationMs": 375.88200000000006,
"heapDeltaBytes": 291620,
"heapUsedBytes": 52722700,
"domNodes": 78,
"jsHeapTotalBytes": 26214400,
"scriptDurationMs": 33.555,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1719.6549999999888,
"styleRecalcs": 31,
"styleRecalcDurationMs": 18.531,
"layouts": 6,
"layoutDurationMs": 0.7390000000000001,
"taskDurationMs": 347.422,
"heapDeltaBytes": 171280,
"heapUsedBytes": 48921032,
"domNodes": 75,
"jsHeapTotalBytes": 15204352,
"scriptDurationMs": 26.636,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1735.7790000000932,
"styleRecalcs": 30,
"styleRecalcDurationMs": 19.267999999999997,
"layouts": 6,
"layoutDurationMs": 0.825,
"taskDurationMs": 363.459,
"heapDeltaBytes": 97032,
"heapUsedBytes": 48909348,
"domNodes": 75,
"jsHeapTotalBytes": 15466496,
"scriptDurationMs": 27.204000000000008,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 587.506000000019,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.946999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 357.97100000000006,
"heapDeltaBytes": 8753908,
"heapUsedBytes": 57165736,
"domNodes": 16,
"jsHeapTotalBytes": 15728640,
"scriptDurationMs": 63.891000000000005,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 578.9320000000089,
"styleRecalcs": 12,
"styleRecalcDurationMs": 8.557,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 369.437,
"heapDeltaBytes": 10133316,
"heapUsedBytes": 59035804,
"domNodes": 20,
"jsHeapTotalBytes": 15204352,
"scriptDurationMs": 68.833,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "dom-widget-clipping",
"durationMs": 563.951999999972,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.543999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 356.821,
"heapDeltaBytes": 8813100,
"heapUsedBytes": 57247304,
"domNodes": 16,
"jsHeapTotalBytes": 15990784,
"scriptDurationMs": 62.017999999999994,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "large-graph-idle",
"durationMs": 2031.4960000000042,
"styleRecalcs": 7,
"styleRecalcDurationMs": 7.772000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 677.0720000000001,
"heapDeltaBytes": 7739088,
"heapUsedBytes": 66236256,
"domNodes": -267,
"jsHeapTotalBytes": -495616,
"scriptDurationMs": 110.405,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2038.0569999999807,
"styleRecalcs": 9,
"styleRecalcDurationMs": 10.402999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 679.6049999999999,
"heapDeltaBytes": 12625236,
"heapUsedBytes": 71128720,
"domNodes": -263,
"jsHeapTotalBytes": 290816,
"scriptDurationMs": 112.267,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2035.5520000000524,
"styleRecalcs": 8,
"styleRecalcDurationMs": 8.822,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 709.46,
"heapDeltaBytes": 3339816,
"heapUsedBytes": 63229000,
"domNodes": -264,
"jsHeapTotalBytes": 4018176,
"scriptDurationMs": 110.33500000000001,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2138.259000000005,
"styleRecalcs": 68,
"styleRecalcDurationMs": 17.590999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1240.308,
"heapDeltaBytes": -5727448,
"heapUsedBytes": 53888032,
"domNodes": -267,
"jsHeapTotalBytes": 5795840,
"scriptDurationMs": 445.83799999999997,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2178.328000000022,
"styleRecalcs": 68,
"styleRecalcDurationMs": 17.371000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1207.9820000000002,
"heapDeltaBytes": -334808,
"heapUsedBytes": 59228252,
"domNodes": -265,
"jsHeapTotalBytes": 6524928,
"scriptDurationMs": 424.836,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2137.4960000000556,
"styleRecalcs": 68,
"styleRecalcDurationMs": 18.700000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1217.128,
"heapDeltaBytes": -1522564,
"heapUsedBytes": 58356392,
"domNodes": -263,
"jsHeapTotalBytes": 6262784,
"scriptDurationMs": 422.854,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3213.2609999999886,
"styleRecalcs": 65,
"styleRecalcDurationMs": 19.964000000000002,
"layouts": 60,
"layoutDurationMs": 7.781,
"taskDurationMs": 1460.8970000000002,
"heapDeltaBytes": 7895432,
"heapUsedBytes": 68924740,
"domNodes": -270,
"jsHeapTotalBytes": 6057984,
"scriptDurationMs": 525.027,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3213.92400000002,
"styleRecalcs": 65,
"styleRecalcDurationMs": 18.671,
"layouts": 60,
"layoutDurationMs": 7.572000000000001,
"taskDurationMs": 1425.5990000000002,
"heapDeltaBytes": 8662696,
"heapUsedBytes": 69592016,
"domNodes": -268,
"jsHeapTotalBytes": 4485120,
"scriptDurationMs": 522.1020000000001,
"eventListeners": -125,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3182.986000000028,
"styleRecalcs": 65,
"styleRecalcDurationMs": 19.628,
"layouts": 60,
"layoutDurationMs": 7.809,
"taskDurationMs": 1436.5220000000002,
"heapDeltaBytes": 12529276,
"heapUsedBytes": 73600428,
"domNodes": -269,
"jsHeapTotalBytes": 815104,
"scriptDurationMs": 522.062,
"eventListeners": -125,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2054.313000000036,
"styleRecalcs": 9,
"styleRecalcDurationMs": 10.512,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 703.37,
"heapDeltaBytes": 13758188,
"heapUsedBytes": 74255816,
"domNodes": -261,
"jsHeapTotalBytes": 28672,
"scriptDurationMs": 114.536,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2035.521000000017,
"styleRecalcs": 7,
"styleRecalcDurationMs": 7.481999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 679.8740000000001,
"heapDeltaBytes": 4356336,
"heapUsedBytes": 64528392,
"domNodes": -266,
"jsHeapTotalBytes": 28672,
"scriptDurationMs": 111.463,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "minimap-idle",
"durationMs": 2056.4490000000433,
"styleRecalcs": 8,
"styleRecalcDurationMs": 11.155000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 669.023,
"heapDeltaBytes": 15492828,
"heapUsedBytes": 76047268,
"domNodes": -261,
"jsHeapTotalBytes": -233472,
"scriptDurationMs": 110.07700000000001,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 591.0800000000336,
"styleRecalcs": 46,
"styleRecalcDurationMs": 11.918000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 382.929,
"heapDeltaBytes": 9596004,
"heapUsedBytes": 58163404,
"domNodes": 18,
"jsHeapTotalBytes": 15204352,
"scriptDurationMs": 126.633,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 590.7189999999218,
"styleRecalcs": 46,
"styleRecalcDurationMs": 11.851,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 377.17100000000005,
"heapDeltaBytes": 9569740,
"heapUsedBytes": 57848744,
"domNodes": 18,
"jsHeapTotalBytes": 15204352,
"scriptDurationMs": 125.743,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 595.7210000000259,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.902999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 388.75300000000004,
"heapDeltaBytes": 9058616,
"heapUsedBytes": 57868316,
"domNodes": 18,
"jsHeapTotalBytes": 15990784,
"scriptDurationMs": 126.689,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-idle",
"durationMs": 1984.5339999999965,
"styleRecalcs": 10,
"styleRecalcDurationMs": 10.004000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 429.1459999999999,
"heapDeltaBytes": 22502684,
"heapUsedBytes": 71183812,
"domNodes": 20,
"jsHeapTotalBytes": 15466496,
"scriptDurationMs": 21.781000000000002,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-idle",
"durationMs": 2017.877999999996,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.949000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 461.547,
"heapDeltaBytes": -3938744,
"heapUsedBytes": 44846676,
"domNodes": -263,
"jsHeapTotalBytes": 14807040,
"scriptDurationMs": 22.723,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 1998.3130000000529,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.940000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 453.79699999999997,
"heapDeltaBytes": 22456356,
"heapUsedBytes": 71544260,
"domNodes": 18,
"jsHeapTotalBytes": 15204352,
"scriptDurationMs": 22.779,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1681.8440000000123,
"styleRecalcs": 74,
"styleRecalcDurationMs": 39.279999999999994,
"layouts": 16,
"layoutDurationMs": 4.5920000000000005,
"taskDurationMs": 723.023,
"heapDeltaBytes": 14296216,
"heapUsedBytes": 63143508,
"domNodes": 59,
"jsHeapTotalBytes": 14942208,
"scriptDurationMs": 101.963,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1744.5879999999647,
"styleRecalcs": 75,
"styleRecalcDurationMs": 43.433,
"layouts": 16,
"layoutDurationMs": 4.494,
"taskDurationMs": 782.156,
"heapDeltaBytes": -1278304,
"heapUsedBytes": 47430760,
"domNodes": -265,
"jsHeapTotalBytes": 15855616,
"scriptDurationMs": 105.17500000000001,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1707.7540000000226,
"styleRecalcs": 75,
"styleRecalcDurationMs": 39.004999999999995,
"layouts": 16,
"layoutDurationMs": 4.474,
"taskDurationMs": 769.9619999999999,
"heapDeltaBytes": -3646728,
"heapUsedBytes": 45226404,
"domNodes": -262,
"jsHeapTotalBytes": 14282752,
"scriptDurationMs": 102.50500000000001,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8217.288999999993,
"styleRecalcs": 249,
"styleRecalcDurationMs": 54.79099999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4189.879,
"heapDeltaBytes": 14050988,
"heapUsedBytes": 72370652,
"domNodes": -262,
"jsHeapTotalBytes": 3117056,
"scriptDurationMs": 1361.5230000000001,
"eventListeners": -113,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8127.611000000002,
"styleRecalcs": 249,
"styleRecalcDurationMs": 52.07000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4019.8860000000004,
"heapDeltaBytes": 8972740,
"heapUsedBytes": 67557492,
"domNodes": -265,
"jsHeapTotalBytes": 1544192,
"scriptDurationMs": 1297.994,
"eventListeners": -113,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8215.235000000008,
"styleRecalcs": 249,
"styleRecalcDurationMs": 53.865,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4198.913,
"heapDeltaBytes": 13411724,
"heapUsedBytes": 71795408,
"domNodes": -265,
"jsHeapTotalBytes": 3117056,
"scriptDurationMs": 1344.111,
"eventListeners": -113,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 13084.386999999992,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13054.831,
"heapDeltaBytes": -37737476,
"heapUsedBytes": 163684132,
"domNodes": -8331,
"jsHeapTotalBytes": 15003648,
"scriptDurationMs": 712.0150000000001,
"eventListeners": -16464,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 12861.385999999926,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 12837.235,
"heapDeltaBytes": -35652660,
"heapUsedBytes": 171019984,
"domNodes": -8331,
"jsHeapTotalBytes": 23916544,
"scriptDurationMs": 685.8530000000001,
"eventListeners": -16464,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.330000000000048,
"p95FrameDurationMs": 33.400000000001455
},
{
"name": "vue-large-graph-idle",
"durationMs": 13070.790999999987,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13055.281999999997,
"heapDeltaBytes": -30589376,
"heapUsedBytes": 172515132,
"domNodes": -8335,
"jsHeapTotalBytes": -13045760,
"scriptDurationMs": 625.164,
"eventListeners": -16461,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 15210.528000000011,
"styleRecalcs": 73,
"styleRecalcDurationMs": 18.720000000000013,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15165.288,
"heapDeltaBytes": -62323756,
"heapUsedBytes": 153516312,
"domNodes": -8331,
"jsHeapTotalBytes": -2101248,
"scriptDurationMs": 985.158,
"eventListeners": -16492,
"totalBlockingTimeMs": 52,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 14930.44400000008,
"styleRecalcs": 72,
"styleRecalcDurationMs": 18.913000000000014,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14906.334,
"heapDeltaBytes": -50672748,
"heapUsedBytes": 159645412,
"domNodes": -8335,
"jsHeapTotalBytes": -5181440,
"scriptDurationMs": 980.443,
"eventListeners": -16456,
"totalBlockingTimeMs": 29,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 15219.978999999967,
"styleRecalcs": 72,
"styleRecalcDurationMs": 19.174000000000024,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15194.696,
"heapDeltaBytes": -46054108,
"heapUsedBytes": 162913044,
"domNodes": -8331,
"jsHeapTotalBytes": -5181440,
"scriptDurationMs": 939.2159999999999,
"eventListeners": -16486,
"totalBlockingTimeMs": 45,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "workflow-execution",
"durationMs": 143.3600000000297,
"styleRecalcs": 13,
"styleRecalcDurationMs": 23.384,
"layouts": 5,
"layoutDurationMs": 1.9200000000000004,
"taskDurationMs": 108.828,
"heapDeltaBytes": 3599476,
"heapUsedBytes": 54182096,
"domNodes": 152,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 23.947,
"eventListeners": 37,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "workflow-execution",
"durationMs": 464.0820000000758,
"styleRecalcs": 16,
"styleRecalcDurationMs": 24.406999999999996,
"layouts": 5,
"layoutDurationMs": 1.438,
"taskDurationMs": 135.99899999999997,
"heapDeltaBytes": 5125936,
"heapUsedBytes": 54978192,
"domNodes": 157,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 28.164,
"eventListeners": 69,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "workflow-execution",
"durationMs": 470.2149999999392,
"styleRecalcs": 16,
"styleRecalcDurationMs": 23.001,
"layouts": 5,
"layoutDurationMs": 1.4010000000000002,
"taskDurationMs": 127.18499999999999,
"heapDeltaBytes": 5044684,
"heapUsedBytes": 56234100,
"domNodes": 155,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 27.058,
"eventListeners": 69,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
}
]
} |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@browser_tests/assets/subgraphs/subgraph-multi-instance-promoted-text-values.json`:
- Line 11: The JSON test asset contains node "size" entries under
browser_tests/assets/subgraphs/subgraph-multi-instance-promoted-text-values.json
that are below the required minimum; update each "size" array currently set to
[210, 168] (and any other instances flagged, e.g., the ones at the other two
occurrences) to the minimum [400, 200] so E2E navigateIntoSubgraph timing is
stable; locate the "size" properties in the file (three occurrences reported)
and replace their values with [400, 200].
In `@src/components/builder/AppModeWidgetList.vue`:
- Around line 88-92: The matching logic in AppModeWidgetList.vue uses
widget.sourceNodeId and vueWidget.source.sourceNodeId directly, which misses
nested promoted sources; update the comparison to walk the vueWidget.source
chain to its deepest/disambiguated source (e.g., iterate while current.source
exists) and use that deepestSource.sourceNodeId and
deepestSource.sourceWidgetName for the equality checks inside the
isPromotedWidgetView branch (refer to isPromotedWidgetView, vueWidget.source and
widget.sourceNodeId/sourceWidgetName) so nested promotions resolve correctly.
In `@src/renderer/extensions/vueNodes/composables/useProcessedWidgets.ts`:
- Around line 255-258: The promotion lookup currently derives sourceBareId from
widget.source?.sourceNodeId, which misses nested/disambiguated promotions;
update the logic in useProcessedWidgets.ts to prefer
widget.source.disambiguatingSourceNodeId when present (falling back to
sourceNodeId or stripGraphPrefix(nodeId)) and use that value for
promotionSourceNodeId; apply the same change to the similar block around the
272-278 logic so any promotionTarget/promotion lookup uses
disambiguatingSourceNodeId first to ensure promoted border styles are correctly
detected.
🪄 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: CHILL
Plan: Pro
Run ID: 3a96c6fe-af3a-4444-92a6-318452c866ec
📒 Files selected for processing (16)
browser_tests/assets/subgraphs/subgraph-multi-instance-promoted-text-values.jsonbrowser_tests/tests/subgraph/subgraphMultiInstanceVueWidgets.spec.tsbrowser_tests/tests/subgraph/subgraphSerialization.spec.tssrc/components/builder/AppModeWidgetList.vuesrc/composables/graph/useGraphNodeManager.test.tssrc/composables/graph/useGraphNodeManager.tssrc/core/graph/subgraph/promotedWidgetTypes.tssrc/core/graph/subgraph/promotedWidgetView.test.tssrc/core/graph/subgraph/promotedWidgetView.tssrc/core/graph/subgraph/subgraphNodePromotion.test.tssrc/lib/litegraph/src/subgraph/SubgraphNode.multiInstance.test.tssrc/lib/litegraph/src/subgraph/SubgraphNode.tssrc/renderer/extensions/vueNodes/components/NodeWidgets.test.tssrc/renderer/extensions/vueNodes/composables/useProcessedWidgets.test.tssrc/renderer/extensions/vueNodes/composables/useProcessedWidgets.tssrc/stores/widgetValueStore.ts
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #11811 +/- ##
===========================================
- Coverage 71.63% 57.44% -14.19%
===========================================
Files 1493 1389 -104
Lines 84226 70804 -13422
Branches 22331 19756 -2575
===========================================
- Hits 60336 40676 -19660
- Misses 23026 29620 +6594
+ Partials 864 508 -356
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 990 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Amp-Thread-ID: https://ampcode.com/threads/T-019de5de-4b7c-708f-8bb8-10cd91287379 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/utils/litegraphUtil.ts (1)
362-367:⚠️ Potential issue | 🟠 Major | ⚡ Quick winNormalize legacy promoted node IDs before matching.
This fallback accepts a
NodeId, butsourceNodeIdis string-backed. With strict equality here, legacy saved tuples that carry a numeric node id never canonicalize to[host.id, promoted.storeName], so they stay in the old shape and won’t resolve correctly after reload. Coerce the incoming id once before the lookup, and add a regression case for numeric saved ids.Suggested fix
+ const legacySourceNodeId = String(nodeId) for (const node of graph.nodes) { if (typeof node.isSubgraphNode !== 'function' || !node.isSubgraphNode()) continue const widget = node.widgets?.find( (w) => isPromotedWidgetView(w) && w.sourceWidgetName === widgetName && - w.sourceNodeId === nodeId + w.sourceNodeId === legacySourceNodeId ) if (widget) return [node, widget] }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/utils/litegraphUtil.ts` around lines 362 - 367, The widget lookup fails for legacy numeric node ids because w.sourceNodeId is string-backed; before running the node.widgets?.find that compares w.sourceNodeId === nodeId, normalize nodeId to the canonical string form used in promoted widgets (coerce numbers to strings or map legacy numeric tuple to the same string representation) so the strict equality will match; update the lookup in litegraphUtil.ts (the find using isPromotedWidgetView, sourceWidgetName, sourceNodeId, widgetName, nodeId) and add a regression test that supplies a numeric saved id to ensure legacy numeric saved ids resolve correctly after reload.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/lib/litegraph/src/subgraph/SubgraphNode.multiInstance.test.ts`:
- Around line 431-449: The test currently only calls instance.serialize() and
verifies the serialized widget value is a Date, but never exercises the restore
path; update the test to actually round-trip by taking the serialized output
(out) and passing it back into the SubgraphNode restore/configure path (e.g.,
call instance.configure(out) or create a fresh subgraph node and call configure
on it with out), then assert the restored widget value (access
restoredInstance.widgets[0].value or similar) has a Date and matches the
original timestamp; ensure you reference the existing test helpers
createTestSubgraphNode and the SubgraphNode.configure() method so the replay
path is validated.
---
Outside diff comments:
In `@src/utils/litegraphUtil.ts`:
- Around line 362-367: The widget lookup fails for legacy numeric node ids
because w.sourceNodeId is string-backed; before running the node.widgets?.find
that compares w.sourceNodeId === nodeId, normalize nodeId to the canonical
string form used in promoted widgets (coerce numbers to strings or map legacy
numeric tuple to the same string representation) so the strict equality will
match; update the lookup in litegraphUtil.ts (the find using
isPromotedWidgetView, sourceWidgetName, sourceNodeId, widgetName, nodeId) and
add a regression test that supplies a numeric saved id to ensure legacy numeric
saved ids resolve correctly after reload.
🪄 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: CHILL
Plan: Pro
Run ID: b8a9c04b-c818-45ad-84ca-dea61d3a49b7
📒 Files selected for processing (10)
src/components/builder/AppBuilder.vuesrc/components/builder/AppModeWidgetList.vuesrc/core/graph/subgraph/promotedWidgetView.test.tssrc/core/graph/subgraph/promotedWidgetView.tssrc/lib/litegraph/src/subgraph/SubgraphNode.multiInstance.test.tssrc/lib/litegraph/src/subgraph/SubgraphNode.tssrc/stores/appModeStore.test.tssrc/stores/appModeStore.tssrc/utils/litegraphUtil.test.tssrc/utils/litegraphUtil.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/core/graph/subgraph/promotedWidgetView.ts
- src/lib/litegraph/src/subgraph/SubgraphNode.ts
Fixes three deterministic Playwright failures introduced by the subgraph-instance-store identity changes: - `useProcessedWidgets.getWidgetIdentity` no longer falls back to the host nodeId for ordinary widgets. Stable identity is reserved for promoted views (which carry their own `widget.nodeId`); ordinary widgets fall through to the transient `index`-based renderKey. Fixes Vue Widget Reactivity "Should display added widgets" where duplicate widget refs were being collapsed by the dedupe loop. - `computeProcessedWidgets` now falls back to the interior cell `(graphId, source.sourceNodeId, source.sourceWidgetName)` when the per-instance host cell is absent. Reads only — the per-instance write path is unchanged. Fixes the nested-subgraph promoted-widget values test where freshly-created promoted widgets rendered blank before pack. - `AppModeWidgetList` chains `rootGraph.onTrigger` to bump a `labelVersion` ref on `node:slot-label:changed`, so `mappedSelections` re-evaluates after a widget rename. The chained handler preserves `useGraphNodeManager`'s existing handler chain and is restored on scope dispose. - `PromotedWidgetView.label` setter now materializes the per-instance state cell when no subgraph slot is bound, instead of silently no-opping. The getter already falls back to `state?.label` when no slot is found, so renames on selected (non-IO) promoted widgets are now visible end-to-end. Fixes all four App-mode-widget-rename tests. Includes regression tests for the dedupe and promoted-value paths in `useProcessedWidgets.test.ts`, and updates the `PromotedWidgetView` label-setter test to lock in the new invariant. Amp-Thread-ID: https://ampcode.com/threads/T-019de643-67dc-77fe-ac05-2effc45a5b15 Co-authored-by: Amp <amp@ampcode.com>
…ched LGraphNode.clone() invokes configure() before the cloned node has a real id. The setter on PromotedWidgetView guards id === -1 (to avoid orphan cells in widgetValueStore), which silently dropped the replayed values. Stash widgets_values during configure() if id === -1; flush on onAdded(). Amp-Thread-ID: https://ampcode.com/threads/T-019de73b-91ac-76c8-8b10-99552857d285 Co-authored-by: Amp <amp@ampcode.com>
LGraph.trigger() now dispatches typed events on the existing graph.events CustomEventTarget in addition to calling the legacy onTrigger field, so consumers can subscribe without monkey-patching. Migrate AppModeWidgetList to useEventListener on graph.events for node:slot-label:changed, eliminating its rootGraph.onTrigger chain that was vulnerable to non-LIFO disposal corruption. Amp-Thread-ID: https://ampcode.com/threads/T-019de73b-91ac-76c8-8b10-99552857d285 Co-authored-by: Amp <amp@ampcode.com>
The typeof !== 'function' checks added in the prior promoted-widget fix mask non-existent failure modes — every caller passes a real LGraph/LGraphNode. Keep only the legitimate null-check that pairs with the widened nullable graph parameter. Amp-Thread-ID: https://ampcode.com/threads/T-019de73b-91ac-76c8-8b10-99552857d285 Co-authored-by: Amp <amp@ampcode.com>
storeName was JSON.stringify'd on every read; it's read inside the Vue render cycle. The fields composing it are readonly. Compute once in the constructor with a NUL separator that cannot legally appear in widget names and is visibly not JSON. Amp-Thread-ID: https://ampcode.com/threads/T-019de73b-91ac-76c8-8b10-99552857d285 Co-authored-by: Amp <amp@ampcode.com>
The promotion-store is the runtime source of truth after the recent fix; mutating this.properties.proxyWidgets in serialize() leaves a stale mirror nothing reads. Write the snapshot to the serialized output instead. Drop the dead [...existing] spread on widgets_values since SubgraphNode never sets serialize_widgets, so super.serialize() never produces it. Amp-Thread-ID: https://ampcode.com/threads/T-019de73b-91ac-76c8-8b10-99552857d285 Co-authored-by: Amp <amp@ampcode.com>
…trip Two SubgraphNode instances of the same definition share the same promoted-widget storeName but distinct host ids. Pin the contract that loadSelections preserves both as distinct entries through pruneLinearData + normalizeSelectedInput. Amp-Thread-ID: https://ampcode.com/threads/T-019de73b-91ac-76c8-8b10-99552857d285 Co-authored-by: Amp <amp@ampcode.com>
…idget" This reverts commit d6c9565.
… keys Three places in the codebase JSON.stringify arrays to build opaque composite Map/Set keys (favoritedWidgetsStore, SubgraphNode promotion view keys, promoted-widget storeName). Extract a shared helper. Reverts storeName from NUL-delimited back to JSON.stringify(array) for consistency with the established codebase pattern. Still computed once in the constructor. Amp-Thread-ID: https://ampcode.com/threads/T-019de73b-91ac-76c8-8b10-99552857d285 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/lib/litegraph/src/subgraph/SubgraphNode.multiInstance.test.ts (1)
475-494:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winThis still only verifies the serialize half of the Date round-trip.
The test name says “round-trips”, but it never feeds
outback throughconfigure(). A regression in the new replay path for object values would still pass here.Suggested follow-up
const out = instance.serialize() const cloned = out.widgets_values?.[0] as { when: Date } | undefined expect(cloned?.when).toBeInstanceOf(Date) expect(cloned?.when.getTime()).toBe(date.getTime()) + + const restored = createTestSubgraphNode(subgraph, { id: 902 }) + restored.configure({ + ...out, + id: 902, + type: subgraph.id + }) + + const restoredValue = restored.widgets[0].value as + | { when: Date } + | undefined + expect(restoredValue?.when).toBeInstanceOf(Date) + expect(restoredValue?.when.getTime()).toBe(date.getTime())🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/lib/litegraph/src/subgraph/SubgraphNode.multiInstance.test.ts` around lines 475 - 494, The test only calls serialize() but never applies the serialized data back to the node to verify the deserialize/configure path; update the test to take the output from instance.serialize() (out) and call instance.configure(out) (or the correct configure input shape) then assert that instance.widgets[0].value.when is a Date and has the same getTime() as the original date; reference the test helpers createTestSubgraphNode and methods serialize and configure and the instance.widgets array when making the changes so the test truly round-trips the Date through serialize -> configure.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/lib/litegraph/src/subgraph/SubgraphNode.ts`:
- Around line 1066-1072: The configure() handling must clear any previously
saved deferred widget replay when the new info has no widgets_values; update the
logic around SubgraphNode.configure so that if info.widgets_values is absent you
set this._pendingWidgetsValuesReplay = undefined (or empty) to avoid replaying
stale values later; keep the existing branch that calls
this._replayPromotedWidgetValues(info.widgets_values) when info.widgets_values
exists, and apply the same clearing change to the analogous block around lines
referencing the same pattern (the second occurrence near 1363-1368) so both code
paths reset _pendingWidgetsValuesReplay when widgets_values is omitted.
---
Duplicate comments:
In `@src/lib/litegraph/src/subgraph/SubgraphNode.multiInstance.test.ts`:
- Around line 475-494: The test only calls serialize() but never applies the
serialized data back to the node to verify the deserialize/configure path;
update the test to take the output from instance.serialize() (out) and call
instance.configure(out) (or the correct configure input shape) then assert that
instance.widgets[0].value.when is a Date and has the same getTime() as the
original date; reference the test helpers createTestSubgraphNode and methods
serialize and configure and the instance.widgets array when making the changes
so the test truly round-trips the Date through serialize -> configure.
🪄 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: CHILL
Plan: Pro
Run ID: fb108077-5964-4f8d-a9aa-3096536ab1e7
📒 Files selected for processing (13)
src/components/builder/AppModeWidgetList.vuesrc/core/graph/subgraph/promotedWidgetTypes.tssrc/core/graph/subgraph/promotedWidgetView.tssrc/core/graph/subgraph/subgraphNodePromotion.test.tssrc/lib/litegraph/src/LGraph.test.tssrc/lib/litegraph/src/LGraph.tssrc/lib/litegraph/src/infrastructure/LGraphEventMap.tssrc/lib/litegraph/src/subgraph/SubgraphNode.multiInstance.test.tssrc/lib/litegraph/src/subgraph/SubgraphNode.tssrc/stores/appModeStore.test.tssrc/stores/workspace/favoritedWidgetsStore.tssrc/utils/compositeKey.test.tssrc/utils/compositeKey.ts
✅ Files skipped from review due to trivial changes (1)
- src/utils/compositeKey.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/core/graph/subgraph/promotedWidgetTypes.ts
- src/core/graph/subgraph/subgraphNodePromotion.test.ts
- src/core/graph/subgraph/promotedWidgetView.ts
Amp-Thread-ID: https://ampcode.com/threads/T-019de7d5-b234-758d-9af5-04d5759c2a43 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019df068-e630-74a6-99f3-85ade098bad8 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019df068-e630-74a6-99f3-85ade098bad8 Co-authored-by: Amp <amp@ampcode.com>
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 `@src/core/graph/subgraph/promotedWidgetView.ts`:
- Around line 163-165: serializeValue currently returns this.value directly,
causing promoted widgets to skip the concrete widget's custom serialization;
update serializeValue(_node: LGraphNode, _index: number) in
promotedWidgetView.ts to resolve the underlying concrete widget instance (use
the same resolution logic as graphToPrompt/other proxy code), and if a concrete
widget provides its own serializeValue, delegate to
concreteWidget.serializeValue(_node, _index) and return that result, falling
back to this.value only if no concrete serializer exists. Ensure you reference
the serializeValue method on the resolved concrete widget and preserve the
original signature.
- Around line 200-204: The current branch in promotedWidgetView sets a label by
calling ensureInstanceState() which seeds the instance's value and causes future
interior updates to be blocked; instead modify the setter so it does not
materialize value: add a label-only path on the instance state (or a separate
boolean like hasValueOverride) and write the label there (e.g., create or use a
ensureLabelState()/labelOnly field) rather than calling ensureInstanceState().
Also update get value() and prompt serialization to respect hasValueOverride (or
the new label-only path) when deciding whether an explicit value override
exists. Ensure references to getWidgetState(), ensureInstanceState(), get
value(), and prompt serialization are updated accordingly so simple renames only
affect the label path and do not seed value.
🪄 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: CHILL
Plan: Pro
Run ID: d0f768ed-704a-43d5-981e-06d2cac01fab
📒 Files selected for processing (10)
src/core/graph/subgraph/promotedWidgetView.lazyInterior.test.tssrc/core/graph/subgraph/promotedWidgetView.test.tssrc/core/graph/subgraph/promotedWidgetView.tssrc/core/graph/subgraph/subgraphNodePromotion.test.tssrc/lib/litegraph/src/subgraph/SubgraphNode.multiInstance.test.tssrc/lib/litegraph/src/subgraph/SubgraphNode.tssrc/renderer/extensions/vueNodes/composables/useProcessedWidgets.test.tssrc/renderer/extensions/vueNodes/composables/useProcessedWidgets.tssrc/utils/executionUtil.test.tssrc/utils/executionUtil.ts
✅ Files skipped from review due to trivial changes (2)
- src/renderer/extensions/vueNodes/composables/useProcessedWidgets.ts
- src/lib/litegraph/src/subgraph/SubgraphNode.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/extensions/vueNodes/composables/useProcessedWidgets.test.ts
| serializeValue(_node: LGraphNode, _index: number): IBaseWidget['value'] { | ||
| return this.value | ||
| } |
There was a problem hiding this comment.
Preserve the concrete widget's custom serialization here.
serializeValue() now returns this.value unconditionally, so promoted widgets bypass any concrete-widget serializeValue logic during workflow save/reload. That makes promoted persistence diverge from both normal widget serialization and graphToPrompt(), which already proxies the override through the real serializer. Please delegate to the resolved concrete widget's serializer here as well.
🤖 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/core/graph/subgraph/promotedWidgetView.ts` around lines 163 - 165,
serializeValue currently returns this.value directly, causing promoted widgets
to skip the concrete widget's custom serialization; update serializeValue(_node:
LGraphNode, _index: number) in promotedWidgetView.ts to resolve the underlying
concrete widget instance (use the same resolution logic as graphToPrompt/other
proxy code), and if a concrete widget provides its own serializeValue, delegate
to concreteWidget.serializeValue(_node, _index) and return that result, falling
back to this.value only if no concrete serializer exists. Ensure you reference
the serializeValue method on the resolved concrete widget and preserve the
original signature.
| if (slot) { | ||
| const existing = this.getWidgetState() | ||
| if (existing) existing.label = value | ||
| } else { | ||
| this.ensureInstanceState().label = value |
There was a problem hiding this comment.
Label-only edits currently turn into sticky value overrides.
The unbound label path calls ensureInstanceState(), which seeds value from the current interior widget. After that, get value() and prompt serialization treat the row as an explicit value override, so a simple rename stops future interior value changes from flowing through for that instance. This needs a label-only state path, or a separate hasValueOverride signal, instead of materializing value here.
🤖 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/core/graph/subgraph/promotedWidgetView.ts` around lines 200 - 204, The
current branch in promotedWidgetView sets a label by calling
ensureInstanceState() which seeds the instance's value and causes future
interior updates to be blocked; instead modify the setter so it does not
materialize value: add a label-only path on the instance state (or a separate
boolean like hasValueOverride) and write the label there (e.g., create or use a
ensureLabelState()/labelOnly field) rather than calling ensureInstanceState().
Also update get value() and prompt serialization to respect hasValueOverride (or
the new label-only path) when deciding whether an explicit value override
exists. Ensure references to getWidgetState(), ensureInstanceState(), get
value(), and prompt serialization are updated accordingly so simple renames only
affect the label path and do not seed value.
Adds a Playwright spec that pins PR #11811 (commit 66c89c8): - Loads value-application.json fixture: outer SubgraphNode (id=4, widgets_values=["exterior"], proxyWidgets=[["2", "value"]]) over an interior PrimitiveNode (id=2, widgets_values=["interior"]) feeding PrimitiveStringMultiline (id=1) into PreviewAny (id=3). PrimitiveNode is the lazy-widget-creation case from src/extensions/core/widgetInputs.ts that triggered the original bug. - Test 1: Vue node UI for the SubgraphNode renders the promoted "value" textbox with "exterior", not "interior". Pins the load-time deferred replay in SubgraphNode.onAfterGraphConfigured against PrimitiveNode's onAfterGraphConfigured race. - Test 2: graphToPrompt's getExecutableWidgetValue ancestor walk picks up the per-instance override during prompt-build — the PrimitiveStringMultiline's `inputs.value` in the api prompt resolves to "exterior". - Test 3: editing the promoted textbox to "edited" propagates through PromotedWidgetView setter write-through; api prompt reflects "edited". - Test 4: reloading the workflow without saving resets the promoted widget back to the exterior override. Fixture under browser_tests/assets/subgraphs/, spec under browser_tests/tests/subgraph/, follows existing patterns from subgraphMultiInstanceVueWidgets.spec.ts and subgraphSerialization.spec.ts. Amp-Thread-ID: https://ampcode.com/threads/T-019df5d3-9cb4-72ed-892e-2e2eb28a6b52 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
browser_tests/tests/subgraph/promotedWidgetSparseOverride.spec.ts (1)
23-42: ⚡ Quick winTrim the large implementation-history comment block.
This block is highly detailed (including commit-specific internals), which is likely to drift. The test names/assertions already document intent well; prefer a short intent note or no comment here.
As per coding guidelines "Avoid new usage of code comments; do not add or retain redundant comments" and "Write code that is expressive and self-documenting to minimize need for code comments."
🤖 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 `@browser_tests/tests/subgraph/promotedWidgetSparseOverride.spec.ts` around lines 23 - 42, Remove the large implementation-history comment block at the top of the promoted-widget sparse-override regression test and replace it with a concise one-line intent or remove it entirely; specifically target the long explanatory block that begins "Regression test for PR `#11811` — promoted-widget sparse-override fix" and trim it to a short intent note like "Regression test for promoted-widget sparse-override (PR `#11811`)" while leaving the test code, names, and assertions (the spec for promotedWidgetSparseOverride) unchanged.
🤖 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.
Nitpick comments:
In `@browser_tests/tests/subgraph/promotedWidgetSparseOverride.spec.ts`:
- Around line 23-42: Remove the large implementation-history comment block at
the top of the promoted-widget sparse-override regression test and replace it
with a concise one-line intent or remove it entirely; specifically target the
long explanatory block that begins "Regression test for PR `#11811` —
promoted-widget sparse-override fix" and trim it to a short intent note like
"Regression test for promoted-widget sparse-override (PR `#11811`)" while leaving
the test code, names, and assertions (the spec for promotedWidgetSparseOverride)
unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ecf63b29-323d-4d14-99e0-2cd2aa1f3f10
📒 Files selected for processing (2)
browser_tests/assets/subgraphs/promoted-primitive-node-sparse-override.jsonbrowser_tests/tests/subgraph/promotedWidgetSparseOverride.spec.ts
✅ Files skipped from review due to trivial changes (1)
- browser_tests/assets/subgraphs/promoted-primitive-node-sparse-override.json
Co-authored-by: AustinMroz <austin@comfy.org>
Amp-Thread-ID: https://ampcode.com/threads/T-019df697-4700-72b8-9ef5-52f17aefb3c4 Co-authored-by: Amp <amp@ampcode.com>
pythongosssss
left a comment
There was a problem hiding this comment.
Pausing review, agree with a lot of Austins comments.
Based on discussion of removing linkless promotions that will simplify things e.g. potentially allow removal of disambiguatingSourceNodeId, colon encoding, legacy normalization
The comment by coderabbit on the label would also be fixed
… promoted widget values) (#11790) (#12098) *PR Created by the Glary-Bot Agent* --- ## Summary Backport of #11790 onto `cloud/1.43`. Reverts #10849 (per-instance promoted widget value storage) and its companion test-pinning PR #11697. **Why this is needed on `cloud/1.43`:** Glary-Bot's consolidated backport (#11926) cherry-picked #10849 into `cloud/1.43` on May 5 — four days *after* the same change was reverted on `main` in #11790. The audit didn't surface the upstream revert. As a result, `cloud/1.43` (1.43.16) currently ships the buggy #10849 implementation while `main` / nightly (1.45.1) doesn't. This is the cause of the Hub `rob_realistic_2k_images_quick_variations` model/vae/clip mixup regression reported in `#bug-dump`; the same template renders correctly on nightly. After this lands, `cloud/1.43` and `main` will be on the same code path for promoted-widget serialization. The replacement fix (#11811 with `_pendingWidgetsValuesReplay`) will land separately on `main` and can be backported afterward. ## Changes Mirrors the upstream revert of #10849 + #11697: - Removes `_instanceWidgetValues` map, `_pendingWidgetsValues` hydration, and the `widgets_values` write path in `SubgraphNode.serialize()` - Removes `sourceSerialize` field on `PromotedWidgetView` - Removes the multi-instance Vitest suite (`SubgraphNode.multiInstance.test.ts`) and the multi-instance E2E test + workflow asset ## Conflict Resolution Two conflicts surfaced (vs the original revert, which conflict-resolved against #11579 on `main`): 1. **`browser_tests/tests/subgraph/subgraphSerialization.spec.ts`** — `cloud/1.43` does not have the #11579 expanded test coverage (`Duplicate ID Remapping`, `Legacy Prefixed proxyWidget Normalization`) that the original revert preserved. Took the `cloud/1.43` HEAD structure and removed only the now-unreachable multi-instance test, its helper `getPromotedHostWidgetValues`, and the unused `ComfyPage` import. 2. **`src/lib/litegraph/src/subgraph/SubgraphNode.multiInstance.test.ts`** — `modify/delete` (file was present on `cloud/1.43`'s #10849 backport, deleted by the revert). Resolved by removing the file, matching the revert. ## Verification **Static analysis & tests:** - `pnpm typecheck` — clean - `pnpm typecheck:browser` — clean - `pnpm exec eslint` on all changed files — clean - `pnpm test:unit -- --run subgraph` — 506 tests passing across 34 suites (`SubgraphNode.test.ts`, `promotedWidgetView.test.ts`, `subgraphNodePromotion.test.ts`, etc.) **Manual verification (Playwright + local dev server):** - Started ComfyUI backend (`--cpu --port 8188`) and `pnpm dev` frontend; loaded the page successfully. - Loaded `subgraph-with-multiple-promoted-widgets.json` — subgraph node hydrated with 2 promoted widgets. - Set distinct values on each promoted widget (`first-promoted-value`, `second-promoted-value`), serialized via `app.graph.serialize()`, and reloaded via `app.loadGraphData(...)`. Both values round-tripped correctly to the right widget slots — confirming the revert restores the working single-instance path that nightly currently ships. - Hub-fetched template (`rob_realistic_2k_images_quick_variations`) could not be reproduced locally — `comfy.org/workflows/...` API returns 404 to anonymous curl from the sandbox, and the Hub UI flow needs auth wired up. The team has already confirmed this template renders correctly on nightly, which ships this same revert. ## Note on Oracle Review Oracle flagged the multi-instance regression and the cloud/1.43 forward-compat trade-off as "critical." These describe the *intended* behavior of this revert — the team has consciously chosen the legacy clobber path over #10849's broken per-instance code while the replacement (#11811) is finalized on `main`. Both findings are accepted trade-offs, not blockers. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-12098-backport-cloud-1-43-revert-roll-back-10849-11697-per-instance-promoted-widget-va-35b6d73d36508109a715fc9d3428a294) by [Unito](https://www.unito.io) Co-authored-by: Alexander Brown <drjkl@comfy.org>
…aft) (Comfy-Org#12228) Implements the AUDIT-LG verdicts (Comfy-Org#12223, Comfy-Org#12224, Comfy-Org#12225) as a single deletion PR off main. > **DRAFT — sequencing.** Per the AUDIT-LG framing doc, deletions land **after Phase B ECS migration** (Alex's Comfy-Org#11939 + Comfy-Org#11811). Open early to capture the diff and let CI cascade-flag any unused-export fallout. Flip to ready-for-review post-Alex-rebase. ## Status | commit | scope | status | |---|---|---| | 1 | Delete 6 LGraph stepping hooks (`onAfterStep`, `onBeforeStep`, `onPlayEvent`, `onStopEvent`, `onAfterExecute`, `onExecuteStep`) + their dispatch sites in `start()`/`stop()`/`runStep()` | ✅ landed (this commit) | | 2 | Delete the rest of the dead executor cluster (`start()`/`stop()`/`runStep()`/`sendEventToAllNodes()` + state fields + `STATUS_*` constants) | follow-up | | 3 | Delete `LGraphNode` dead event hooks (~22 fields per Comfy-Org#12224) | follow-up | | 4 | Delete trigger/action subsystem (~22 symbols, Comfy-Org#12223) | follow-up | | 5 | `ON_EVENT` deprecation cycle, release N (Comfy-Org#12225) | follow-up | ## Verification (commit 1) ``` $ pnpm lint && pnpm format:check && pnpm knip ✓ format: All matched files use the correct format ✓ lint: pre-existing icon-name warnings only ✓ knip: no new unused exports flagged ``` ## Verdicts the deletion is grounded in - AUDIT-LG.7 master verdict table (146 surfaces classified DELETE-NOW / DEPRECATE / KEEP) - AUDIT-LG.9 per-symbol attribution sweep (confirmed zero functional callers for the trigger cluster + the dead hooks) For each surface in this PR: - **`internal_count` from rg over `src/`, `browser_tests/`, `packages/` excluding `lib/litegraph/`:** 0 - **External use from touch-points DB:** 0 (per AUDIT-LG.3 + AUDIT-LG.9 per-symbol attribution) - **Host methods (`start()`/`stop()`/`runStep()`):** `@deprecated 'Will be removed in 0.9'` already The dispatch sites (`this.onAfterStep?.()` etc.) are inside the deprecated host methods — removing the dispatchers does not change observable behaviour because no listener is attached to begin with. ## Why batched, why draft Per AUDIT-LG framing, the deletion sequences behind Alex's PR Comfy-Org#11939 (ECS world-combo). Opening as draft lets CI run early and flags any unused-export cascades the audit script missed. Each follow-up commit will be its own atomic deletion (one feature per commit) so any single one can be reverted in isolation if needed. cc @DrJKL @christian-byrne ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-12228-refactor-litegraph-prune-dead-surfaces-AUDIT-LG-implementation-draft-35f6d73d365081e0b72cd292228e2ca6) by [Unito](https://www.unito.io) Co-authored-by: Connor Byrne <c.byrne@comfy.org>
…foreChange (#12230) Stacks on #12228. Part of the LGraph dead-hook cleanup per AUDIT-LG.9. ## What - `LGraph.onGetNodeMenuOptions` — **deleted** (field + dispatcher in `LGraphCanvas.getNodeMenuOptions`). Zero ecosystem consumers. - `LGraph.onBeforeChange` — **deprecated, not deleted**. The field and the dispatch in `LGraph.beforeChange()` are kept, but assigning a handler now emits a one-time `warnDeprecated` nudging migration to `LGraphCanvas.onBeforeChange`. ## Why onBeforeChange is preserved The W2F-1 re-audit found `bmad4ever/ComfyUI-Bmad-DirtyUndoRedo` assigns `app.graph.onBeforeChange = fn` (the listener-assignment pattern). Deleting the field outright would silently turn those handlers into no-ops. Keeping it as a deprecated shim preserves backward compatibility during a grace period while signaling the intended replacement. `onAfterChange` is untouched (so `BennyKok/comfyui-deploy`'s `onAfterChange` wrapper keeps working). `LGraphCanvas.onBeforeChange` remains a separate field, and the canvas dispatch chain `this.canvasAction((c) => c.onBeforeChange?.(this))` is unchanged. ## Tests `LGraph.test.ts` covers the shim: the assigned listener is still invoked, the deprecation warning fires when used, and no warning fires when no listener is assigned. ## Sequencing - Stacks on #12228 - Sequences behind Alex's Phase B (#11939, #11811) --------- Co-authored-by: Connor Byrne <c.byrne@comfy.org> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Alexander Brown <drjkl@comfy.org>
…foreChange (#12230) Stacks on #12228. Part of the LGraph dead-hook cleanup per AUDIT-LG.9. ## What - `LGraph.onGetNodeMenuOptions` — **deleted** (field + dispatcher in `LGraphCanvas.getNodeMenuOptions`). Zero ecosystem consumers. - `LGraph.onBeforeChange` — **deprecated, not deleted**. The field and the dispatch in `LGraph.beforeChange()` are kept, but assigning a handler now emits a one-time `warnDeprecated` nudging migration to `LGraphCanvas.onBeforeChange`. ## Why onBeforeChange is preserved The W2F-1 re-audit found `bmad4ever/ComfyUI-Bmad-DirtyUndoRedo` assigns `app.graph.onBeforeChange = fn` (the listener-assignment pattern). Deleting the field outright would silently turn those handlers into no-ops. Keeping it as a deprecated shim preserves backward compatibility during a grace period while signaling the intended replacement. `onAfterChange` is untouched (so `BennyKok/comfyui-deploy`'s `onAfterChange` wrapper keeps working). `LGraphCanvas.onBeforeChange` remains a separate field, and the canvas dispatch chain `this.canvasAction((c) => c.onBeforeChange?.(this))` is unchanged. ## Tests `LGraph.test.ts` covers the shim: the assigned listener is still invoked, the deprecation warning fires when used, and no warning fires when no listener is assigned. ## Sequencing - Stacks on #12228 - Sequences behind Alex's Phase B (#11939, #11811) --------- Co-authored-by: Connor Byrne <c.byrne@comfy.org> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Alexander Brown <drjkl@comfy.org>
…aft) (#12228) Implements the AUDIT-LG verdicts (#12223, #12224, #12225) as a single deletion PR off main. > **DRAFT — sequencing.** Per the AUDIT-LG framing doc, deletions land **after Phase B ECS migration** (Alex's #11939 + #11811). Open early to capture the diff and let CI cascade-flag any unused-export fallout. Flip to ready-for-review post-Alex-rebase. ## Status | commit | scope | status | |---|---|---| | 1 | Delete 6 LGraph stepping hooks (`onAfterStep`, `onBeforeStep`, `onPlayEvent`, `onStopEvent`, `onAfterExecute`, `onExecuteStep`) + their dispatch sites in `start()`/`stop()`/`runStep()` | ✅ landed (this commit) | | 2 | Delete the rest of the dead executor cluster (`start()`/`stop()`/`runStep()`/`sendEventToAllNodes()` + state fields + `STATUS_*` constants) | follow-up | | 3 | Delete `LGraphNode` dead event hooks (~22 fields per #12224) | follow-up | | 4 | Delete trigger/action subsystem (~22 symbols, #12223) | follow-up | | 5 | `ON_EVENT` deprecation cycle, release N (#12225) | follow-up | ## Verification (commit 1) ``` $ pnpm lint && pnpm format:check && pnpm knip ✓ format: All matched files use the correct format ✓ lint: pre-existing icon-name warnings only ✓ knip: no new unused exports flagged ``` ## Verdicts the deletion is grounded in - AUDIT-LG.7 master verdict table (146 surfaces classified DELETE-NOW / DEPRECATE / KEEP) - AUDIT-LG.9 per-symbol attribution sweep (confirmed zero functional callers for the trigger cluster + the dead hooks) For each surface in this PR: - **`internal_count` from rg over `src/`, `browser_tests/`, `packages/` excluding `lib/litegraph/`:** 0 - **External use from touch-points DB:** 0 (per AUDIT-LG.3 + AUDIT-LG.9 per-symbol attribution) - **Host methods (`start()`/`stop()`/`runStep()`):** `@deprecated 'Will be removed in 0.9'` already The dispatch sites (`this.onAfterStep?.()` etc.) are inside the deprecated host methods — removing the dispatchers does not change observable behaviour because no listener is attached to begin with. ## Why batched, why draft Per AUDIT-LG framing, the deletion sequences behind Alex's PR #11939 (ECS world-combo). Opening as draft lets CI run early and flags any unused-export cascades the audit script missed. Each follow-up commit will be its own atomic deletion (one feature per commit) so any single one can be reverted in isolation if needed. cc @DrJKL @christian-byrne ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-12228-refactor-litegraph-prune-dead-surfaces-AUDIT-LG-implementation-draft-35f6d73d365081e0b72cd292228e2ca6) by [Unito](https://www.unito.io) Co-authored-by: Connor Byrne <c.byrne@comfy.org>
…foreChange (#12230) Stacks on #12228. Part of the LGraph dead-hook cleanup per AUDIT-LG.9. ## What - `LGraph.onGetNodeMenuOptions` — **deleted** (field + dispatcher in `LGraphCanvas.getNodeMenuOptions`). Zero ecosystem consumers. - `LGraph.onBeforeChange` — **deprecated, not deleted**. The field and the dispatch in `LGraph.beforeChange()` are kept, but assigning a handler now emits a one-time `warnDeprecated` nudging migration to `LGraphCanvas.onBeforeChange`. ## Why onBeforeChange is preserved The W2F-1 re-audit found `bmad4ever/ComfyUI-Bmad-DirtyUndoRedo` assigns `app.graph.onBeforeChange = fn` (the listener-assignment pattern). Deleting the field outright would silently turn those handlers into no-ops. Keeping it as a deprecated shim preserves backward compatibility during a grace period while signaling the intended replacement. `onAfterChange` is untouched (so `BennyKok/comfyui-deploy`'s `onAfterChange` wrapper keeps working). `LGraphCanvas.onBeforeChange` remains a separate field, and the canvas dispatch chain `this.canvasAction((c) => c.onBeforeChange?.(this))` is unchanged. ## Tests `LGraph.test.ts` covers the shim: the assigned listener is still invoked, the deprecation warning fires when used, and no warning fires when no listener is assigned. ## Sequencing - Stacks on #12228 - Sequences behind Alex's Phase B (#11939, #11811) --------- Co-authored-by: Connor Byrne <c.byrne@comfy.org> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Alexander Brown <drjkl@comfy.org>
…aft) (#12228) Implements the AUDIT-LG verdicts (#12223, #12224, #12225) as a single deletion PR off main. > **DRAFT — sequencing.** Per the AUDIT-LG framing doc, deletions land **after Phase B ECS migration** (Alex's #11939 + #11811). Open early to capture the diff and let CI cascade-flag any unused-export fallout. Flip to ready-for-review post-Alex-rebase. ## Status | commit | scope | status | |---|---|---| | 1 | Delete 6 LGraph stepping hooks (`onAfterStep`, `onBeforeStep`, `onPlayEvent`, `onStopEvent`, `onAfterExecute`, `onExecuteStep`) + their dispatch sites in `start()`/`stop()`/`runStep()` | ✅ landed (this commit) | | 2 | Delete the rest of the dead executor cluster (`start()`/`stop()`/`runStep()`/`sendEventToAllNodes()` + state fields + `STATUS_*` constants) | follow-up | | 3 | Delete `LGraphNode` dead event hooks (~22 fields per #12224) | follow-up | | 4 | Delete trigger/action subsystem (~22 symbols, #12223) | follow-up | | 5 | `ON_EVENT` deprecation cycle, release N (#12225) | follow-up | ## Verification (commit 1) ``` $ pnpm lint && pnpm format:check && pnpm knip ✓ format: All matched files use the correct format ✓ lint: pre-existing icon-name warnings only ✓ knip: no new unused exports flagged ``` ## Verdicts the deletion is grounded in - AUDIT-LG.7 master verdict table (146 surfaces classified DELETE-NOW / DEPRECATE / KEEP) - AUDIT-LG.9 per-symbol attribution sweep (confirmed zero functional callers for the trigger cluster + the dead hooks) For each surface in this PR: - **`internal_count` from rg over `src/`, `browser_tests/`, `packages/` excluding `lib/litegraph/`:** 0 - **External use from touch-points DB:** 0 (per AUDIT-LG.3 + AUDIT-LG.9 per-symbol attribution) - **Host methods (`start()`/`stop()`/`runStep()`):** `@deprecated 'Will be removed in 0.9'` already The dispatch sites (`this.onAfterStep?.()` etc.) are inside the deprecated host methods — removing the dispatchers does not change observable behaviour because no listener is attached to begin with. ## Why batched, why draft Per AUDIT-LG framing, the deletion sequences behind Alex's PR #11939 (ECS world-combo). Opening as draft lets CI run early and flags any unused-export cascades the audit script missed. Each follow-up commit will be its own atomic deletion (one feature per commit) so any single one can be reverted in isolation if needed. cc @DrJKL @christian-byrne ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-12228-refactor-litegraph-prune-dead-surfaces-AUDIT-LG-implementation-draft-35f6d73d365081e0b72cd292228e2ca6) by [Unito](https://www.unito.io) Co-authored-by: Connor Byrne <c.byrne@comfy.org>
…foreChange (#12230) Stacks on #12228. Part of the LGraph dead-hook cleanup per AUDIT-LG.9. ## What - `LGraph.onGetNodeMenuOptions` — **deleted** (field + dispatcher in `LGraphCanvas.getNodeMenuOptions`). Zero ecosystem consumers. - `LGraph.onBeforeChange` — **deprecated, not deleted**. The field and the dispatch in `LGraph.beforeChange()` are kept, but assigning a handler now emits a one-time `warnDeprecated` nudging migration to `LGraphCanvas.onBeforeChange`. ## Why onBeforeChange is preserved The W2F-1 re-audit found `bmad4ever/ComfyUI-Bmad-DirtyUndoRedo` assigns `app.graph.onBeforeChange = fn` (the listener-assignment pattern). Deleting the field outright would silently turn those handlers into no-ops. Keeping it as a deprecated shim preserves backward compatibility during a grace period while signaling the intended replacement. `onAfterChange` is untouched (so `BennyKok/comfyui-deploy`'s `onAfterChange` wrapper keeps working). `LGraphCanvas.onBeforeChange` remains a separate field, and the canvas dispatch chain `this.canvasAction((c) => c.onBeforeChange?.(this))` is unchanged. ## Tests `LGraph.test.ts` covers the shim: the assigned listener is still invoked, the deprecation warning fires when used, and no warning fires when no listener is assigned. ## Sequencing - Stacks on #12228 - Sequences behind Alex's Phase B (#11939, #11811) --------- Co-authored-by: Connor Byrne <c.byrne@comfy.org> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Alexander Brown <drjkl@comfy.org>
Summary
Restore per-instance promoted widget state for subgraph instances so promoted values and labels survive save/reload without leaking across sibling instances, and align the
proxyWidgetssave format with the strict 2-tuple schema older clients enforce.Changes
useWidgetValueStorekeyed by(graphId, subgraphNode.id, view.storeName)wherestoreName = makeCompositeKey([sourceNodeId, sourceWidgetName, disambig ?? '']). Promoted views read/write the hostSubgraphNodecell instead of mutating shared interior widget state, splitting source identity from instance identity.SubgraphNode.configure()replayswidgets_valuesthrough promoted views;serialize()projects promoted-view values back intowidgets_values. Pre-attach configure (id === -1, the clone path) bufferswidgets_valuesinto_pendingWidgetsValuesReplay, drained inonAdded().src/utils/compositeKey.ts(makeCompositeKey) wrapsJSON.stringifyfor opaque collision-safe store keys.widgetValueStore.getOrRegisternow has register-wins semantics with no unsound generic cast.proxyWidgetssave format changed from[sourceNodeId, disambig, sourceWidgetName](3-tuple) to[sourceNodeId, "${sourceNodeId}: ${disambig}: ${sourceWidgetName}"](2-tuple with disambiguator encoded into the second slot)._internalConfigureAfterSlots()opportunistically rewrites legacy 3-tuples on load vialegacyProxyWidgetNormalization.ts.Flow
flowchart TD A[Workflow JSON load] --> B[SubgraphNode.configure(info)] B --> C{legacy 3-tuple in<br/>properties.proxyWidgets?} C -- yes --> D[legacyProxyWidgetNormalization<br/>rewrites to 2-tuple] C -- no --> E[super.configure(info)] D --> E E --> F[_internalConfigureAfterSlots<br/>rebind slots, init proxyWidgets,<br/>clear promoted view cache] F --> G{this.id === -1?<br/>(clone path)} G -- yes --> H[buffer info.widgets_values<br/>into _pendingWidgetsValuesReplay] G -- no --> I[_replayPromotedWidgetValues] H --> J[onAdded(): drain buffer] J --> I I --> K[view.value setter] K --> L[(useWidgetValueStore<br/>graphId / subgraphNode.id / view.storeName)] L --> M[SubgraphNode.serialize()] M --> N[project promoted-view values<br/>into widgets_values] M --> O[_serializeEntries → 2-tuple<br/>[sourceNodeId, encodedName]] N --> P[Workflow JSON save] O --> PReview Focus
proxyWidgetssave-format change is a backwards-compatibility FIX, not a regression. Verified againstComfy-Org/ComfyUI_frontend@v1.39.15src/core/schemas/proxyWidget.ts: the older client uses a strictz.array(z.tuple([z.string(), z.string()]))schema andparseProxyWidgetsTHROWS on any 3-element entry. The previous 3-tuple format therefore could not be loaded by v1.39.15 at all (workflow-load-time error inSubgraphNode.onConfigure). The new 2-tuple passes the older strict schema and round-trips cleanly throughlegacyProxyWidgetNormalization.tson this branch. The in-place rewrite in_internalConfigureAfterSlots()is a forward-only migration to a format older clients can read, not away from one.Sanity-check the promoted widget identity split (
instanceWidgetNamevs source identity) and the serialize/restore path for nested promoted widgets, especially aroundserialize === falsewidgets.Known minor: encoded 2-tuple format collides with widget names matching
\d+\s*:\s*(e.g. a widget literally named"5: noise_seed"with no disambig).normalizeLegacyProxyWidgetEntryresolves the literal name first before falling back, so the collision only manifests when the literal lookup fails. Documented inline.Review Follow-ups (commit
676a39218)String(undefined)guard inuseGraphNodeManager.tsso a fully-nullish chain staysundefinedinstead of becoming the literal"undefined".SubgraphNode.serializeno longer coercesnull→undefinedfor widget values.findBoundSubgraphSlotrefactored to a single pass: identity match returns immediately, source-identity match is captured as fallback.widgetValueStore.getOrRegistercast/generic cleanup; sole caller didn't need the generic.legacyProxyWidgetNormalizationregex-collision documented inline.useProcessedWidgets.test.tsSTORE_NAMEnow usesmakeCompositeKeyto exercise the real production key shape._pendingWidgetsValuesReplayJSDoc trimmed.Testing
pnpm vitest run src/composables/graph/useGraphNodeManager.test.ts src/core/graph/subgraph/promotedWidgetView.test.ts src/core/graph/subgraph/subgraphNodePromotion.test.ts src/lib/litegraph/src/subgraph/SubgraphNode.multiInstance.test.ts src/renderer/extensions/vueNodes/components/NodeWidgets.test.ts src/renderer/extensions/vueNodes/composables/useProcessedWidgets.test.tspnpm typecheckpnpm lint┆Issue is synchronized with this Notion page by Unito