Repository navigation
feat(api): Comfy.Node.Resize command + NodeHandle.setSize (first slice of the stable resize API) - #13929
feat(api): Comfy.Node.Resize command + NodeHandle.setSize (first slice of the stable resize API)#13929christian-byrne wants to merge 9 commits into
Conversation
…e of the stable resize API)
Start the sanctioned, command-backed resize API that will replace the legacy
imperative idiom node.size[1] = h. Adds a Comfy.Node.Resize command that commits
through layoutStore with LayoutSource.External (so Vue nodes reflow), and a
minimal NodeHandle.setSize that dispatches it. autosize() and on('resize') are
typed not-yet-implemented stubs for follow-ups. Covered by unit + e2e tests.
🎭 Playwright: ❌ 1725 passed, 1 failed · 3 flaky❌ Failed Tests📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 8.08 MB gzip 🔴 +992 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.25 MB (baseline 1.25 MB) • 🔴 +2.91 kBGraph 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: 12 added / 12 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 — 29.1 kB (baseline 29.1 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 7 added / 7 removed / 3 unchanged Editors & Dialogs — 121 kB (baseline 121 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 5 added / 5 removed / 1 unchanged UI Components — 64.7 kB (baseline 64.7 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed / 8 unchanged Data & Services — 3.37 MB (baseline 3.37 MB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 357 kB (baseline 357 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 18 added / 18 removed / 17 unchanged Vendor & Third-Party — 15.7 MB (baseline 15.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 16 unchanged Other — 12.4 MB (baseline 12.4 MB) • 🟢 -292 BBundles that do not match a named category
Status: 75 added / 75 removed / 199 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-07-23T04:24:13.248Z",
"gitSha": "91a29d1c1a7b68183f42063e5fa62c5466991a2a",
"branch": "glary/stable-resize-api",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2054.766999999998,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.061,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 522.457,
"heapDeltaBytes": 3544860,
"heapUsedBytes": 70971460,
"domNodes": 20,
"jsHeapTotalBytes": 20324352,
"scriptDurationMs": 17.4,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2058.693000000005,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.080000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 464.041,
"heapDeltaBytes": 3573208,
"heapUsedBytes": 71010996,
"domNodes": 20,
"jsHeapTotalBytes": 21372928,
"scriptDurationMs": 15.571000000000002,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2002.5290000000098,
"styleRecalcs": 79,
"styleRecalcDurationMs": 52.091,
"layouts": 12,
"layoutDurationMs": 4.0569999999999995,
"taskDurationMs": 921.292,
"heapDeltaBytes": -1079700,
"heapUsedBytes": 66215604,
"domNodes": 61,
"jsHeapTotalBytes": 21110784,
"scriptDurationMs": 130.998,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1805.6430000000319,
"styleRecalcs": 72,
"styleRecalcDurationMs": 35.44,
"layouts": 12,
"layoutDurationMs": 3.4589999999999996,
"taskDurationMs": 818.4350000000001,
"heapDeltaBytes": -1684520,
"heapUsedBytes": 65814764,
"domNodes": 55,
"jsHeapTotalBytes": 21897216,
"scriptDurationMs": 118.05899999999998,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1757.0499999999925,
"styleRecalcs": 32,
"styleRecalcDurationMs": 17.554999999999996,
"layouts": 6,
"layoutDurationMs": 0.6000000000000001,
"taskDurationMs": 369.062,
"heapDeltaBytes": 7276396,
"heapUsedBytes": 74603376,
"domNodes": 78,
"jsHeapTotalBytes": 20324352,
"scriptDurationMs": 18.342999999999996,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1738.409000000047,
"styleRecalcs": 32,
"styleRecalcDurationMs": 16.224999999999998,
"layouts": 6,
"layoutDurationMs": 0.575,
"taskDurationMs": 352.51599999999996,
"heapDeltaBytes": 7102104,
"heapUsedBytes": 74588032,
"domNodes": 80,
"jsHeapTotalBytes": 21372928,
"scriptDurationMs": 17.509999999999998,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 595.6490000000088,
"styleRecalcs": 11,
"styleRecalcDurationMs": 6.626,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 359.48400000000004,
"heapDeltaBytes": -12110716,
"heapUsedBytes": 55522564,
"domNodes": 18,
"jsHeapTotalBytes": 20324352,
"scriptDurationMs": 56.05,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 593.4859999999844,
"styleRecalcs": 13,
"styleRecalcDurationMs": 11.298,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 388.82099999999997,
"heapDeltaBytes": -11956348,
"heapUsedBytes": 55676492,
"domNodes": 22,
"jsHeapTotalBytes": 20848640,
"scriptDurationMs": 58.980999999999995,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2037.146000000007,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.518999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 638.5110000000001,
"heapDeltaBytes": 6982096,
"heapUsedBytes": 66011392,
"domNodes": -265,
"jsHeapTotalBytes": 4268032,
"scriptDurationMs": 100.59599999999999,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2035.1389999999583,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.360999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 657.6329999999999,
"heapDeltaBytes": 6929668,
"heapUsedBytes": 67620456,
"domNodes": -265,
"jsHeapTotalBytes": 4005888,
"scriptDurationMs": 101.83599999999998,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2145.048000000031,
"styleRecalcs": 69,
"styleRecalcDurationMs": 13.824999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1213.306,
"heapDeltaBytes": 4686476,
"heapUsedBytes": 64784708,
"domNodes": -268,
"jsHeapTotalBytes": 4734976,
"scriptDurationMs": 415.14300000000003,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2195.1749999999493,
"styleRecalcs": 70,
"styleRecalcDurationMs": 15.299,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1274.575,
"heapDeltaBytes": 3749060,
"heapUsedBytes": 65477180,
"domNodes": -266,
"jsHeapTotalBytes": 4734976,
"scriptDurationMs": 435.14,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3193.65700000003,
"styleRecalcs": 65,
"styleRecalcDurationMs": 13.602,
"layouts": 60,
"layoutDurationMs": 6.95,
"taskDurationMs": 1480.1689999999999,
"heapDeltaBytes": -1395704,
"heapUsedBytes": 59829636,
"domNodes": -271,
"jsHeapTotalBytes": 7413760,
"scriptDurationMs": 523.226,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3267.6099999999906,
"styleRecalcs": 63,
"styleRecalcDurationMs": 12.730000000000002,
"layouts": 60,
"layoutDurationMs": 7.211,
"taskDurationMs": 1553.018,
"heapDeltaBytes": 1991676,
"heapUsedBytes": 63876484,
"domNodes": -276,
"jsHeapTotalBytes": 8986624,
"scriptDurationMs": 570.823,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2038.7549999999806,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.494000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 649.6170000000001,
"heapDeltaBytes": 6919132,
"heapUsedBytes": 68978076,
"domNodes": -267,
"jsHeapTotalBytes": 5316608,
"scriptDurationMs": 100.784,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "minimap-idle",
"durationMs": 2008.3339999999907,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.877000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 651.571,
"heapDeltaBytes": 5997740,
"heapUsedBytes": 66327424,
"domNodes": -269,
"jsHeapTotalBytes": 5054464,
"scriptDurationMs": 101.43900000000001,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 616.4539999999761,
"styleRecalcs": 47,
"styleRecalcDurationMs": 11.251000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 416.09499999999997,
"heapDeltaBytes": -11325872,
"heapUsedBytes": 56205388,
"domNodes": 20,
"jsHeapTotalBytes": 21897216,
"scriptDurationMs": 123.714,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 603.0179999999064,
"styleRecalcs": 48,
"styleRecalcDurationMs": 10.964,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 394.688,
"heapDeltaBytes": -11636716,
"heapUsedBytes": 56018144,
"domNodes": 22,
"jsHeapTotalBytes": 21635072,
"scriptDurationMs": 118.99399999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2010.041000000001,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.844999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 436.18100000000004,
"heapDeltaBytes": 3631948,
"heapUsedBytes": 71300244,
"domNodes": 20,
"jsHeapTotalBytes": 20324352,
"scriptDurationMs": 12.335,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2005.2949999999896,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.283999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 473.52700000000004,
"heapDeltaBytes": -21962320,
"heapUsedBytes": 45667692,
"domNodes": 20,
"jsHeapTotalBytes": 20975616,
"scriptDurationMs": 12.462,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1695.0839999999516,
"styleRecalcs": 75,
"styleRecalcDurationMs": 31.497999999999998,
"layouts": 16,
"layoutDurationMs": 4.155,
"taskDurationMs": 717.746,
"heapDeltaBytes": -5515824,
"heapUsedBytes": 62024600,
"domNodes": 60,
"jsHeapTotalBytes": 21110784,
"scriptDurationMs": 85.177,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1691.5070000000014,
"styleRecalcs": 75,
"styleRecalcDurationMs": 34.6,
"layouts": 16,
"layoutDurationMs": 4.232,
"taskDurationMs": 721.6909999999999,
"heapDeltaBytes": -5659784,
"heapUsedBytes": 61809024,
"domNodes": 61,
"jsHeapTotalBytes": 21372928,
"scriptDurationMs": 87.368,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1351.4079999999922,
"styleRecalcs": 18,
"styleRecalcDurationMs": 29.839000000000006,
"layouts": 14,
"layoutDurationMs": 12.201,
"taskDurationMs": 923.2660000000002,
"heapDeltaBytes": 29422216,
"heapUsedBytes": 97229376,
"domNodes": 13673,
"jsHeapTotalBytes": 14155776,
"scriptDurationMs": 32.32199999999999,
"eventListeners": 2371,
"totalBlockingTimeMs": 128,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8190.7120000000195,
"styleRecalcs": 249,
"styleRecalcDurationMs": 34.382000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4269.727000000001,
"heapDeltaBytes": 10327624,
"heapUsedBytes": 69210468,
"domNodes": -268,
"jsHeapTotalBytes": 6832128,
"scriptDurationMs": 1354.647,
"eventListeners": -113,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8236.540999999988,
"styleRecalcs": 249,
"styleRecalcDurationMs": 35.97,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4328.39,
"heapDeltaBytes": 10475196,
"heapUsedBytes": 69545220,
"domNodes": -268,
"jsHeapTotalBytes": 7589888,
"scriptDurationMs": 1359.5230000000001,
"eventListeners": -113,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 16033.141999999998,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15994.733999999999,
"heapDeltaBytes": -54566112,
"heapUsedBytes": 166182232,
"domNodes": -8311,
"jsHeapTotalBytes": -12259328,
"scriptDurationMs": 507.36400000000003,
"eventListeners": -16384,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 16521.746000000006,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16487.475,
"heapDeltaBytes": -61321332,
"heapUsedBytes": 166753600,
"domNodes": -8311,
"jsHeapTotalBytes": -13307904,
"scriptDurationMs": 524.1909999999999,
"eventListeners": -16380,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 19965.81100000003,
"styleRecalcs": 134,
"styleRecalcDurationMs": 14.84599999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 19943.555,
"heapDeltaBytes": -32727660,
"heapUsedBytes": 176387064,
"domNodes": -8311,
"jsHeapTotalBytes": -14966784,
"scriptDurationMs": 873.623,
"eventListeners": -16378,
"totalBlockingTimeMs": 139,
"frameDurationMs": 18.329999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20039.588000000094,
"styleRecalcs": 139,
"styleRecalcDurationMs": 15.254000000000046,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20018.047,
"heapDeltaBytes": -44738332,
"heapUsedBytes": 156179712,
"domNodes": -8311,
"jsHeapTotalBytes": -14880768,
"scriptDurationMs": 822.8530000000001,
"eventListeners": -16378,
"totalBlockingTimeMs": 137,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 454.45399999999836,
"styleRecalcs": 13,
"styleRecalcDurationMs": 17.881,
"layouts": 2,
"layoutDurationMs": 0.3799999999999999,
"taskDurationMs": 110.91,
"heapDeltaBytes": -15762940,
"heapUsedBytes": 50862332,
"domNodes": 130,
"jsHeapTotalBytes": 7741440,
"scriptDurationMs": 8.902000000000003,
"eventListeners": 67,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 464.8580000000493,
"styleRecalcs": 15,
"styleRecalcDurationMs": 19.733,
"layouts": 3,
"layoutDurationMs": 0.6389999999999999,
"taskDurationMs": 113.80399999999999,
"heapDeltaBytes": -16209204,
"heapUsedBytes": 50522712,
"domNodes": 121,
"jsHeapTotalBytes": 8003584,
"scriptDurationMs": 10.241999999999999,
"eventListeners": 65,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
|
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:
📝 WalkthroughWalkthroughAdds a public Vue node extension API with filtered ChangesStable Node Resize API
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GraphView
participant ExtensionAPI
participant App
participant NodeHandle
participant LayoutStore
GraphView->>ExtensionAPI: installExtensionApi()
ExtensionAPI->>App: register defineNodeExtension
App->>NodeHandle: invoke nodeCreated
NodeHandle->>LayoutStore: resizeNode([400, 1000], External)
LayoutStore-->>GraphView: update rendered node size
Possibly related issues
Suggested labels: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/composables/useCoreCommands.test.ts`:
- Around line 455-474: Await both invocations of the Comfy.Node.Resize command
in the resize and no-op tests, and mark the no-op test async so its assertion
runs after command completion while satisfying no-floating-promises.
In `@src/composables/useCoreCommands.ts`:
- Around line 720-730: Update the resize validation in the command handling flow
around mutations.setSource and mutations.resizeNode to reject non-finite width
or height values using a finite-number check. Perform this validation before
setting the external layout source or applying the resize, and add coverage for
NaN and positive/negative Infinity inputs.
In `@src/renderer/extensions/nodeApi/nodeHandle.ts`:
- Around line 61-65: The unimplemented NodeHandle.autosize method currently
throws synchronously despite its Promise<void> contract. In
src/renderer/extensions/nodeApi/nodeHandle.ts:61-65, declare autosize as async
so the existing error becomes a rejected promise; in
src/renderer/extensions/nodeApi/nodeHandle.test.ts:37-41, make the test async
and assert the rejection with await expect(...).rejects.toThrow(...).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 9435f51c-5c20-40c1-95ad-baf653e60c0a
📒 Files selected for processing (6)
browser_tests/tests/vueNodes/nodeApiResize.spec.tssrc/composables/useCoreCommands.test.tssrc/composables/useCoreCommands.tssrc/renderer/extensions/nodeApi/nodeHandle.test.tssrc/renderer/extensions/nodeApi/nodeHandle.tssrc/views/GraphView.vue
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/composables/useCoreCommands.test.ts`:
- Around line 469-472: Extend the “is a no-op when required metadata is missing”
test around findCommand('Comfy.Node.Resize') with representative invalid nodeId,
width, and height type cases in addition to omitted fields. For each case,
assert the node size and mutation source remain unchanged, preserving the no-op
behavior for both missing and invalid resize metadata.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 2e6b5b2b-ef98-45ef-93ed-a8bd03d4e1da
📒 Files selected for processing (1)
src/composables/useCoreCommands.test.ts
…eject async Addresses CodeRabbit review on #13929: - Comfy.Node.Resize now ignores NaN/Infinity width/height. - autosize() is async so its unimplemented state rejects, honoring its Promise contract.
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/composables/useCoreCommands.ts (1)
712-715: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winLocalize the new command label.
'Resize Node'is a user-facing command string and should usevue-i18n, with the translation added tosrc/locales/en/main.json.Proposed fix
- label: 'Resize Node', + label: () => t('commands.resizeNode'),As per coding guidelines, all user-facing strings in
src/**/*.{js,ts,vue}must usevue-i18n.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/composables/useCoreCommands.ts` around lines 712 - 715, Update the command definition containing id 'Comfy.Node.Resize' to use the existing vue-i18n translation mechanism instead of the hardcoded label 'Resize Node'. Add the corresponding English translation key and value to main.json, following the surrounding command-label naming conventions.Source: Coding guidelines
🤖 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/composables/useCoreCommands.test.ts`:
- Around line 477-487: Update the “is a no-op for non-finite dimensions” test
for Comfy.Node.Resize to exercise NaN width and infinite height in separate
calls, ensuring each dimension is independently rejected. For each call, assert
the complete relevant layout state—including its source or equivalent
metadata—remains unchanged, rather than checking only size.
---
Outside diff comments:
In `@src/composables/useCoreCommands.ts`:
- Around line 712-715: Update the command definition containing id
'Comfy.Node.Resize' to use the existing vue-i18n translation mechanism instead
of the hardcoded label 'Resize Node'. Add the corresponding English translation
key and value to main.json, following the surrounding command-label naming
conventions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 43e50c0a-c755-4ced-b8f2-55adfbf83d29
📒 Files selected for processing (4)
src/composables/useCoreCommands.test.tssrc/composables/useCoreCommands.tssrc/renderer/extensions/nodeApi/nodeHandle.test.tssrc/renderer/extensions/nodeApi/nodeHandle.ts
Cover missing + invalid + non-finite dims independently and assert the layout source is unchanged. Addresses CodeRabbit review on #13929.
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #13929 +/- ##
==========================================
- Coverage 78.78% 78.14% -0.64%
==========================================
Files 1690 1698 +8
Lines 109951 101625 -8326
Branches 39172 36855 -2317
==========================================
- Hits 86624 79415 -7209
+ Misses 22734 21744 -990
+ Partials 593 466 -127
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 209 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Rework the stable-resize slice to match the intended v2 extension-api design (ecosystem decisions D3.3/D3.4/D6/D11 + PR #13867 seam): - Handle delivery, not global lookup: replace window.comfyNodeApi.getNode(id) with defineNodeExtension({ nodeCreated(node) }); the NodeHandle is delivered per-node via the extension lifecycle, never fetched by id. - Command pattern kept internal (D3.4): NodeHandle.setSize routes directly through the layout executor (useLayoutMutations, LayoutSource.External). Remove the user-facing Comfy.Node.Resize palette command + commandStore round-trip. - setSize(size: Size) takes a single [w, h] tuple per the NodeHandle contract (P1/D3.3), not (width, height). - Move surface to the sanctioned src/extension-api/ package barrel. autosize()/on('resize') remain typed not-yet-implemented stubs (A2/A3). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/extension-api/node.ts`:
- Around line 69-74: Update setSize in the node API to preserve the current
layout source before calling mutations.setSource(LayoutSource.External), then
restore that original source immediately after mutations.resizeNode. Ensure
restoration occurs for every resize attempt so subsequent mutations retain their
prior source.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d5bb2e17-5bce-49cd-8c70-2f1dca74e34e
📒 Files selected for processing (8)
browser_tests/tests/vueNodes/nodeApiResize.spec.tsknip.config.tssrc/extension-api/index.test.tssrc/extension-api/index.tssrc/extension-api/node.test.tssrc/extension-api/node.tssrc/extension-api/types.tssrc/views/GraphView.vue
setSize tagged the resize LayoutSource.External but left currentSource — shared store state that resizeNode reads directly — set to External, so every later mutation on the same store was mislabeled. Save the prior source and restore it in a finally, mirroring the save/restore pattern in layoutStore.batchUpdateNodeBounds. The resize operation itself is still tagged External. Test now subscribes via onNodeChange to assert the resize op carries the External source while getCurrentSource() is restored to its prior value. Addresses CodeRabbit review comment on PR #13929. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/extension-api/node.ts`:
- Around line 69-70: Update setSize in src/extension-api/node.ts:69-70 to throw
an actionable RangeError when either width or height is non-finite instead of
returning silently. Update the invalid-dimension tests in
src/extension-api/node.test.ts:62-76 to assert the RangeError and its actionable
message for each invalid dimension.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 91911fb4-48fd-4af1-8d02-ed4d164dbe4d
📒 Files selected for processing (8)
browser_tests/tests/vueNodes/nodeApiResize.spec.tsknip.config.tssrc/extension-api/index.test.tssrc/extension-api/index.tssrc/extension-api/node.test.tssrc/extension-api/node.tssrc/extension-api/types.tssrc/views/GraphView.vue
`nodeCreated` runs synchronously during node construction, before the node is registered in the layout store (graph load defers layout creation to onAfterGraphConfigured). `resizeNode` no-ops without a layout entry, so a setSize call from nodeCreated was silently dropped and the Vue node kept its seeded height — failing the nodeApiResize e2e. setSize now applies immediately when the layout entry is present, otherwise watches for the entry to appear and applies the resize once, still routed through the layout store command. Adds a deferred-path regression unit test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/extension-api/node.test.ts`:
- Around line 64-98: Extend the deferred resize test around createNodeHandle and
the later mutations.createNode call to capture the layoutStore current source
before registration and assert it is restored after the watcher applies the
pending resize, matching the immediate-path setSize test while preserving the
existing size assertion.
In `@src/extension-api/node.ts`:
- Around line 71-74: Update setSize in src/extension-api/node.ts:71-74 to return
early when width or height is non-finite or non-positive, including width <= 0
or height <= 0. In src/extension-api/node.test.ts:100-114, add parameterized
cases covering zero width and negative height, asserting the same no-op behavior
as existing invalid-dimension cases.
- Around line 90-107: Ensure the pending watcher created in the resizeNode flow
is stopped when the node or graph handle is discarded, not only when layout
becomes available. Retain the stop handle from watch and register it with the
existing node teardown/cleanup mechanism, while preserving the current one-time
applyResize behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 00bfb521-b817-426d-aba7-ae18c63b814e
📒 Files selected for processing (2)
src/extension-api/node.test.tssrc/extension-api/node.ts
expect.poll takes a function; passing the fixture method reference directly (resized.pollHeight) is the only such call in the suite and surfaced a nondeterministic "accepts only function" failure. Wrap it as () => resized.pollHeight() to match the convention used everywhere else and re-read the height on each poll iteration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ce restore Address review: extend the setSize guard to also no-op on zero/negative width or height (an invalid node size), with parametrized test cases. Assert the shared layout source is restored after the deferred (watcher) path too, matching the synchronous path's coverage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
…ments, cut spec-mechanics tests, hoist mutations) (Comfy-Org#14025) ## Summary Follow-up to the merged Comfy-Org#13867 (runtime size-Proxy reflow) addressing DrJKL's post-merge review: trim speculative comments, cut change-detector tests, and hoist a per-call allocation. ## Changes - **What**: - `LGraphNode.ts` — trim the `TODO(litegraph-stable-resize-api)` block (~9 lines enumerating a not-yet-existing `Comfy.Node.Resize` / `NodeHandle` API, drafted in Comfy-Org#13929) to a one-line intent pointer; hoist `useLayoutMutations()` to module scope (it captures only the `layoutStore` singleton) and reuse it in `set pos` and `_sizeUpdated`. - `nodeSizeReflow.test.ts` — cut five change-detector tests that assert ECMAScript TypedArray/Proxy spec mechanics (typed-array semantics, buffer contract, cached-Proxy identity, sibling `pos` subarray, fluent-mutator chain). Keep the behavioral cases: single commit per grow, per-axis sequential writes, whole-array assign, no-feedback-loop guard, in-place `.set()`, detached no-commit, and serialize-no-leak. - `useLayoutSync.ts` — collapse a 3-line justification comment to one line. - `tools/devtools/web/runtimeReflow.js` — drop the dead `Math.max(..., 200)` (start height + 120 already exceeds 200). - **Breaking**: None. No production behavior change; the size-Proxy runtime semantics are unchanged. ## Review Focus - The hoisted module-scope `layoutMutations` is safe because `useLayoutMutations()` closes over only the `layoutStore` module singleton (verified in `layoutMutations.ts`). - The `double as unknown as` at the `page.evaluate` boundary in `runtimeReflow.ts` is left as-is per DrJKL's note (acceptable last-resort interop assertion). Follow-up to Comfy-Org#13867. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ments, cut spec-mechanics tests, hoist mutations) (#14025) ## Summary Follow-up to the merged #13867 (runtime size-Proxy reflow) addressing DrJKL's post-merge review: trim speculative comments, cut change-detector tests, and hoist a per-call allocation. ## Changes - **What**: - `LGraphNode.ts` — trim the `TODO(litegraph-stable-resize-api)` block (~9 lines enumerating a not-yet-existing `Comfy.Node.Resize` / `NodeHandle` API, drafted in #13929) to a one-line intent pointer; hoist `useLayoutMutations()` to module scope (it captures only the `layoutStore` singleton) and reuse it in `set pos` and `_sizeUpdated`. - `nodeSizeReflow.test.ts` — cut five change-detector tests that assert ECMAScript TypedArray/Proxy spec mechanics (typed-array semantics, buffer contract, cached-Proxy identity, sibling `pos` subarray, fluent-mutator chain). Keep the behavioral cases: single commit per grow, per-axis sequential writes, whole-array assign, no-feedback-loop guard, in-place `.set()`, detached no-commit, and serialize-no-leak. - `useLayoutSync.ts` — collapse a 3-line justification comment to one line. - `tools/devtools/web/runtimeReflow.js` — drop the dead `Math.max(..., 200)` (start height + 120 already exceeds 200). - **Breaking**: None. No production behavior change; the size-Proxy runtime semantics are unchanged. ## Review Focus - The hoisted module-scope `layoutMutations` is safe because `useLayoutMutations()` closes over only the `layoutStore` module singleton (verified in `layoutMutations.ts`). - The `double as unknown as` at the `page.evaluate` boundary in `runtimeReflow.ts` is left as-is per DrJKL's note (acceptable last-resort interop assertion). Follow-up to #13867. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thank you for developing and testing this first stable resize API slice, and for working through the review feedback in detail. The compatibility path landed through #13867 and #14025, while the public NodeHandle and extension interface have moved into the active #12142 through #12145 Extension API v2 stack alongside substantial layout and ECS refactors. If |
Summary
First tested slice of the stable resize API — the sanctioned, command-backed replacement for the decade-old imperative idiom
node.size[1] = h. Reworked to match the intended v2 extension-api design (see divergences below).This is the "destination" track for the runtime
sizeProxy in #13867: that Proxy is the deprecation on-ramp keeping unmigrated custom nodes working; this API is where new/migrated code goes. #13867'sTODO(litegraph-stable-resize-api)names this exact end-state — "aComfy.Node.Resizecommand +NodeHandle.setSize()/autosize()/on('resize')(v2 extension handles)."Deliberately minimal — a demonstrative first slice, not the whole API.
What this adds
src/extension-api/— the sanctioned v2 surface (@comfyorg/extension-apibarrel), with:defineNodeExtension({ name, nodeTypes?, nodeCreated })— the module-level entry point (D6/D11). TheNodeHandleis delivered tonodeCreated(node)per node instance; it is never fetched by id from a global.NodeHandle—getSize()/setSize(size: Size)whereSizeis a[width, height]tuple (P1/D3.3).setSizecommits throughuseLayoutMutations().resizeNodewithLayoutSource.External, so the mutation is a serializable layout command (ADR-0003/0008) and Vue nodes reflow via--node-height.autosize()/on('resize')— typed not-yet-implemented stubs that throw, referencing follow-ups A2/A3.window.comfyExtensionApi.defineNodeExtension(the registration entry, reachable while the npm package is unpublished — handles still arrive vianodeCreated).How this reworks the previous draft
Per review feedback (the API + command pattern were misunderstood), aligned against the ecosystem design decisions and #13867:
window.comfyNodeApi.getNode(id)defineNodeExtension({ nodeCreated(node) })lifecycle (D3.3/D6/D11)NodeHandle.setSize(width, height)(two args)setSize(size: Size)— a single[w, h]tuple (P1/D3.3 NodeHandle contract)Comfy.Node.Resizeregistered as a user-facing palette command; handle dispatched it viacommandStore.execute(...)setSizeroutes straight to the layout executor — no palette command, no string round-tripsrc/renderer/extensions/nodeApi/src/extension-api/package barrelTests
node.test.ts:setSizeresizes the node inlayoutStorewithLayoutSource.External,getSizereads it back as a tuple, non-finite dims no-op, stubs throw.index.test.ts:defineNodeExtensionregisters viaapp.registerExtension, delivers aNodeHandle(not the rawLGraphNode) tonodeCreated, and honors thenodeTypesfilter.nodeApiResize.spec.ts(@vue-nodes): registers a real extension viadefineNodeExtensionwhosenodeCreatedcallsnode.setSize([w, h]), then asserts the Vue node visibly grows — proving the delivered-handle path drives the reallayoutStore -> Vuereflow.Design references
defineNodenaming), P1 (full NodeHandle/Sizecontract).sizeProxy this API is the migration destination for.Follow-ups
NodeHandle.autosize(): resize to intrinsic content.NodeHandle.on('resize'): public event surface overlayoutStore.Notes