Skip to content

Fix/collapsed node stacking - #14261

Closed
r-vage wants to merge 11 commits into
Comfy-Org:feature/ecs-migrationfrom
r-vage:fix/collapsed-node-stacking
Closed

r-vage wants to merge 11 commits into
Comfy-Org:feature/ecs-migrationfrom
r-vage:fix/collapsed-node-stacking

Conversation

@r-vage

@r-vage r-vage commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Depends on: #14258.

Summary

Port collapsed-node paint ordering and stable drag ownership onto the ECS graph and layout stores.

Changes

  • What: Preserve stable DOM identity while deriving paint order from graph nodes, layout z-index, collapsed state, and selection.
  • ECS: Submit graph-scoped batched movement commands through layout mutations; do not add state to LiteGraph classes or mutate entity layout directly.
  • Interaction: Keep the initiating node as drag owner across selection promotion, delayed/lost pointer capture, multi-selection, cancellation, and release.
  • Dependencies: Built on the ECS geometry and expanded-size behavior from Fix/vue node expanded size #14258.

Review Focus

  • Selection changes only computed paint order and must not remount nodes.
  • Overlapping collapsed/expanded nodes retain correct hit testing and widget interaction.
  • Pointer ownership and cleanup remain deterministic for release, cancellation, and lost capture.

Testing

  • Head: e79eaa7ff017a29e114a750b8f9f154822540986.
  • Focused Vitest on the approved combined tree: 16 files, 291 tests passed.
  • Focused Chromium stacking, selection promotion, drag ownership, resize/collapse/reload, display settings, and LOD coverage: 21 tests passed.
  • pnpm typecheck, pnpm typecheck:browser, pnpm lint, pnpm knip, pnpm format:check, and pnpm build passed.
  • Approved combined wheel commit: 5359edb45d4c69e53599a276c9490db1c7ddf4d0.
  • git diff --check passed.

@r-vage
r-vage requested a review from a team July 29, 2026 10:51
@r-vage
r-vage marked this pull request as draft July 29, 2026 10:51
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 29, 2026
@dosubot

dosubot Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

📄 Knowledge review

Dosu skipped reviewing this PR because your organization has used its 200 included credits for the month. Your usage will reset on 2026-09-01. To have Dosu review this PR before then, ask your organization admin to upgrade to a pro account.


Leave Feedback Ask Dosu about ComfyUI_frontend Add Dosu to your team

@github-actions

github-actions Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: 🚧 Building...

🎭 Playwright: ⏳ Running...

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3c43604e-3ee0-4103-a539-d68ca3b88cb5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Vue node rendering now computes collapsed-aware paint order, preserves expanded dimensions while tracking collapsed visual bounds, synchronizes slot geometry during movement, and manages pointer-owned drag lifecycles with expanded regression coverage.

Changes

Vue node interaction behavior

Layer / File(s) Summary
Vue node paint ordering
src/components/graph/GraphCanvas.vue, src/renderer/extensions/vueNodes/components/*, src/renderer/extensions/vueNodes/utils/*, browser_tests/tests/vueNodes/interactions/node/*, browser_tests/assets/vueNodes/*
Paint order uses collapsed state, selection, and layout z-index. Vue nodes receive the computed order. Browser and unit tests cover overlap selection and stacking.
Collapsed visual bounds and size preservation
src/lib/litegraph/src/LGraphNode.*, src/renderer/core/layout/*, src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.*, src/renderer/extensions/vueNodes/interactions/resize/*, browser_tests/tests/vueNodes/interactions/node/resize.spec.ts
Collapsed measurements update visual bounds and collapsed width without replacing canonical expanded position or size. Widget serialization and restoration tests cover LiteGraph behavior.
Slot geometry synchronization
src/renderer/extensions/vueNodes/composables/useSlotElementTracking.*, browser_tests/tests/vueNodes/interactions/node/move.spec.ts
Slot offsets are cached relative to node positions and translated during movement. Missing offsets clear stale slot layouts.
Pointer-owned drag lifecycle
src/renderer/extensions/vueNodes/layout/useNodeDrag.*, src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts, browser_tests/tests/vueNodes/interactions/node/move.spec.ts
Dragging tracks the active node and pointer through pointer capture, window events, RAF updates, auto-pan, cancellation, and cleanup.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Pointer
  participant useNodeDrag
  participant WindowEvents
  participant layoutStore
  Pointer->>useNodeDrag: startDrag(nodeId, pointerId)
  WindowEvents->>useNodeDrag: pointermove for active pointer
  useNodeDrag->>layoutStore: update node positions
  WindowEvents->>useNodeDrag: pointerup or pointercancel
  useNodeDrag->>layoutStore: clear dragging state
Loading

Possibly related PRs

Suggested labels: core/1.48

Suggested reviewers: christian-byrne, jtydhr88

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Adr Compliance For Entity/Litegraph Changes ⚠️ Warning The diff changes LGraphNode widget restoration and serialization through this.widgets without migration guidance, triggering the ADR 0008 extension-ecosystem check. Add compatibility or migration guidance for custom nodes affected by the widget serialization changes, with context in ADR 0008.
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
End-To-End Regression Coverage For Fixes ✅ Passed The PR changes src/ and also adds multiple browser_tests files, including collapsedStacking.spec.ts; therefore the required no-browser-tests condition is false.
Description check ✅ Passed The description includes the required summary, changes, review focus, dependencies, and extensive testing details.
Title check ✅ Passed The title clearly identifies the main change: fixing collapsed node stacking behavior.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.ts (1)

169-202: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Fast-path "skip unchanged" check bypassed for collapsed nodes.

Since canonical size is now preserved as the expanded size for collapsed nodes, the early-exit at L192-202 compares nodeLayout.size (expanded) against the freshly measured collapsed DOM dimensions — this will essentially always differ, so collapsed nodes never benefit from the skip-check and always fall through to the more expensive bounds computation (still correctly deduped later via isBoundsEqual(nodeLayout.bounds, ...) at L240, so no correctness issue — just wasted work every RO tick).

♻️ Suggested fix
     const hasMatchingCachedNodeMeasurement =
       previousMeasurement != null &&
       previousMeasurement.nodeId === nodeId &&
       nodeLayout != null &&
       isBoundsEqual(previousMeasurement.bounds, nodeLayout.bounds)

     // ResizeObserver emits entries where nothing changed (e.g. initial observe).
     // Skip expensive DOM reads when this exact element/node already measured at
     // the same normalized bounds and size.
     if (
       nodeLayout &&
       !hasFreshMeasurementPending &&
-      isSizeEqual(nodeLayout.size, {
-        width,
-        height: normalizedHeight
-      }) &&
+      (isCollapsedNode
+        ? isSizeEqual(
+            { width: nodeLayout.bounds.width, height: nodeLayout.bounds.height },
+            { width, height: normalizedHeight }
+          )
+        : isSizeEqual(nodeLayout.size, { width, height: normalizedHeight })) &&
       hasMatchingCachedNodeMeasurement
     ) {
       continue
     }
🤖 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/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.ts`
around lines 169 - 202, Update the unchanged-measurement fast path in the resize
tracking logic around isSizeEqual so collapsed nodes compare against dimensions
normalized to their canonical expanded size, rather than their collapsed DOM
height. Preserve the existing behavior for non-collapsed nodes and retain
hasMatchingCachedNodeMeasurement as a required guard before skipping expensive
bounds work.
🤖 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 `@browser_tests/fixtures/VueNodeHelpers.ts`:
- Around line 69-80: Update getNodeCenter and getNodePaintOrder to select the
first match from getNodeByTitle(title) before calling boundingBox() or
evaluate(). Match the existing getNodeIdByTitle pattern so duplicate titles do
not trigger strict-mode violations.

In `@browser_tests/tests/vueNodes/interactions/node/collapsedStacking.spec.ts`:
- Around line 23-35: Assert that the collapsed node extends beyond the computed
overlap click point before calling mouse.click, using collapsedBox.width and
overlap.x with at least a one-pixel margin. Add this precondition in the
collapsedStacking interaction flow after overlap is calculated, while preserving
the existing click and stacking assertions.

In `@browser_tests/tests/vueNodes/interactions/node/move.spec.ts`:
- Around line 209-221: Extract the duplicated empty-canvas scanning logic from
getEmptyCanvasPoint in
browser_tests/tests/vueNodes/interactions/node/move.spec.ts#L209-L221 into a
reusable helper under browser_tests/fixtures/, then import and use it in
move.spec.ts. Remove the inline emptyCanvasPoint evaluate block from
browser_tests/tests/vueNodes/interactions/node/collapsedStacking.spec.ts#L105-L115
and call the shared helper there, preserving the existing empty-point behavior.

In `@browser_tests/tests/vueNodes/interactions/node/resize.spec.ts`:
- Around line 164-171: Replace the synthetic
collapseButton.dispatchEvent('click') calls in the affected resize tests with
VueNodeFixture.toggleCollapse() (or the exposed collapseButton.click() action).
Apply this to all four occurrences while preserving the existing assertions and
test flow.

In `@src/lib/litegraph/src/LGraphNode.ts`:
- Around line 2158-2163: Update the collapsed Vue-mode branch in measure() so
out[3] uses at least LiteGraph.NODE_TITLE_HEIGHT when titleHeight is zero or
smaller, while preserving the existing titleHeight value for normal titled nodes
and leaving the collapsed width behavior unchanged.

In `@src/renderer/extensions/vueNodes/layout/useNodeDrag.ts`:
- Around line 241-256: Update capturePointer to use the element recorded by
startDrag as the drag-origin target instead of event.target, and only recapture
that stored element when pointer capture is lost. Preserve the existing
pointerId checks, releasePointerCapture call, delayed setPointerCapture
behavior, and capturedPointerTarget assignment while avoiding capture on
unrelated elements under the pointer.

---

Outside diff comments:
In `@src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.ts`:
- Around line 169-202: Update the unchanged-measurement fast path in the resize
tracking logic around isSizeEqual so collapsed nodes compare against dimensions
normalized to their canonical expanded size, rather than their collapsed DOM
height. Preserve the existing behavior for non-collapsed nodes and retain
hasMatchingCachedNodeMeasurement as a required guard before skipping expensive
bounds work.
🪄 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: f540bfd4-dd01-45bc-b5f9-458d173bbc66

📥 Commits

Reviewing files that changed from the base of the PR and between fc92a12 and 3610519.

📒 Files selected for processing (24)
  • browser_tests/assets/vueNodes/collapsed-stacking.json
  • browser_tests/fixtures/VueNodeHelpers.ts
  • browser_tests/tests/vueNodes/interactions/node/bringToFront.spec.ts
  • browser_tests/tests/vueNodes/interactions/node/collapsedStacking.spec.ts
  • browser_tests/tests/vueNodes/interactions/node/move.spec.ts
  • browser_tests/tests/vueNodes/interactions/node/resize.spec.ts
  • src/components/graph/GraphCanvas.vue
  • src/lib/litegraph/src/LGraphNode.test.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/store/layoutStore.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.test.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.vue
  • src/renderer/extensions/vueNodes/components/NodeHeader.vue
  • src/renderer/extensions/vueNodes/composables/useSlotElementTracking.test.ts
  • src/renderer/extensions/vueNodes/composables/useSlotElementTracking.ts
  • src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.test.ts
  • src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.ts
  • src/renderer/extensions/vueNodes/interactions/resize/resizeHandleConfig.ts
  • src/renderer/extensions/vueNodes/layout/useNodeDrag.test.ts
  • src/renderer/extensions/vueNodes/layout/useNodeDrag.ts
  • src/renderer/extensions/vueNodes/utils/nodePaintOrder.test.ts
  • src/renderer/extensions/vueNodes/utils/nodePaintOrder.ts

Comment thread src/lib/litegraph/src/LGraphNode.ts Resolved
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 29, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 29, 2026
@r-vage

r-vage commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@r-vage
r-vage marked this pull request as ready for review July 29, 2026 23:05
@r-vage
r-vage force-pushed the fix/collapsed-node-stacking branch from e629dae to aac8ee0 Compare August 1, 2026 03:13
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Aug 1, 2026
@r-vage
r-vage changed the base branch from main to drjkl/node-geometry-facade August 1, 2026 03:14
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 1, 2026
@r-vage
r-vage marked this pull request as draft August 1, 2026 03:17
@r-vage
r-vage force-pushed the fix/collapsed-node-stacking branch from aac8ee0 to e629dae Compare August 1, 2026 11:33
@r-vage
r-vage changed the base branch from drjkl/node-geometry-facade to main August 1, 2026 11:34
DrJKL and others added 11 commits August 12, 2026 20:35
Collapses the twelve reviewed slices of the ECS migration into one
commit so the series can be replayed onto main as a unit. Each slice
kept its own review on GitHub:

- ECS: Moving widgets out of the Node data (#13322)
- ECS: Link topology store (single source of truth for link data) (#13436)
- ECS: Reroute chain store with derived link membership (#13449)
- ECS: derive slot floating links; reroute cleanup follow-ups (#13451)
- refactor: read widgeted-input connectivity from linkStore (#13455)
- feat: nodeBadgeStore + badge system (slice A) (#13458)
- refactor: derive badge rows on read, delete the badge store (#13686)
- refactor: host-scoped promoted widget rows (no source traversal) (#13434)
- refactor!: delete the output.links runtime mirror (#13479)
- refactor!: delete the input.link runtime mirror (#13498)
- fix: ECS stack audit fixes (#13528)
- refactor!: make nodeDataStore the source of truth for node shell state (#13963)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ff78d-80f9-73e1-986a-5e4abc9f9d6a
Split 2/6 of #14480. Stacked on #15001.

Fixes cross-subgraph-definition topology contamination:
`linkStore`/`rerouteStore` buckets were keyed only by root graph id, but
every subgraph definition numbers links from 1 and shares the IO
pseudo-node ids (−10/−20). Two definitions under one root therefore
shared an origin index and reroute membership — one definition's links
joined another definition's reroute chains, driving wrong reroute
pruning on configure. Repro:
`browser_tests/tests/subgraph/subgraphLinkIdentity.spec.ts` + fixture.

Changes:
- Adds `GraphScope` (`rootGraphId`, `owningGraphId`) and scopes topology
queries, owner-local iteration, and teardown to the graph that directly
owns each entity. Root-wide identity lookup remains keyed by
`rootGraphId`.
- Makes `linkStore`, `rerouteStore`, and `nodeDataStore` the
authoritative collision boundaries. Registrations are first-wins;
rejected entities remain detached and are not assigned to the requesting
owner.
- Shares link and reroute ID allocation across a root and its subgraphs.
Serialized subgraphs are deduplicated before registration so link,
reroute, node, widget, and promoted-widget references are remapped
together.
- Keeps endpoint swaps, rotations, and removals atomic within
`linkStore`: an entire batch is validated before indexes or topology
fields change. `LLink` retains the store-held reactive topology object
across ID and endpoint updates.
- Treats configure payloads as authoritative for their owner by clearing
owner-local registrations before rebuilding them, with empty root-bucket
pruning.
- Derives topology scope from the directly owning graph at callers such
as `NodeSlots.vue` and `useProcessedWidgets.ts`.
- Positions promoted DOM widgets immediately on mount instead of waiting
for a watched value to change.
- Removes redundant graph-local collision checks, floating-link ID
bookkeeping, unreachable tuple deduplication, obsolete compatibility
types, and mock-only tests.
- Documents root-vs-owner query guidance, topology transaction
boundaries, and the deferred measurement of root-wide group scans before
introducing another persistent index.

Behavior notes:
- Constructing or configuring an `LGraph` from serialized data requires
an active Pinia because entities register with topology stores during
deserialization.
- Runtime duplicate IDs are rejected by the root-scoped store; persisted
collisions are remapped before object registration.
- Registration failures remain explicit return values and do not throw
errors.

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: github-actions <github-actions@github.com>
Centralizes entity layout ownership and command submission on top of
#15009's graph identity, collision, and teardown boundaries.

Nodes, groups, and reroutes now hold instance-bound `{ graphId, id }`
attachments. Only the attached instance can mutate canonical geometry;
stale instances become inert without delete/recreate compensation.

Changes:
- Replaces ID-derived registration with `graphLayoutAttachment.ts`,
covering attach, adopt, detach, geometry writes, and batched teardown.
- Acquires reroute topology/map ownership before layout ownership, so
collision losers cannot adopt incumbent geometry.
- Centralizes group ID allocation at creation through the graph-state
high-water mark.
- Uses deep Yjs observation and emits geometry invalidation once per
transaction, including group- and reroute-only changes.
- Queues listener delivery after committed store writes, allowing nested
observer mutations as ordinary follow-up transactions.
- Requires mutation producers to supply `LayoutSource`; the store stamps
its session actor at submission. DOM measurement conventions are
explicit rather than ambient process state.
- Narrows `useLayoutMutations` to its four production behaviors and
removes redundant command `entity`, operation ID, and apply-result
fields.
- Makes node layout refs read-only and updates migration documentation
to match the command/attachment boundary.

Review focus:
- Attachment lifetime and stale-instance isolation in
`graphLayoutAttachment.ts`.
- Root versus partial-subgraph teardown through #15009's centralized
lifecycle.
- Topology-before-layout ordering in `_addReroute`.
- Explicit source/measurement semantics at mutation call sites.
- Transaction and notification timing in `layoutStore.ts`.

Validation:
- Full GitHub CI passed, including unit tests, all Playwright shards,
type/lint/format checks, Storybook, and performance tests.
- The branch is net −170 lines against `feature/ecs-migration`.

---------

Co-authored-by: Amp <amp@ampcode.com>
Retargeted squash: resize gestures write intent to the store, node size
binds from the store instead of imperative CSS var writes, DOM
measurement stays out of the replicated document, and the collapse-save
width-loss repro lands as e2e coverage. Amends ADR 0003 accordingly.
@r-vage
r-vage force-pushed the fix/collapsed-node-stacking branch from 07147ba to e79eaa7 Compare August 14, 2026 09:38
@r-vage
r-vage changed the base branch from main to feature/ecs-migration August 14, 2026 09:40
@r-vage
r-vage marked this pull request as ready for review August 14, 2026 09:48
Copilot AI lite review requested due to automatic review settings August 14, 2026 09:48
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Aug 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports collapsed-node paint ordering and stable drag ownership into the Vue-nodes ECS layout architecture, ensuring stacking/hit-testing changes don’t require DOM remounts while keeping drag pointer ownership deterministic under selection promotion and capture loss.

Changes:

  • Introduces a computed paint-order pipeline (tiering by collapsed/selected + z-index ordering) and applies it via per-node z-index without reordering the DOM.
  • Refactors Vue node dragging to maintain a single drag owner and pointer ID across window-level pointer events (move/up/cancel), including lost capture recovery and cleanup.
  • Separates requested (replicated) node size from measured (view-scoped) content size, with updated resize + geometry plumbing and regression coverage (Vitest + Playwright).

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/renderer/extensions/vueNodes/utils/nodePaintOrder.ts New utility to compute stable paint order across tiers and z-index.
src/renderer/extensions/vueNodes/utils/nodePaintOrder.test.ts Unit tests for paint-order tiering, z-index stability, and missing layouts.
src/renderer/extensions/vueNodes/layout/useNodeDrag.ts Drag ownership + pointer capture refactor with window-level event handling.
src/renderer/extensions/vueNodes/layout/useNodeDrag.test.ts Expanded unit coverage for drag ownership, capture loss, cancel, and cleanup.
src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts Adds resize lifecycle callbacks and pointercancel handling path.
src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.test.ts Tests lifecycle callbacks and pointercancel end behavior.
src/renderer/extensions/vueNodes/interactions/resize/resizeHandleConfig.ts Adjusts resize-handle positioning classes for hit-testing/overlap behavior.
src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.ts Switches from writing replicated bounds to reporting view-scoped content size.
src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.test.ts Updates expectations to validate reportContentSize calls.
src/renderer/extensions/vueNodes/composables/useSlotElementTracking.ts Improves slot geometry translation via cached offsets; drops stale layouts when needed.
src/renderer/extensions/vueNodes/composables/useSlotElementTracking.test.ts Adds coverage for translating slot geometry during node/group moves and collapsed behavior.
src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts Updates drag/end-drag calls to new drag API (nodeId now owned by drag state).
src/renderer/extensions/vueNodes/components/LGraphNode.vue Applies computed paint order, modernizes size styling, and routes resize through ECS mutations with lifecycle hooks.
src/renderer/extensions/vueNodes/components/LGraphNode.test.ts Updates collapsed/expanded size-var expectations and collapsed render assertions.
src/renderer/core/layout/store/layoutStore.ts Adds view-scoped contentSizes storage and lifecycle clearing hooks.
src/renderer/core/layout/store/layoutStore.test.ts Verifies graph scoping clears content size for the removed graph only.
src/renderer/core/layout/store/mocks/layoutStore.ts Extends mock with contentSizeOf for LiteGraph geometry reads.
src/renderer/core/layout/operations/layoutMutations.ts Adds resizeNode mutation helper.
src/renderer/core/layout/operations/layoutMutations.test.ts Tests resizeNode updates layout store size.
src/lib/litegraph/src/LGraphNode.widgetOrder.test.ts Adds coverage for ignoring inherited named widget values during restore.
src/lib/litegraph/src/LGraphNode.ts Splits requested vs rendered size, consumes view-scoped content size, tightens widget restore + serialization behavior.
src/lib/litegraph/src/LGraphNode.test.ts Expands tests for dense widget serialization, content-size geometry, and Vue-mode collapsed measurement behavior.
src/components/graph/GraphCanvas.vue Computes per-node paint order and passes it down to Vue nodes.
docs/adr/0003-crdt-based-layout-system.md Documents the “intent vs measurement” amendment and the view-scoped measurement decision.
browser_tests/tests/vueNodes/nodeStates/collapse.spec.ts E2E regression: resized width survives collapse + save + reload.
browser_tests/tests/vueNodes/interactions/node/resize.spec.ts E2E regression: resized width survives save + reload; validates resize-handle hit bounds; strengthens min-width assertion source.
browser_tests/tests/vueNodes/interactions/node/move.spec.ts E2E coverage for lost pointer capture drag ownership + link geometry stability on collapsed/group moves.
browser_tests/tests/vueNodes/interactions/node/collapsedStacking.spec.ts New E2E coverage for collapsed stacking hit order + drag ownership after selection promotion.
browser_tests/tests/vueNodes/interactions/node/bringToFront.spec.ts Uses shared helper assertions for paint ordering instead of parsing inline styles.
browser_tests/fixtures/VueNodeHelpers.ts Adds helpers to measure paint order and assert relative stacking.
browser_tests/fixtures/utils/vueNodeFixtures.ts Adjusts resize start points (esp. NW) to match updated handle geometry.
browser_tests/fixtures/utils/findEmptyCanvasPoint.ts New helper to locate empty canvas coordinates for reliable drag-release points.
browser_tests/assets/vueNodes/collapsed-stacking.json New workflow fixture for stacking/overlap test coverage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +339 to +351
/** Size the DOM made of this node, if it has been measured. */
contentSizeOf(rootGraphId: UUID, nodeId: NodeId): Size | undefined {
return this.contentSizes.get(makeScopedLayoutKey(rootGraphId, nodeId))
}

/**
* Records what the DOM made of a node. Local and view-scoped: a measurement
* is not replayable on a peer whose fonts, locale or custom nodes differ, so
* it never enters the replicated document (ADR 0003, 2026-08-04).
*/
reportContentSize(rootGraphId: UUID, nodeId: NodeId, size: Size): void {
this.contentSizes.set(makeScopedLayoutKey(rootGraphId, nodeId), size)
}
@DrJKL
DrJKL force-pushed the feature/ecs-migration branch 2 times, most recently from ef435ab to 20cd48c Compare August 15, 2026 04:09
@r-vage r-vage closed this Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants