Repository navigation
hotfix: custom nodes adding widgets on subgraph nodes - #14707
Conversation
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1791 passed, 0 failed📊 Browser Reports
📦 Bundle: 8.25 MB gzip 🔴 +179 BDetailsSummary
Category Glance App Entry Points — 3.64 kB (baseline 3.64 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.35 MB (baseline 1.35 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed / 1 unchanged Views & Navigation — 112 kB (baseline 112 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 13 added / 13 removed / 4 unchanged Panels & Settings — 551 kB (baseline 551 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 11 added / 11 removed / 15 unchanged User & Accounts — 27 kB (baseline 27 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 4 unchanged Editors & Dialogs — 124 kB (baseline 124 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 6 added / 6 removed / 1 unchanged UI Components — 70.8 kB (baseline 70.8 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed / 9 unchanged Data & Services — 3.47 MB (baseline 3.47 MB) • 🔴 +602 BStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 386 kB (baseline 386 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 16 added / 16 removed / 20 unchanged Vendor & Third-Party — 15.7 MB (baseline 15.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 16 unchanged Other — 12.8 MB (baseline 12.8 MB) • ⚪ 0 BBundles that do not match a named category
Status: 70 added / 70 removed / 211 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-04T21:42:48.302Z",
"gitSha": "bae865f906037c7a947fcaf0ab54c8d70844e34b",
"branch": "austin/custom-node-subgraph-widgets",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2058.785999999998,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.542,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 485.31100000000004,
"heapDeltaBytes": 5418504,
"heapUsedBytes": 69464200,
"domNodes": 20,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 17.419000000000004,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2037.889000000007,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.639000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 454.64700000000005,
"heapDeltaBytes": 5358412,
"heapUsedBytes": 69515928,
"domNodes": 20,
"jsHeapTotalBytes": 25427968,
"scriptDurationMs": 14.366,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1968.9559999999915,
"styleRecalcs": 76,
"styleRecalcDurationMs": 41.277,
"layouts": 12,
"layoutDurationMs": 3.715,
"taskDurationMs": 985.9769999999999,
"heapDeltaBytes": -13604044,
"heapUsedBytes": 50449868,
"domNodes": -281,
"jsHeapTotalBytes": 24621056,
"scriptDurationMs": 143.31899999999996,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1843.2849999999803,
"styleRecalcs": 76,
"styleRecalcDurationMs": 38.796,
"layouts": 12,
"layoutDurationMs": 3.38,
"taskDurationMs": 862.4,
"heapDeltaBytes": -17460784,
"heapUsedBytes": 46674952,
"domNodes": -281,
"jsHeapTotalBytes": 23834624,
"scriptDurationMs": 119.95,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1738.382999999999,
"styleRecalcs": 31,
"styleRecalcDurationMs": 16.406,
"layouts": 6,
"layoutDurationMs": 0.6569999999999999,
"taskDurationMs": 362.74600000000004,
"heapDeltaBytes": 8614728,
"heapUsedBytes": 72654980,
"domNodes": 77,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 16.868000000000002,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1677.5590000000875,
"styleRecalcs": 32,
"styleRecalcDurationMs": 15.741999999999999,
"layouts": 6,
"layoutDurationMs": 0.603,
"taskDurationMs": 370.672,
"heapDeltaBytes": 8365368,
"heapUsedBytes": 72451260,
"domNodes": 78,
"jsHeapTotalBytes": 24379392,
"scriptDurationMs": 17.963,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 578.5940000000096,
"styleRecalcs": 12,
"styleRecalcDurationMs": 7.526999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 365.557,
"heapDeltaBytes": -11047232,
"heapUsedBytes": 53062324,
"domNodes": 20,
"jsHeapTotalBytes": 25427968,
"scriptDurationMs": 59.38399999999999,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 605.4859999999849,
"styleRecalcs": 12,
"styleRecalcDurationMs": 8.855000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 383.43300000000005,
"heapDeltaBytes": -10886472,
"heapUsedBytes": 53027956,
"domNodes": 20,
"jsHeapTotalBytes": 25427968,
"scriptDurationMs": 58.13400000000001,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2067.1429999999873,
"styleRecalcs": 11,
"styleRecalcDurationMs": 9.814,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 684.213,
"heapDeltaBytes": 7355296,
"heapUsedBytes": 66665196,
"domNodes": -279,
"jsHeapTotalBytes": 3252224,
"scriptDurationMs": 103.75899999999999,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2054.369000000065,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.317,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 665.141,
"heapDeltaBytes": 7186864,
"heapUsedBytes": 66490076,
"domNodes": -281,
"jsHeapTotalBytes": 3252224,
"scriptDurationMs": 100.893,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2144.9610000000234,
"styleRecalcs": 69,
"styleRecalcDurationMs": 13.692,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1230.65,
"heapDeltaBytes": 3927980,
"heapUsedBytes": 64649444,
"domNodes": -283,
"jsHeapTotalBytes": 3444736,
"scriptDurationMs": 413.377,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2138.531999999941,
"styleRecalcs": 68,
"styleRecalcDurationMs": 12.623,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1232.003,
"heapDeltaBytes": 4711532,
"heapUsedBytes": 65204800,
"domNodes": -285,
"jsHeapTotalBytes": 3182592,
"scriptDurationMs": 413.25800000000004,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3146.10399999998,
"styleRecalcs": 66,
"styleRecalcDurationMs": 14.672,
"layouts": 60,
"layoutDurationMs": 7.062,
"taskDurationMs": 1465.619,
"heapDeltaBytes": -5611796,
"heapUsedBytes": 56492008,
"domNodes": -287,
"jsHeapTotalBytes": 5873664,
"scriptDurationMs": 513.726,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3198.2830000000604,
"styleRecalcs": 64,
"styleRecalcDurationMs": 13.039999999999996,
"layouts": 60,
"layoutDurationMs": 7.048,
"taskDurationMs": 1501.78,
"heapDeltaBytes": -4079884,
"heapUsedBytes": 58827364,
"domNodes": -291,
"jsHeapTotalBytes": 7184384,
"scriptDurationMs": 539.4830000000001,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2013.1039999999985,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.149,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 665.7280000000001,
"heapDeltaBytes": 6094844,
"heapUsedBytes": 66673420,
"domNodes": -283,
"jsHeapTotalBytes": 4825088,
"scriptDurationMs": 96.911,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "minimap-idle",
"durationMs": 2034.3159999999898,
"styleRecalcs": 7,
"styleRecalcDurationMs": 7.942000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 675.8109999999999,
"heapDeltaBytes": 6700504,
"heapUsedBytes": 68063408,
"domNodes": -286,
"jsHeapTotalBytes": 2727936,
"scriptDurationMs": 99.51299999999999,
"eventListeners": -177,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 565.6970000000001,
"styleRecalcs": 47,
"styleRecalcDurationMs": 10.315000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 382.781,
"heapDeltaBytes": -10393968,
"heapUsedBytes": 53757056,
"domNodes": 20,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 114.975,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 597.2550000000183,
"styleRecalcs": 47,
"styleRecalcDurationMs": 9.996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 402.79900000000004,
"heapDeltaBytes": -10776756,
"heapUsedBytes": 53308416,
"domNodes": 20,
"jsHeapTotalBytes": 26214400,
"scriptDurationMs": 117.98500000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2022.3330000000033,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.977999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 483.872,
"heapDeltaBytes": -17252344,
"heapUsedBytes": 46769768,
"domNodes": -281,
"jsHeapTotalBytes": 23834624,
"scriptDurationMs": 12.902,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2022.3269999999616,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.192000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 430.856,
"heapDeltaBytes": 5483692,
"heapUsedBytes": 69590412,
"domNodes": 20,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 11.635,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1715.5649999999696,
"styleRecalcs": 76,
"styleRecalcDurationMs": 32.782,
"layouts": 16,
"layoutDurationMs": 3.5570000000000004,
"taskDurationMs": 766.404,
"heapDeltaBytes": -17270152,
"heapUsedBytes": 46948840,
"domNodes": -280,
"jsHeapTotalBytes": 23834624,
"scriptDurationMs": 85.678,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1674.7520000000122,
"styleRecalcs": 75,
"styleRecalcDurationMs": 34.184999999999995,
"layouts": 16,
"layoutDurationMs": 4.522,
"taskDurationMs": 743.711,
"heapDeltaBytes": -4138528,
"heapUsedBytes": 59832116,
"domNodes": 60,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 88.338,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-transition-enter",
"durationMs": 1400.7910000000265,
"styleRecalcs": 17,
"styleRecalcDurationMs": 29.479000000000006,
"layouts": 13,
"layoutDurationMs": 12.393,
"taskDurationMs": 900.5010000000002,
"heapDeltaBytes": 32847376,
"heapUsedBytes": 99299312,
"domNodes": 13673,
"jsHeapTotalBytes": 13369344,
"scriptDurationMs": 34.38100000000001,
"eventListeners": 2375,
"totalBlockingTimeMs": 132,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8242.124999999987,
"styleRecalcs": 250,
"styleRecalcDurationMs": 35.617,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4305.813,
"heapDeltaBytes": 26952104,
"heapUsedBytes": 86370096,
"domNodes": -280,
"jsHeapTotalBytes": 5279744,
"scriptDurationMs": 1331.513,
"eventListeners": -163,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8328.949999999964,
"styleRecalcs": 249,
"styleRecalcDurationMs": 35.032000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4411.187,
"heapDeltaBytes": 14797524,
"heapUsedBytes": 74262492,
"domNodes": -282,
"jsHeapTotalBytes": 5541888,
"scriptDurationMs": 1375.6139999999998,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 16655.343000000015,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16630.734,
"heapDeltaBytes": -59531692,
"heapUsedBytes": 166429788,
"domNodes": -8313,
"jsHeapTotalBytes": -10690560,
"scriptDurationMs": 547.871,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17143.445999999927,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17128.111,
"heapDeltaBytes": -37661976,
"heapUsedBytes": 166721720,
"domNodes": -8312,
"jsHeapTotalBytes": -6496256,
"scriptDurationMs": 561.279,
"eventListeners": -16385,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.890000000000025,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20006.659000000014,
"styleRecalcs": 136,
"styleRecalcDurationMs": 14.872000000000025,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 19955.847,
"heapDeltaBytes": -35733260,
"heapUsedBytes": 169956556,
"domNodes": -8312,
"jsHeapTotalBytes": -8400896,
"scriptDurationMs": 902.451,
"eventListeners": -16383,
"totalBlockingTimeMs": 95,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20112.383000000023,
"styleRecalcs": 135,
"styleRecalcDurationMs": 15.856999999999955,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20087.983,
"heapDeltaBytes": -48643532,
"heapUsedBytes": 176689964,
"domNodes": -8312,
"jsHeapTotalBytes": -8925184,
"scriptDurationMs": 854.133,
"eventListeners": -16383,
"totalBlockingTimeMs": 161,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 460.3219999999624,
"styleRecalcs": 14,
"styleRecalcDurationMs": 18.265,
"layouts": 3,
"layoutDurationMs": 0.5569999999999999,
"taskDurationMs": 118.51199999999999,
"heapDeltaBytes": 5310780,
"heapUsedBytes": 68584752,
"domNodes": 134,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 9.704999999999998,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 452.0800000000236,
"styleRecalcs": 13,
"styleRecalcDurationMs": 17.558000000000003,
"layouts": 3,
"layoutDurationMs": 0.619,
"taskDurationMs": 105.858,
"heapDeltaBytes": 5076900,
"heapUsedBytes": 68139324,
"domNodes": 123,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 8.375,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
} |
📝 WalkthroughWalkthroughSubgraph nodes now support standalone custom widgets. Widget extraction uses the node’s complete widget collection. An end-to-end test verifies that a DOM widget remains registered and attached after subgraph conversion. ChangesSubgraph widget support
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant BrowserTest
participant SubgraphNode
participant GraphNodeManager
BrowserTest->>SubgraphNode: addDOMWidget
SubgraphNode->>SubgraphNode: register custom widget
GraphNodeManager->>SubgraphNode: read node.widgets
GraphNodeManager-->>BrowserTest: expose widget data
BrowserTest-->>BrowserTest: verify DOM attachment
Possibly related PRs
Suggested labels: Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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/lib/litegraph/src/subgraph/SubgraphNode.ts`:
- Around line 843-855: Update SubgraphNode.onRemoved() to call onRemove() for
every widget stored in _extraWidgets, then clear the collection so removed DOM
widgets are fully deregistered and not retained. Add a regression test covering
removal of a subgraph node with an extra custom widget.
- Around line 106-112: Ensure the `_extraWidgets` path has explicit persistence
semantics: either mark widgets added through `SubgraphNode.addCustomWidget()` as
runtime-only with `serialize: false`, or update `SubgraphNode.serialize()` to
persist their values in a stable order matching the `widgets` getter. Add a
save-and-reload test verifying the chosen behavior.
🪄 Autofix
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: 6d8a5d69-287c-4cf4-b685-f83f2ca3c100
📒 Files selected for processing (3)
browser_tests/tests/subgraph/subgraphPromotionDom.spec.tssrc/composables/graph/useGraphNodeManager.tssrc/lib/litegraph/src/subgraph/SubgraphNode.ts
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)
src/lib/litegraph/src/subgraph/SubgraphNode.ts (1)
843-854: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPreserve
addCustomWidget’s base return type.
LGraphNode.addCustomWidgetreturnsTPlainWidget | WidgetTypeMap[TPlainWidget['type']], whileSubgraphNode.addCustomWidgetnarrows it toTPlainWidgetand caststoConcreteWidget(...)back toTPlainWidget. Keep the concrete-conversion return type and returnwidgetwithout an assertion.🤖 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/subgraph/SubgraphNode.ts` around lines 843 - 854, Update SubgraphNode.addCustomWidget to preserve the base LGraphNode.addCustomWidget return type, including the concrete widget mapped by TPlainWidget["type"]. Remove the TPlainWidget return annotation and the final cast, and return the converted widget directly while leaving registration and node-binding behavior unchanged.Sources: Coding guidelines, Path instructions
🤖 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 `@src/lib/litegraph/src/subgraph/SubgraphNode.ts`:
- Around line 843-854: Update SubgraphNode.addCustomWidget to preserve the base
LGraphNode.addCustomWidget return type, including the concrete widget mapped by
TPlainWidget["type"]. Remove the TPlainWidget return annotation and the final
cast, and return the converted widget directly while leaving registration and
node-binding behavior unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0751f6e2-5801-481e-adb1-f36b4f131547
📒 Files selected for processing (1)
src/lib/litegraph/src/subgraph/SubgraphNode.ts
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #14707 +/- ##
==========================================
+ Coverage 78.15% 78.32% +0.16%
==========================================
Files 1777 1793 +16
Lines 106986 109025 +2039
Branches 33885 33479 -406
==========================================
+ Hits 83620 85396 +1776
- Misses 22893 23135 +242
- Partials 473 494 +21
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 99 files with indirect coverage changes 🚀 New features to boost your workflow:
|
| declare widgets: IBaseWidget[] | ||
|
|
||
| /** Widgets added programmatically (e.g. addDOMWidget) outside the promotion system. */ | ||
| private readonly _extraWidgets: IBaseWidget[] = [] |
There was a problem hiding this comment.
We will want to put this into a store very shortly.
There was a problem hiding this comment.
Even as a bug fix for a hot video model, I feel bad letting it through
| customWidget: TPlainWidget | ||
| ): TPlainWidget { | ||
| const widget = toConcreteWidget(customWidget, this, false) ?? customWidget | ||
| this._extraWidgets.push(widget) |
There was a problem hiding this comment.
Probably replacing the existing one if present.
There was a problem hiding this comment.
I lean sliiightly towards no? Since node.addCustomWidget doesn't dedupe, that'd cause inconsistent behaviour. We don't want to sometimes add safeguards that hide footguards
There was a problem hiding this comment.
The nature of the store keying dedupes.
There was a problem hiding this comment.
Calling addWidget('text', 'test','', () => {}) on a normal node adds multiple widgets that share state and dedupe on vue node display 😕
| widget.setNodeId(this.id) | ||
| } | ||
|
|
||
| return widget as TPlainWidget |
There was a problem hiding this comment.
Why do you need a type assertion here?
There was a problem hiding this comment.
Thanks. I am ashamed.
d89100f
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 (2)
src/lib/litegraph/src/subgraph/SubgraphNode.ts (2)
86-88: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy liftDocument the new subgraph widget contract in ADR-0009.
This change formalizes how standalone custom widgets coexist with promoted widgets on
SubgraphNode. It changes widget exposure, registration, removal, and persistence behavior. Add the context, decision, alternatives, consequences, and ADR index update before merge.As per path instructions, changes to subgraph promoted-widget behavior require an ADR update.
🤖 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/subgraph/SubgraphNode.ts` around lines 86 - 88, Update ADR-0009 to document the SubgraphNode widget contract represented by _extraWidgets, including coexistence with promoted widgets, widget exposure, registration, removal, and persistence behavior. Add the decision context, considered alternatives, consequences, and the corresponding ADR index entry; do not alter implementation behavior.Source: Path instructions
844-855: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winBind deferred extra widgets in
onAdded().When
addCustomWidget()runs before graph insertion,this.id === UNASSIGNED_NODE_ID, so Lines 851-853 skipwidget.setNodeId().SubgraphNode.onAdded()only invalidates views and does not bind_extraWidgets. A custom DOM widget can remain unregistered after the node enters the graph.Bind
_extraWidgetsinonAdded()or call the inherited binding logic. Add a regression test for add-before-insertion.As per path instructions, this extension-facing change must preserve the inherited custom-widget lifecycle contract; unassigned-node registration is deferred to
onAdded().Proposed fix
override onAdded(_graph: LGraph): void { + for (const widget of this._extraWidgets) { + if (isNodeBindable(widget)) widget.setNodeId(this.id) + } this.invalidatePromotedViews() }🤖 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/subgraph/SubgraphNode.ts` around lines 844 - 855, Update SubgraphNode.onAdded() to bind every deferred widget in _extraWidgets once the node has an assigned ID, preserving the inherited custom-widget lifecycle and existing view invalidation. Keep addCustomWidget()’s unassigned-node behavior unchanged, and add a regression test covering a widget added before graph insertion becoming registered after onAdded().Source: Path instructions
🤖 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 `@src/lib/litegraph/src/subgraph/SubgraphNode.ts`:
- Around line 86-88: Update ADR-0009 to document the SubgraphNode widget
contract represented by _extraWidgets, including coexistence with promoted
widgets, widget exposure, registration, removal, and persistence behavior. Add
the decision context, considered alternatives, consequences, and the
corresponding ADR index entry; do not alter implementation behavior.
- Around line 844-855: Update SubgraphNode.onAdded() to bind every deferred
widget in _extraWidgets once the node has an assigned ID, preserving the
inherited custom-widget lifecycle and existing view invalidation. Keep
addCustomWidget()’s unassigned-node behavior unchanged, and add a regression
test covering a widget added before graph insertion becoming registered after
onAdded().
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: bceb4677-a3e7-465d-aae8-616f109da8b0
📒 Files selected for processing (1)
src/lib/litegraph/src/subgraph/SubgraphNode.ts
|
|
||
| override addCustomWidget<TPlainWidget extends IBaseWidget>( | ||
| customWidget: TPlainWidget | ||
| ): TPlainWidget | WidgetTypeMap[TPlainWidget['type']] { |
There was a problem hiding this comment.
I don't love this return type
|
@AustinMroz Successfully backported to #14726 |
|
@AustinMroz Successfully backported to #14727 |
VHS directly adds sampling previews onto parent subgraphs (partially to merge lifecycle across multiple ksamplers in multi-stage workflows), but this conflicts with requiring that all widgets on a subgraphNode have associated promoted inputs.
This PR adds a minimal reproduction test, and a proposed fix. Of note, this change necessitates custom nodes go through the appropriate api methods and still disallows blindly muting
node.widgetsResolves Kosinkadink/ComfyUI-VideoHelperSuite#695