Skip to content

Feat/vue node display settings - #14260

Closed
r-vage wants to merge 10 commits into
Comfy-Org:feature/ecs-migrationfrom
r-vage:feat/vue-node-display-settings
Closed

r-vage wants to merge 10 commits into
Comfy-Org:feature/ecs-migrationfrom
r-vage:feat/vue-node-display-settings

Conversation

@r-vage

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

Copy link
Copy Markdown
Contributor

Depends on: #14258.

Summary

Port the opt-in Nodes 2.0 compact-collapsed and status-badge display settings onto ECS without changing default rendering.

Changes

  • What: Add Comfy.VueNodes.CompactCollapsedNodes and Comfy.VueNodes.HideStatusBadges, both disabled by default.
  • ECS: Use the dedicated layout and widget-value paths inherited from Fix/vue node expanded size #14258; compact measurements do not overwrite canonical expanded dimensions.
  • Compatibility: Preserve widget ordering, promoted-widget values, node replacement, serialization, pricing badges, pin state, and existing default appearance.
  • Dependencies: Built on the ECS port of Fix/vue node expanded size #14258.

Review Focus

  • Defaults remain visually identical to existing Nodes 2.0.
  • Compact width follows the title while controls, pricing, status, pinning, collapse/expand, and reload remain consistent.
  • Widget persistence stays compatible with existing workflows and ECS stores.

Testing

  • Head: fd7677a63cde3b55ad779c9b4fd1319f650214f5.
  • Focused Vitest on the approved combined tree: 16 files, 291 tests passed.
  • Focused Chromium resize/collapse/reload, display-setting matrices, live toggles, pricing, stacking, drag ownership, 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.

Screenshots

Status badges shown Status badges hidden
Expanded node with Bypassed status badge Expanded node with status badges hidden
Normally collapsed Compact collapsed
Normally collapsed node Compact collapsed node

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

🎭 Playwright: ⏳ Running...

🎨 Storybook: 🚧 Building...

@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: 44f4f814-eae7-4461-a7e2-bf0347561641

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

Changes

The PR adds Nodes 2.0 settings for compact collapsed nodes and status badge visibility. It preserves expanded node dimensions during collapsed visual updates, synchronizes slot geometry during movement, and improves named widget serialization and restoration.

Vue node collapsed-state behavior

Layer / File(s) Summary
Settings and collapsed header rendering
src/schemas/apiSchema.ts, src/platform/settings/..., src/locales/en/*, src/renderer/extensions/vueNodes/components/*, browser_tests/tests/...
Registers the new settings and applies compact sizing, pricing badges, status badges, resize handles, localization, and settings-search coverage.
Preserved expanded dimensions and resize propagation
src/lib/litegraph/src/LGraphNode.*, src/renderer/core/layout/*, src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.*, browser_tests/tests/vueNodes/interactions/node/resize.spec.ts
Uses collapsed visual bounds and _collapsed_width while preserving canonical position and size through resize, collapse, and workflow reload operations.
Slot geometry synchronization during movement
src/renderer/extensions/vueNodes/composables/useSlotElementTracking.*, browser_tests/tests/vueNodes/interactions/node/move.spec.ts
Caches slot offsets, removes stale layouts when offsets are unavailable, and verifies link alignment while dragging collapsed nodes and groups.

Widget serialization compatibility

Layer / File(s) Summary
Validated named widget restoration
src/lib/litegraph/src/types/serialisation.ts, src/lib/litegraph/src/LGraphNode.ts, src/lib/litegraph/src/subgraph/SubgraphNode.ts, src/platform/nodeReplacement/*, src/lib/litegraph/src/*test.ts
Validates widgets_values_named and falls back to legacy positional values when named data is invalid or unavailable.
Dense widget and subgraph serialization
src/lib/litegraph/src/LGraphNode.ts, src/lib/litegraph/src/subgraph/SubgraphNode.ts, src/lib/litegraph/src/subgraph/SubgraphWidgetPromotion.test.ts, docs/WIDGET_SERIALIZATION.md
Skips non-persisted widgets, keeps positional values dense, emits named promoted-widget values, and documents the serialization rules.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant LGraphNodeVue
  participant NodeHeader
  participant useVueNodeResizeTracking
  participant layoutStore
  User->>LGraphNodeVue: collapse or expand node
  LGraphNodeVue->>NodeHeader: update compact and badge visibility
  LGraphNodeVue->>useVueNodeResizeTracking: report visual dimensions
  useVueNodeResizeTracking->>layoutStore: batch bounds with preserveSize
  layoutStore->>LGraphNodeVue: retain canonical expanded size
Loading

Possibly related PRs

Suggested reviewers: christian-byrne


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
End-To-End Regression Coverage For Fixes ❓ Inconclusive The changed-file list is available, but the PR title and commit subjects are not provided, so the required bug-fix signal cannot be verified. Provide the PR title and commit subjects to determine whether the end-to-end regression coverage rule applies.
✅ 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.
Adr Compliance For Entity/Litegraph Changes ✅ Passed No direct node.pos/node.size/group.pos writes or new entity mutation API appear; entity classes gain no new methods, and docs add widget serialization migration guidance.
Title check ✅ Passed The title clearly identifies the main change: adding Vue node display settings.
Description check ✅ Passed The description includes the required summary, changes, dependencies, review focus, testing details, and screenshots.
✨ 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: 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 `@browser_tests/tests/creditHelpers.spec.ts`:
- Around line 273-280: Update the width assertion in the relevant creditHelpers
test to import and use MIN_NODE_WIDTH, multiplied by canvasOps.getScale(),
instead of the hardcoded 225 value. Match the equivalent check in resize.spec.ts
while preserving the existing polling and comparison behavior.

In `@src/platform/settings/constants/coreSettings.ts`:
- Around line 1212-1234: Update the locale definitions corresponding to the
settings categories used by Comfy.VueNodes.CompactCollapsedNodes, adding
Categories.Settings entries for CompactCollapsedNodes and every translated
parent/category path expected by SettingGroup.vue after normalization. Preserve
the existing category hierarchy and translation style so nested groups display
localized labels instead of raw PascalCase keys.
🪄 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: 7fd0681f-0720-4424-9081-26d22dc08842

📥 Commits

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

📒 Files selected for processing (21)
  • browser_tests/fixtures/ComfyPage.ts
  • browser_tests/tests/creditHelpers.spec.ts
  • browser_tests/tests/vueNodes/interactions/node/move.spec.ts
  • browser_tests/tests/vueNodes/interactions/node/resize.spec.ts
  • src/lib/litegraph/src/LGraphNode.test.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/locales/en/settings.json
  • src/platform/settings/constants/coreSettings.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.test.ts
  • 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/schemas/apiSchema.ts

@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.

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/LGraphNode.test.ts (1)

683-716: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Restore LiteGraph.vueNodesMode after the test.

This test enables the shared LiteGraph.vueNodesMode flag, but the shown cleanup only restores title_mode. Later measurement tests can therefore run in Vue mode and become order-dependent. Capture the previous value and restore it in finally (or reset it in test setup).

Suggested cleanup
+const previousVueNodesMode = LiteGraph.vueNodesMode
+try {
  LiteGraph.vueNodesMode = true
  ...
+} finally {
+  LiteGraph.vueNodesMode = previousVueNodesMode
+}
🤖 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/LGraphNode.test.ts` around lines 683 - 716, Restore the
shared LiteGraph.vueNodesMode flag after each Vue-mode test. Capture its
previous value before enabling it and restore it in a finally block, including
the parameterized test around nodeConstructor.title_mode, while preserving the
existing title_mode cleanup.

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/LGraphNode.test.ts`:
- Around line 683-716: Restore the shared LiteGraph.vueNodesMode flag after each
Vue-mode test. Capture its previous value before enabling it and restore it in a
finally block, including the parameterized test around
nodeConstructor.title_mode, while preserving the existing title_mode cleanup.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 406be3a9-88bc-4d7e-a348-fcafe29f7e6e

📥 Commits

Reviewing files that changed from the base of the PR and between b0422d6 and 2e7d39f.

📒 Files selected for processing (2)
  • src/lib/litegraph/src/LGraphNode.test.ts
  • src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.test.ts

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:06
@r-vage
r-vage force-pushed the feat/vue-node-display-settings branch from 4f81dcf to a69ff10 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:16
@r-vage
r-vage force-pushed the feat/vue-node-display-settings branch from a69ff10 to 4f81dcf 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

@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.

Caution

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

⚠️ Outside diff range comments (3)
src/lib/litegraph/src/LGraphNode.ts (3)

1077-1089: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Use a dense index for legacy widget values.

The legacy restore loop skips serialize === false widgets and reads info.widgets_values densely. This serializer writes values at the original widget index. If a non-serialized widget precedes a serialized widget, the serialized array becomes sparse and the value restores as null after a JSON round-trip.

Use a separate index that increments only for serialized widgets. Add a regression test for this ordering.

Proposed fix
     o.widgets_values = []
     o.widgets_values_named = {}
-    for (const [i, widget] of widgets.entries()) {
+    let serializedIndex = 0
+    for (const widget of widgets) {
       if (widget.serialize === false) continue
       const val = widget.value
       const serialisedVal =
         val != null && typeof val === 'object'
           ? JSON.parse(JSON.stringify(val))
           : (val ?? null)
-      o.widgets_values[i] = serialisedVal
+      o.widgets_values[serializedIndex++] = serialisedVal
       o.widgets_values_named[widget.name] = serialisedVal
     }
🤖 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/LGraphNode.ts` around lines 1077 - 1089, Update the
widget serialization loop in LGraphNode serialization to use a separate dense
index for widgets_values, incrementing it only when widget.serialize is not
false, while keeping widgets_values_named keyed by widget.name. Add a regression
test covering a non-serialized widget before a serialized widget and verify
legacy restoration preserves the serialized value.

991-1022: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Keep widgets_values_named outside the legacy shadow path.

configure() receives ISerialisedNode directly, and nothing validates that the external JSON widgets_values_named field is a record. A truthy non-record can reach diffNamedValuesShadow() and NamedValuesShadowDiffLoadAggregation, then throw during load configuration. Add a runtime type guard or schema validation before the named-field branch.

🤖 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/LGraphNode.ts` around lines 991 - 1022, Validate
info.widgets_values_named is a record of named widget values before returning it
from getNamedValues or entering the named-values branches in configure. Treat
invalid truthy values as absent so diffNamedValuesShadow,
reportNamedValuesShadowDiff, and restoration only receive valid named-value
data, while preserving the existing legacy fallback via
fallbackWidgetsValuesNames.

Source: Coding guidelines


1077-1090: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Preserve and document the widgets_values_named workflow contract.

serialize() emits widgets_values_named and configure() reads it, so nodes such as SubgraphNode must not drop this field when rewriting widgets, and node-replacement paths should also restore named widget values. Add migration guidance for extensions that add node widgets through node.widgets and preserve unknown-node widget data. Add a LGraphNode save/load round-trip test in src/lib/litegraph/src/LGraphNode.test.ts.

Document that widget.serialize controls workflow persistence and widget.options.serialize remains the separate prompt/API serialization path.

🤖 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/LGraphNode.ts` around lines 1077 - 1090, Preserve the
widgets_values_named workflow field throughout LGraphNode.serialize(),
configure(), SubgraphNode widget rewrites, and node-replacement restoration
paths, including unknown-node widget data. Add migration guidance for extensions
that append widgets through node.widgets, and document that widget.serialize
controls workflow persistence while widget.options.serialize remains the
prompt/API path. Add an LGraphNode save/load round-trip test in
LGraphNode.test.ts covering named widget values.

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/LGraphNode.ts`:
- Around line 1077-1089: Update the widget serialization loop in LGraphNode
serialization to use a separate dense index for widgets_values, incrementing it
only when widget.serialize is not false, while keeping widgets_values_named
keyed by widget.name. Add a regression test covering a non-serialized widget
before a serialized widget and verify legacy restoration preserves the
serialized value.
- Around line 991-1022: Validate info.widgets_values_named is a record of named
widget values before returning it from getNamedValues or entering the
named-values branches in configure. Treat invalid truthy values as absent so
diffNamedValuesShadow, reportNamedValuesShadowDiff, and restoration only receive
valid named-value data, while preserving the existing legacy fallback via
fallbackWidgetsValuesNames.
- Around line 1077-1090: Preserve the widgets_values_named workflow field
throughout LGraphNode.serialize(), configure(), SubgraphNode widget rewrites,
and node-replacement restoration paths, including unknown-node widget data. Add
migration guidance for extensions that append widgets through node.widgets, and
document that widget.serialize controls workflow persistence while
widget.options.serialize remains the prompt/API path. Add an LGraphNode
save/load round-trip test in LGraphNode.test.ts covering named widget values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7365cf4f-279c-43d7-94c6-bb92fc4779dd

📥 Commits

Reviewing files that changed from the base of the PR and between 2e7d39f and 3a02ee8.

📒 Files selected for processing (3)
  • src/lib/litegraph/src/LGraphNode.ts
  • src/locales/en/main.json
  • src/locales/en/settings.json

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 1, 2026
@r-vage

r-vage commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Verified against the current branch head and fixed the still-valid parts in c32d003fa3.

  • Made legacy widgets_values dense across serialize: false widgets while keeping widgets_values_named keyed by name. Added dense legacy-restore and named round-trip regressions.
  • Added plain-record validation for widgets_values_named. Invalid truthy payloads are now treated as absent before shadow diff telemetry or restoration, and fallbackWidgetsValuesNames still supplies the legacy named fallback.
  • Kept named values aligned with SubgraphNode's promoted-widget rewrites, including serialize: false, and made node replacement restore named-only unknown-node widget data before falling back to old_widget_ids/positional values.
  • Added extension migration guidance for widgets appended through node.widgets.

Already correct, so left unchanged: the serialized-node type already carries widgets_values_named; workflow schemas preserve it through passthrough fields; unknown-node serialization already spreads last_serialization; and the existing widget type/docs already distinguish widget.serialize workflow persistence from widget.options.serialize prompt/API persistence.

Validation: 123 focused Vitest tests, application typecheck, targeted ESLint, oxfmt check, git diff --check, and 11 focused Chromium Playwright checks passed.

DrJKL and others added 10 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 feat/vue-node-display-settings branch from 6aa8874 to fd7677a 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

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 the opt-in Nodes 2.0 “compact collapsed” and “hide status badges” display settings onto the ECS-based layout/rendering pipeline while keeping default rendering unchanged, and adjusts layout/serialization plumbing to separate requested geometry from DOM-measured geometry.

Changes:

  • Add two new settings (Comfy.VueNodes.CompactCollapsedNodes, Comfy.VueNodes.HideStatusBadges) and wire them into Vue node header/collapsed rendering.
  • Introduce a local-only contentSizes tier in the layout store and route DOM measurement updates through it (instead of overwriting requested layout size).
  • Improve widget value serialization/restore compatibility (dense legacy arrays + widgets_values_named), and extend replacement/subgraph logic to handle named values.

Reviewed changes

Copilot reviewed 38 out of 42 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/schemas/apiSchema.ts Adds the two new Vue Nodes settings to the settings schema.
src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts Adds resize lifecycle hooks and pointercancel cleanup.
src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.test.ts Extends resize tests for pointercancel + lifecycle callbacks.
src/renderer/extensions/vueNodes/interactions/resize/resizeHandleConfig.ts Moves resize handles inside node bounds (class adjustments).
src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.ts Reports DOM-measured content size instead of mutating node bounds.
src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.test.ts Updates tests for the new content-size reporting path.
src/renderer/extensions/vueNodes/composables/useSlotElementTracking.ts Caches slot offsets and drops stale layouts when offsets are missing.
src/renderer/extensions/vueNodes/composables/useSlotElementTracking.test.ts Adds coverage for slot translation on node/group movement and collapsed offsets.
src/renderer/extensions/vueNodes/components/NodeHeader.vue Adds compact + showStatusBadge props and conditional badge rendering.
src/renderer/extensions/vueNodes/components/NodeHeader.test.ts Adds tests for independent status badge visibility and pin retention.
src/renderer/extensions/vueNodes/components/LGraphNode.vue Applies settings to collapsed rendering, routes resize into ECS mutations, and adjusts sizing behavior.
src/renderer/extensions/vueNodes/components/LGraphNode.test.ts Updates expectations for collapsed sizing behavior and DOM vars.
src/renderer/core/layout/store/layoutStore.ts Adds local-only contentSizes map with clearGraph/reset handling.
src/renderer/core/layout/store/layoutStore.test.ts Verifies contentSizes are root-graph scoped and cleared correctly.
src/renderer/core/layout/store/mocks/layoutStore.ts Extends layoutStore mock with contentSizeOf.
src/renderer/core/layout/operations/layoutMutations.ts Adds resizeNode mutation helper.
src/renderer/core/layout/operations/layoutMutations.test.ts Adds tests for resizeNode and resets layout store between tests.
src/platform/settings/constants/coreSettings.ts Registers the two new settings in the core settings catalog.
src/platform/nodeReplacement/useNodeReplacement.ts Transfers widget values via named values when positional metadata is absent.
src/platform/nodeReplacement/useNodeReplacement.test.ts Adds test coverage for named widget value transfer.
src/locales/en/settings.json Adds localized labels/tooltips for the new settings.
src/locales/en/main.json Adds localized labels for Nodes 2.0 subgroup/category names.
src/lib/litegraph/src/types/serialisation.ts Adds TSerializedWidgetValue + isNamedWidgetValues guard; allows null in serialized values.
src/lib/litegraph/src/subgraph/SubgraphWidgetPromotion.test.ts Adds coverage for named values alignment and null serialization behavior.
src/lib/litegraph/src/subgraph/SubgraphNode.ts Validates named values and serializes promoted widget values by name/dense array.
src/lib/litegraph/src/LGraphNode.widgetOrder.test.ts Ensures inherited/invalid named values don’t corrupt widget restore ordering.
src/lib/litegraph/src/LGraphNode.ts Separates requested vs rendered size via content-size tier; tightens named value restore/serialization.
src/lib/litegraph/src/LGraphNode.test.ts Adds tests for dense serialization + Vue collapsed measurement behavior + non-serialization of measured size.
src/lib/litegraph/src/LGraphNode.namedValuesShadowDiff.test.ts Ensures invalid named values are ignored without shadow-diff reporting.
docs/WIDGET_SERIALIZATION.md Documents dense widget serialization and named restore guidance.
docs/adr/0003-crdt-based-layout-system.md ADR amendment formalizing “intent vs measurement” split.
browser_tests/tests/vueNodes/nodeStates/collapse.spec.ts Adds E2E coverage for width persistence across collapsed save/reload.
browser_tests/tests/vueNodes/interactions/node/resize.spec.ts Adds E2E coverage for resize persistence, hit-testing, and compact-collapse size invariants.
browser_tests/tests/vueNodes/interactions/node/move.spec.ts Adds E2E coverage for link geometry staying attached during collapsed node/group drags.
browser_tests/tests/dialogs/settingsDialog.spec.ts Ensures settings search finds new settings via translated Nodes 2.0 group.
browser_tests/tests/creditHelpers.spec.ts Verifies pricing/status badges behavior across compact + hideStatus matrices and live toggles.
browser_tests/fixtures/utils/vueNodeFixtures.ts Adjusts resize drag start point to avoid NW handle/collapse overlap.
browser_tests/fixtures/ComfyPage.ts Sets default values for the new settings in the E2E fixture baseline.

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

Comment on lines +411 to +418
const nodeSizeStyle = computed(() =>
isCollapsed.value
? {}
: {
'--node-width': `${size.value.width}px`,
'--node-height': `${size.value.height + LiteGraph.NODE_TITLE_HEIGHT}px`
}
)
Comment thread src/locales/en/main.json
"Nodes 2_0": "Nodes 2.0",
"VueNodesEnabled": "Modern Node Design",
"CompactCollapsedNodes": "Compact Collapsed Nodes",
"HideStatusBadges": "Hidden Status Badges",
## Gotchas

- `addWidget('combo', name, value, cb, { serialize: false })` puts `serialize` into `widget.options`, **not** onto `widget` directly. These are different properties consumed by different systems.
- `LGraphNode.serialize()` checks `widget.serialize === false` (line 967). It does **not** check `widget.options.serialize`. A widget with `options.serialize = false` is still included in `widgets_values`.
@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:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants