fix(vueNodes): sync extension-driven node.setSize() to Vue components#8294
fix(vueNodes): sync extension-driven node.setSize() to Vue components#8294
Conversation
🎭 Playwright Tests:
|
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/24/2026, 07:32:14 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
📝 WalkthroughWalkthroughThese changes implement node resize synchronization between LiteGraph and the layout store. When a node is resized in LiteGraph, the resize event is captured and stored via Changes
Sequence DiagramsequenceDiagram
participant LG as LiteGraph Node
participant UGNM as useGraphNodeManager
participant LS as layoutStore
participant VNode as LGraphNode.vue
participant DOM as CSS Variables
LG->>UGNM: onResize event
UGNM->>LS: Check current stored size
alt Size changed
UGNM->>LS: resizeNode(width, height)<br/>source: Canvas
LS->>VNode: Notify resizeNode operation
VNode->>VNode: Validate: Canvas source<br/>& node matches & not collapsed
VNode->>DOM: Update --node-width<br/>& --node-height
else Size unchanged
UGNM->>UGNM: Skip mutation
end
Possibly related PRs
Suggested reviewers
✨ Finishing touches
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 |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 22.5 kB (baseline 22.5 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 956 kB (baseline 955 kB) • 🔴 +916 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 80.7 kB (baseline 80.7 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed Panels & Settings — 440 kB (baseline 440 kB) • 🟢 -8 BConfiguration panels, inspectors, and settings screens
Status: 12 added / 12 removed User & Accounts — 3.94 kB (baseline 3.94 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 3 added / 3 removed Editors & Dialogs — 2.83 kB (baseline 2.83 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 33.7 kB (baseline 33.7 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed Data & Services — 3.17 MB (baseline 3.17 MB) • 🔴 +1 BStores, services, APIs, and repositories
Status: 8 added / 8 removed Utilities & Hooks — 24 kB (baseline 24 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 7 added / 7 removed Vendor & Third-Party — 10.7 MB (baseline 10.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 6.42 MB (baseline 6.42 MB) • 🟢 -192 BBundles that do not match a named category
Status: 31 added / 31 removed |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/composables/graph/useGraphNodeManager.ts`:
- Around line 400-406: node.onResize currently chains a callback that calls
layoutStore.getNodeLayoutRef(id).value?.size then blindly calls
setSource(LayoutSource.Canvas) and resizeNode(id, ...), but getNodeLayoutRef may
be undefined during configure and resizeNode returns a promise; add a guard to
early-return if layout entry is missing (e.g., if
layoutStore.getNodeLayoutRef(id).value is falsy) to avoid mutating non-existent
state, and ensure you await or explicitly void the async resizeNode call (e.g.,
await resizeNode(...) or void resizeNode(...)) so promises aren’t dropped; keep
this change inside the useChainCallback wrapper for node.onResize so behavior
and ordering remain consistent.
Summary
Chain onResize on Vue-managed nodes to dispatch size changes to the layout store, and subscribe to store changes in LGraphNode.vue to update CSS variables for resize operations from Canvas source.
Problem: Extensions calling node.setSize() doesn't update Vue node visuals.
Fix
Flow: Extension → setSize() → onResize → layout store (Canvas source) → onChange → CSS update
replacement for #7993
┆Issue is synchronized with this Notion page by Unito