Skip to content

Conversation

@LittleSound
Copy link
Collaborator

@LittleSound LittleSound commented Jan 14, 2026

related #8023, #7812 (comment)

Important

I encountered an issue: layoutStore is specifically designed for Nodes 2.0. After switching to layoutStore, if Nodes 2.0 is not started, it will be impossible to modify the state of Nodes.

┆Issue is synchronized with this Notion page by Unito

@LittleSound LittleSound requested review from a team, Myestery and jtydhr88 as code owners January 14, 2026 12:41
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 14, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

Migrates node mode state management from direct property mutations to a centralized layoutStore system. Adds mode field to NodeLayout with synchronization support, patches LGraphNode.changeMode for store integration, and updates UI components to leverage the store for multi-node operations.

Changes

Cohort / File(s) Summary
Right-side panel settings
src/components/rightSidePanel/settings/SetNodeState.vue
Changed PickedNode type to use id instead of mode. Refactored nodeState getter/setter to work with multiple selected nodes via layoutStore.setNodesMode(), deriving modes from layoutStore references.
Layout store core
src/renderer/core/layout/store/layoutStore.ts, src/renderer/core/layout/types.ts, src/renderer/core/layout/operations/layoutMutations.ts
Added SetNodeModeOperation type and setNodeMode/setNodesMode public methods. Extended node layout initialization to include mode field (default 0). Added handleSetNodeMode private method for CRDT mode updates.
Layout type definitions and mappers
src/renderer/core/layout/utils/mappers.ts
Extended NodeLayout type to include mode property. Updated NODE_LAYOUT_DEFAULTS, layoutToYNode, and yNodeToLayout to serialize/deserialize mode field with fallback default.
Node lifecycle and sync
src/composables/graph/useVueNodeLifecycle.ts, src/renderer/core/layout/sync/patchLGraphNodeMode.ts, src/renderer/core/layout/sync/useLayoutSync.ts
Added patchLGraphNodeMode to intercept LGraphNode.changeMode and sync with layoutStore. Extended node initialization to include mode data. Updated useLayoutSync to synchronize LiteGraph node mode with layout store.
Composables and graph operations
src/composables/canvas/useSelectedLiteGraphItems.ts, src/extensions/core/groupOptions.ts
Replaced direct node.mode mutations with layoutStore.setNodeMode() calls for single-node and subgraph child operations.
LGraphNode core
src/lib/litegraph/src/LGraphNode.ts
Added explicit BYPASS case to switch statements handling LGraphEventMode to prevent unhandled cases.
Tests
src/composables/canvas/useSelectedLiteGraphItems.test.ts, src/renderer/core/layout/store/layoutStore.test.ts, src/renderer/core/layout/utils/layoutMath.test.ts, src/renderer/extensions/minimap/data/MinimapDataSource.test.ts, src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
Updated test fixtures and mocks to include mode: 0 field on NodeLayout objects. Refactored canvas composable tests to use layoutStore.initializeFromLiteGraph and assert mode via layoutStore references.

Sequence Diagram

sequenceDiagram
    participant UI as Right-side Panel
    participant Store as layoutStore
    participant Patch as patchLGraphNodeMode
    participant LNode as LGraphNode
    participant Sync as useLayoutSync

    UI->>Store: setNodesMode(nodeIds, newMode)
    Store->>Store: handleSetNodeMode (update CRDT)
    Store->>Store: emit SetNodeModeOperation

    LNode->>LNode: changeMode(newMode) [direct call]
    activate Patch
    Patch->>LNode: intercept changeMode
    Patch->>Store: setNodeMode(nodeId, newMode)
    Patch->>LNode: call original changeMode
    deactivate Patch

    Sync->>LNode: read layout.mode
    Sync->>LNode: liteNode.changeMode(layout.mode)
    LNode->>Patch: changeMode triggers patch
    Patch->>Store: sync back to layoutStore
Loading

Possibly Related PRs

  • PR #7812: Modifies the same SetNodeState.vue component for right-side panel settings integration with multi-node mode handling.
  • PR #7222: Modifies layoutStore.ts core functionality for node ref and trigger management that directly impacts mode operations.
  • PR #6966: Modifies useVueNodeLifecycle.ts initialization flow to pass node data to layoutStore, touching the same setup lifecycle.

Suggested Reviewers

  • jtydhr88
  • Myestery
✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@github-actions
Copy link

github-actions bot commented Jan 14, 2026

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 01/14/2026, 12:43:19 PM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Jan 14, 2026

🎭 Playwright Tests: ❌ Failed

Results: 493 passed, 5 failed, 2 flaky, 8 skipped (Total: 508)

❌ Failed Tests

📊 Browser Reports
  • chromium: View Report (✅ 483 / ❌ 5 / ⚠️ 1 / ⏭️ 8)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 7 / ❌ 0 / ⚠️ 1 / ⏭️ 0)

@github-actions
Copy link

Bundle Size Report

Summary

  • Raw size: 19.7 MB baseline 19.7 MB — 🔴 +3.05 kB
  • Gzip: 4.01 MB baseline 4.01 MB — 🔴 +620 B
  • Brotli: 3.06 MB baseline 3.06 MB — 🔴 +445 B
  • Bundles: 99 current • 99 baseline • 38 added / 38 removed

Category Glance
App Entry Points 🔴 +2.14 kB (3.34 MB) · Graph Workspace 🔴 +907 B (1.15 MB) · Vendor & Third-Party ⚪ 0 B (9.34 MB) · Other ⚪ 0 B (5.25 MB) · Panels & Settings ⚪ 0 B (372 kB) · UI Components ⚪ 0 B (209 kB) · + 3 more

Per-category breakdown
App Entry Points — 3.34 MB (baseline 3.34 MB) • 🔴 +2.14 kB

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-qsETlimt.js (new) 3.14 MB 🔴 +3.14 MB 🔴 +657 kB 🔴 +499 kB
assets/index-D5EI1yHB.js (removed) 3.14 MB 🟢 -3.14 MB 🟢 -657 kB 🟢 -499 kB
assets/index-B_ctLdWa.js (new) 200 kB 🔴 +200 kB 🔴 +44.1 kB 🔴 +36.4 kB
assets/index-BwngPJX1.js (removed) 200 kB 🟢 -200 kB 🟢 -44.1 kB 🟢 -36.4 kB
assets/index-DehMACf-.js (removed) 345 B 🟢 -345 B 🟢 -246 B 🟢 -238 B
assets/index-DXrhwVKo.js (new) 345 B 🔴 +345 B 🔴 +243 B 🔴 +230 B

Status: 3 added / 3 removed

Graph Workspace — 1.15 MB (baseline 1.15 MB) • 🔴 +907 B

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-CNxHqO-U.js (new) 1.15 MB 🔴 +1.15 MB 🔴 +220 kB 🔴 +165 kB
assets/GraphView-D_WST5MN.js (removed) 1.15 MB 🟢 -1.15 MB 🟢 -219 kB 🟢 -165 kB

Status: 1 added / 1 removed

Views & Navigation — 6.66 kB (baseline 6.66 kB) • ⚪ 0 B

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/UserSelectView-BPtOgeqi.js (removed) 6.66 kB 🟢 -6.66 kB 🟢 -2.16 kB 🟢 -1.91 kB
assets/UserSelectView-D6dZDgmE.js (new) 6.66 kB 🔴 +6.66 kB 🔴 +2.16 kB 🔴 +1.91 kB

Status: 1 added / 1 removed

Panels & Settings — 372 kB (baseline 372 kB) • ⚪ 0 B

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/LegacyCreditsPanel-Caw_vO0T.js (removed) 25.2 kB 🟢 -25.2 kB 🟢 -5.76 kB 🟢 -5.03 kB
assets/LegacyCreditsPanel-Di54ZPmI.js (new) 25.2 kB 🔴 +25.2 kB 🔴 +5.76 kB 🔴 +5.03 kB
assets/KeybindingPanel-B3MKkjV2.js (removed) 14.9 kB 🟢 -14.9 kB 🟢 -3.59 kB 🟢 -3.14 kB
assets/KeybindingPanel-BgTn-7B-.js (new) 14.9 kB 🔴 +14.9 kB 🔴 +3.59 kB 🔴 +3.14 kB
assets/ExtensionPanel-CF31s2R_.js (new) 11.1 kB 🔴 +11.1 kB 🔴 +2.63 kB 🔴 +2.31 kB
assets/ExtensionPanel-DFPXdFO7.js (removed) 11.1 kB 🟢 -11.1 kB 🟢 -2.63 kB 🟢 -2.31 kB
assets/AboutPanel-CRooS6zx.js (removed) 9.2 kB 🟢 -9.2 kB 🟢 -2.48 kB 🟢 -2.22 kB
assets/AboutPanel-CvF8NMET.js (new) 9.2 kB 🔴 +9.2 kB 🔴 +2.47 kB 🔴 +2.23 kB
assets/ServerConfigPanel-CZMEe3oh.js (new) 7.55 kB 🔴 +7.55 kB 🔴 +2.06 kB 🔴 +1.83 kB
assets/ServerConfigPanel-D3oIfuMg.js (removed) 7.55 kB 🟢 -7.55 kB 🟢 -2.06 kB 🟢 -1.83 kB
assets/UserPanel-DC3qyQl1.js (removed) 6.92 kB 🟢 -6.92 kB 🟢 -1.81 kB 🟢 -1.58 kB
assets/UserPanel-NGYTHBR0.js (new) 6.92 kB 🔴 +6.92 kB 🔴 +1.8 kB 🔴 +1.58 kB
assets/settings-BGQfQzTx.js 25.6 kB 25.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BVE4KHTw.js 22.7 kB 22.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BVtpJmlU.js 30.9 kB 30.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-C2aO00Dz.js 28.6 kB 28.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-Cm3ieBXR.js 27.8 kB 27.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CzQKMdK3.js 26.2 kB 26.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CzYUIUnL.js 27.1 kB 27.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DwKpL7jw.js 26.3 kB 26.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DX8feV4n.js 25.3 kB 25.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-mWzYycGc.js 22 kB 22 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-U4AdZ8Rl.js 34.9 kB 34.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 6 added / 6 removed

UI Components — 209 kB (baseline 209 kB) • ⚪ 0 B

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/LazyImage.vue_vue_type_script_setup_true_lang-40Q7jtB2.js (removed) 69.6 kB 🟢 -69.6 kB 🟢 -14.2 kB 🟢 -12.3 kB
assets/LazyImage.vue_vue_type_script_setup_true_lang-C6oJoC6H.js (new) 69.6 kB 🔴 +69.6 kB 🔴 +14.2 kB 🔴 +12.3 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-1FxFGXb7.js (removed) 56.4 kB 🟢 -56.4 kB 🟢 -8.78 kB 🟢 -7.53 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-DsgY8luX.js (new) 56.4 kB 🔴 +56.4 kB 🔴 +8.78 kB 🔴 +7.54 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-BHOZr_az.js (new) 48.1 kB 🔴 +48.1 kB 🔴 +10.4 kB 🔴 +8.99 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-CvTQEUHX.js (removed) 48.1 kB 🟢 -48.1 kB 🟢 -10.4 kB 🟢 -8.99 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-Dhpdcvm3.js (removed) 16.4 kB 🟢 -16.4 kB 🟢 -4.11 kB 🟢 -3.64 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-I6CqlAd6.js (new) 16.4 kB 🔴 +16.4 kB 🔴 +4.11 kB 🔴 +3.65 kB
assets/ComfyQueueButton-9RgKXCsk.js (removed) 8.87 kB 🟢 -8.87 kB 🟢 -2.6 kB 🟢 -2.31 kB
assets/ComfyQueueButton-Cra7c8W4.js (new) 8.87 kB 🔴 +8.87 kB 🔴 +2.6 kB 🔴 +2.32 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-CuxwGFUs.js (removed) 3.75 kB 🟢 -3.75 kB 🟢 -1.47 kB 🟢 -1.33 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-Dl7OHNZv.js (new) 3.75 kB 🔴 +3.75 kB 🔴 +1.47 kB 🔴 +1.33 kB
assets/WidgetButton-Dp1ka58S.js (new) 2.25 kB 🔴 +2.25 kB 🔴 +1.01 kB 🔴 +906 B
assets/WidgetButton-DZWSoWC3.js (removed) 2.25 kB 🟢 -2.25 kB 🟢 -1.01 kB 🟢 -910 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-B15A5Xhy.js (new) 2.14 kB 🔴 +2.14 kB 🔴 +891 B 🔴 +761 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-BaRYkl3P.js (removed) 2.14 kB 🟢 -2.14 kB 🟢 -891 B 🟢 -771 B
assets/UserAvatar.vue_vue_type_script_setup_true_lang-IJTLOeU1.js 1.34 kB 1.34 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 8 added / 8 removed

Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 B

Stores, services, APIs, and repositories

File Before After Δ Raw Δ Gzip Δ Brotli
assets/keybindingService-8GH4Ssx-.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -1.83 kB 🟢 -1.58 kB
assets/keybindingService-B-hWaTys.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +1.83 kB 🔴 +1.57 kB
assets/audioService-BvnUDSdf.js (new) 2.2 kB 🔴 +2.2 kB 🔴 +957 B 🔴 +821 B
assets/audioService-nCOpZ4Ck.js (removed) 2.2 kB 🟢 -2.2 kB 🟢 -964 B 🟢 -828 B
assets/serverConfigStore-DyIvWaGz.js 2.83 kB 2.83 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 2 added / 2 removed

Utilities & Hooks — 1.41 kB (baseline 1.41 kB) • ⚪ 0 B

Helpers, composables, and utility bundles

File Before After Δ Raw Δ Gzip Δ Brotli
assets/audioUtils-BXv0YjYV.js (removed) 1.41 kB 🟢 -1.41 kB 🟢 -653 B 🟢 -543 B
assets/audioUtils-CzXjH90E.js (new) 1.41 kB 🔴 +1.41 kB 🔴 +651 B 🔴 +543 B

Status: 1 added / 1 removed

Vendor & Third-Party — 9.34 MB (baseline 9.34 MB) • ⚪ 0 B

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-chart-DZdD68iT.js 452 kB 452 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-other-C9GFBFnP.js 3.93 MB 3.93 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-NX-4NPlN.js 1.95 MB 1.95 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-reka-ui-7Sidv1he.js 111 kB 111 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-Bz1zdJb0.js 2.08 MB 2.08 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-DFkXpum7.js 232 kB 232 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-DMH2Ziq4.js 165 kB 165 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-xterm-BF8peZ5_.js 420 kB 420 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Other — 5.25 MB (baseline 5.25 MB) • ⚪ 0 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/SubscriptionRequiredDialogContent-BvbvWynK.js (removed) 29.4 kB 🟢 -29.4 kB 🟢 -6.52 kB 🟢 -5.67 kB
assets/SubscriptionRequiredDialogContent-m6FVlswg.js (new) 29.4 kB 🔴 +29.4 kB 🔴 +6.53 kB 🔴 +5.67 kB
assets/WidgetRecordAudio-C1t-_uuI.js (new) 20.5 kB 🔴 +20.5 kB 🔴 +5.25 kB 🔴 +4.65 kB
assets/WidgetRecordAudio-D3ctsdUL.js (removed) 20.5 kB 🟢 -20.5 kB 🟢 -5.25 kB 🟢 -4.65 kB
assets/AudioPreviewPlayer--jpgfdfy.js (removed) 13.4 kB 🟢 -13.4 kB 🟢 -3.36 kB 🟢 -3.02 kB
assets/AudioPreviewPlayer-JUAbUWqj.js (new) 13.4 kB 🔴 +13.4 kB 🔴 +3.37 kB 🔴 +3.01 kB
assets/ValueControlPopover-D6NOGG_6.js (new) 5.53 kB 🔴 +5.53 kB 🔴 +1.72 kB 🔴 +1.54 kB
assets/ValueControlPopover-DfiQL_Ec.js (removed) 5.53 kB 🟢 -5.53 kB 🟢 -1.72 kB 🟢 -1.53 kB
assets/WidgetGalleria-COWeMCgW.js (removed) 4.14 kB 🟢 -4.14 kB 🟢 -1.46 kB 🟢 -1.32 kB
assets/WidgetGalleria-pNo3Hpoo.js (new) 4.14 kB 🔴 +4.14 kB 🔴 +1.46 kB 🔴 +1.32 kB
assets/WidgetColorPicker-DQTSvMuR.js (new) 3.44 kB 🔴 +3.44 kB 🔴 +1.4 kB 🔴 +1.25 kB
assets/WidgetColorPicker-DRdtabWC.js (removed) 3.44 kB 🟢 -3.44 kB 🟢 -1.4 kB 🟢 -1.25 kB
assets/WidgetTextarea-3kHDaZqx.js (new) 3.12 kB 🔴 +3.12 kB 🔴 +1.23 kB 🔴 +1.11 kB
assets/WidgetTextarea-DHhQ3Cdi.js (removed) 3.12 kB 🟢 -3.12 kB 🟢 -1.23 kB 🟢 -1.11 kB
assets/WidgetMarkdown-B83r4lp_.js (removed) 3.12 kB 🟢 -3.12 kB 🟢 -1.29 kB 🟢 -1.14 kB
assets/WidgetMarkdown-YU6AW3L-.js (new) 3.12 kB 🔴 +3.12 kB 🔴 +1.3 kB 🔴 +1.14 kB
assets/WidgetAudioUI-B-rfMLTB.js (removed) 2.93 kB 🟢 -2.93 kB 🟢 -1.18 kB 🟢 -1.07 kB
assets/WidgetAudioUI-C-dn4V9V.js (new) 2.93 kB 🔴 +2.93 kB 🔴 +1.19 kB 🔴 +1.07 kB
assets/WidgetToggleSwitch-B0huoN91.js (new) 2.7 kB 🔴 +2.7 kB 🔴 +1.14 kB 🔴 +1.02 kB
assets/WidgetToggleSwitch-CORfp_aB.js (removed) 2.7 kB 🟢 -2.7 kB 🟢 -1.14 kB 🟢 -1.03 kB
assets/WidgetInputText-BusEilc1.js (removed) 2.03 kB 🟢 -2.03 kB 🟢 -935 B 🟢 -872 B
assets/WidgetInputText-DgomZlMC.js (new) 2.03 kB 🔴 +2.03 kB 🔴 +936 B 🔴 +870 B
assets/Media3DTop-C_Xesf-B.js (removed) 1.53 kB 🟢 -1.53 kB 🟢 -778 B 🟢 -666 B
assets/Media3DTop-DoaLXEjo.js (new) 1.53 kB 🔴 +1.53 kB 🔴 +778 B 🔴 +671 B
assets/WidgetSelect-Dcr_vrvl.js (removed) 772 B 🟢 -772 B 🟢 -376 B 🟢 -343 B
assets/WidgetSelect-PtxHwTf3.js (new) 772 B 🔴 +772 B 🔴 +378 B 🔴 +349 B
assets/WidgetInputNumber-CCKOqq4b.js (new) 712 B 🔴 +712 B 🔴 +366 B 🔴 +323 B
assets/WidgetInputNumber-DqJoZ6Kk.js (removed) 712 B 🟢 -712 B 🟢 -363 B 🟢 -327 B
assets/Load3D-88GW5trJ.js (new) 463 B 🔴 +463 B 🔴 +283 B 🔴 +238 B
assets/Load3D-Dep3RcfE.js (removed) 463 B 🟢 -463 B 🟢 -283 B 🟢 -238 B
assets/WidgetLegacy-Duz4cnZB.js (removed) 403 B 🟢 -403 B 🟢 -251 B 🟢 -212 B
assets/WidgetLegacy-u27kHM9B.js (new) 403 B 🔴 +403 B 🔴 +252 B 🔴 +213 B
assets/commands-B32ZbeYu.js 16.5 kB 16.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-B7wQT83I.js 17 kB 17 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BK3JVjMG.js 15.7 kB 15.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-C6twMpaZ.js 15.5 kB 15.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CDUWpEwM.js 18.3 kB 18.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CfZ6FPZ-.js 15.7 kB 15.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-COIPP_pv.js 17 kB 17 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CoPn_77e.js 14.7 kB 14.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CuRNS4XD.js 14.9 kB 14.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DBHjCSPA.js 16.2 kB 16.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DZJaRLKH.js 15.7 kB 15.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-8eC7XcBf.js 95 kB 95 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BpcYE6Bq.js 109 kB 109 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BRhbiQsB.js 129 kB 129 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BrWdnTiG.js 113 kB 113 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-C-cUNbuc.js 123 kB 123 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CGe0e9vH.js 106 kB 106 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Cv9Dlj-b.js 107 kB 107 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CzsdJqwO.js 94.3 kB 94.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Dbu4m_fl.js 133 kB 133 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DwAX_AEJ.js 149 kB 149 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-kiVYDd2_.js 110 kB 110 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaAudioTop-DUiRGHAk.js 1.46 kB 1.46 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageTop-bDoNEAep.js 1.75 kB 1.75 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoTop-BrNs2ijx.js 2.65 kB 2.65 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-B-XzzBeS.js 317 kB 317 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BGwoeek4.js 329 kB 329 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-C6xl5-mL.js 358 kB 358 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CRZGOJB7.js 310 kB 310 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-D8-Yzlzh.js 289 kB 289 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Du8VrAwA.js 320 kB 320 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-jjlLVrIs.js 317 kB 317 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-JQwk1kgy.js 292 kB 292 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-JuuXdMpv.js 391 kB 391 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-l2Y20bod.js 314 kB 314 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-VLMdhOwo.js 357 kB 357 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/OBJLoader2WorkerModule-DTMpvldF.js 109 kB 109 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetChart-CTa5K4p_.js 2.48 kB 2.48 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetImageCompare-BAyqYPiH.js 3.21 kB 3.21 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widgetPropFilter-BIbGSUAt.js 1.28 kB 1.28 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 16 added / 16 removed

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@src/composables/canvas/useSelectedLiteGraphItems.ts`:
- Line 148: The loop currently calls layoutStore.setNodeMode(node.id.toString(),
newModeForSelectedNode) for each child which is inefficient for large subgraphs;
modify the traversal in useSelectedLiteGraphItems.ts to collect a map/object of
child node IDs to newModeForSelectedNode (use node.id.toString() as the key) and
after traversal call layoutStore.setNodesMode(collectedMap) once; keep the
existing per-node logic to determine newModeForSelectedNode but replace
individual setNodeMode calls with building the map and a single batch
setNodesMode call.

In `@src/extensions/core/groupOptions.ts`:
- Around line 16-18: The current setNodeMode(node: LGraphNode, mode: number)
delegates to layoutStore.setNodeMode for single-node updates; when you change
mode for an entire group, replace the per-node loop with a single batch call to
layoutStore.setNodesMode(idsArray, mode) to avoid repetitive store writes—keep
setNodeMode for individual updates but modify the group callbacks (where you
currently iterate nodes and call setNodeMode) to collect node.id strings into an
array and call layoutStore.setNodesMode once with that array and the new mode.

In `@src/renderer/core/layout/store/layoutStore.ts`:
- Around line 1487-1499: The setNodesMode method currently calls setNodeMode for
each node causing N operations/notifications; replace this with a single batched
operation following the batchUpdateNodeBounds pattern: create a
BatchSetNodeModeOperation (or similar) that takes nodeIds and mode, applies mode
to each node in one atomic update, increments the store version once, and emits
a single change/notification; update setNodesMode to construct and push/commit
that batch operation (refer to setNodesMode, setNodeMode, batchUpdateNodeBounds,
and the new BatchSetNodeModeOperation) so large selections perform efficiently.

In `@src/renderer/core/layout/utils/mappers.ts`:
- Line 13: Replace the magic number assignment "mode: 0" in the mapper object
with the enum value LGraphEventMode.ALWAYS and add an import for LGraphEventMode
from "@/lib/litegraph/src/litegraph"; locate the occurrence of "mode: 0" in
mappers.ts and change it to "mode: LGraphEventMode.ALWAYS", then add the named
import (or extend an existing import) for LGraphEventMode at the top of the file
so the enum is referenced instead of the hardcoded 0.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6382b1e and 719d062.

📒 Files selected for processing (16)
  • src/components/rightSidePanel/settings/SetNodeState.vue
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/extensions/core/groupOptions.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/store/layoutStore.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
🧰 Additional context used
📓 Path-based instructions (18)
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/components/rightSidePanel/settings/SetNodeState.vue
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

src/**/*.ts: Derive component types using vue-component-type-helpers (ComponentProps, ComponentSlots) instead of separate type files
Use es-toolkit for utility functions
Minimize the surface area (exported values) of each module and composable
Favor pure functions, especially testable ones

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
src/**/{services,composables}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/{services,composables}/**/*.{ts,tsx}: Use api.apiURL() for backend endpoints instead of constructing URLs directly
Use api.fileURL() for static file access instead of constructing URLs directly

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/composables/graph/useVueNodeLifecycle.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

src/**/*.{ts,tsx,vue}: Use separate import type statements instead of inline type in mixed imports
Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, 80-character width
Sort and group imports by plugin, run pnpm format before committing
Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue
Write code that is expressive and self-documenting - avoid unnecessary comments
Do not add or retain redundant comments - clean as you go
Avoid mutable state - prefer immutability and assignment at point of declaration
Watch out for Code Smells and refactor to avoid them

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/components/rightSidePanel/settings/SetNodeState.vue
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
src/**/{composables,components}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Clean up subscriptions in state management to prevent memory leaks

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/components/rightSidePanel/settings/SetNodeState.vue
  • src/composables/graph/useVueNodeLifecycle.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/components/rightSidePanel/settings/SetNodeState.vue
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
src/**/{components,composables}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Use vue-i18n for ALL user-facing strings by adding them to src/locales/en/main.json

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/components/rightSidePanel/settings/SetNodeState.vue
  • src/composables/graph/useVueNodeLifecycle.ts
+(tests-ui|src)/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

+(tests-ui|src)/**/*.test.ts: Unit and component tests belong in tests-ui/ or src/**/*.test.ts using Vitest
Write tests for all changes, especially bug fixes to catch future regressions
Do not write tests dependent on non-behavioral features like utility classes or styles
Do not write tests that just test the mocks - ensure tests fail when code behaves unexpectedly
Leverage Vitest's utilities for mocking where possible
Keep module mocks contained - do not use global mutable state within test files; use vi.hoisted() if necessary
Use Vue Test Utils for Component testing and follow best practices for making components easy to test
Aim for behavioral coverage of critical and new features in unit tests

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
src/**/*.{ts,vue}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,vue}: Use ref for reactive state, computed() for derived values, and watch/watchEffect for side effects in Composition API
Avoid using ref with watch if a computed would suffice - minimize refs and derived state
Use provide/inject for dependency injection only when simpler alternatives (Store or shared composable) won't work
Leverage VueUse functions for performance-enhancing composables
Use VueUse function for useI18n in composition API for string literals

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/components/rightSidePanel/settings/SetNodeState.vue
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx}: Keep functions short and functional
Minimize nesting (if statements, for loops, etc.)
Use function declarations instead of function expressions when possible

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
+(tests-ui|src|browser_tests)/**/*.+(test.ts|spec.ts)

📄 CodeRabbit inference engine (AGENTS.md)

+(tests-ui|src|browser_tests)/**/*.+(test.ts|spec.ts): Do not write change detector tests - avoid tests that only assert default values
Be parsimonious in testing - do not write redundant tests
Don't Mock What You Don't Own

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
src/composables/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables as useXyz.ts (e.g., useForm.ts)

Files:

  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/composables/graph/useVueNodeLifecycle.ts
src/**/*.vue

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.vue: Use the Vue 3 Composition API instead of the Options API when writing Vue components (exception: when overriding or extending PrimeVue components for compatibility)
Use setup() function for component logic
Utilize ref and reactive for reactive state
Implement computed properties with computed()
Use watch and watchEffect for side effects
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection
Use vue 3.5 style of default prop declaration
Use Tailwind CSS for styling
Implement proper props and emits definitions
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventions

src/**/*.vue: Use Vue 3 Single File Components (SFCs) with Composition API only
Use <script setup lang="ts"> for component logic in Vue SFCs
Avoid <style> blocks in Vue components - use Tailwind 4 styling instead
Use vue-i18n for all string literals in Vue components - place translation entries in src/locales/en/main.json
Use Tailwind utility classes instead of dark: variant - use semantic values from style.css theme (e.g., bg-node-component-surface)
Use cn() utility from @/utils/tailwindUtil for merging Tailwind class names instead of :class="[]" or hardcoding
Never use !important or ! Tailwind prefix - fix interfering classes instead
Use Tailwind fraction utilities instead of arbitrary percentage values (e.g., w-4/5 instead of w-[80%])
Use TypeScript Vue 3.5 style default prop declaration with reactive props destructuring - avoid withDefaults or runtime props
Prefer defineModel over separately defining a prop and emit for v-model bindings
Define slots via template usage, not via defineSlots
Use same-name shorthand for slot prop bindings (e.g., :isExpanded instead of :is-expanded="isExpanded")
Do not import Vue macros unnecessarily
Avoid new usage of PrimeVue components
Use Tailwind's plurals system via i18n instead of hardcoding ...

Files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
src/components/**/*.vue

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.vue: Use setup() function in Vue 3 Composition API
Destructure props using Vue 3.5 style in Vue components
Use ref/reactive for state management in Vue 3 Composition API
Implement computed() for derived state in Vue 3 Composition API
Use provide/inject for dependency injection in Vue components
Prefer emit/@event-name for state changes over other communication patterns
Use defineExpose only for imperative operations (such as form.validate(), modal.open())
Replace PrimeVue Dropdown component with Select
Replace PrimeVue OverlayPanel component with Popover
Replace PrimeVue Calendar component with DatePicker
Replace PrimeVue InputSwitch component with ToggleSwitch
Replace PrimeVue Sidebar component with Drawer
Replace PrimeVue Chips component with AutoComplete with multiple enabled
Replace PrimeVue TabMenu component with Tabs without panels
Replace PrimeVue Steps component with Stepper without panels
Replace PrimeVue InlineMessage component with Message
Extract complex conditionals to computed properties
Implement cleanup for async operations in Vue components
Use lifecycle hooks: onMounted, onUpdated in Vue 3 Composition API
Use Teleport/Suspense when needed for component rendering
Define proper props and emits definitions in Vue components

Name Vue components in PascalCase (e.g., MenuHamburger.vue)

Files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
src/components/**/*.{vue,css}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,css}: Use Tailwind CSS only for styling (no custom CSS)
Use the correct tokens from style.css in the design system package

Files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
src/components/**/*.{vue,ts,js}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,ts,js}: Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners
Use useIntersectionObserver for visibility detection instead of custom scroll handlers
Use vue-i18n for ALL UI strings

Files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
src/lib/litegraph/**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (src/lib/litegraph/CLAUDE.md)

src/lib/litegraph/**/*.{js,ts,jsx,tsx}: Run ESLint instead of manually figuring out whitespace fixes or other trivial style concerns using the pnpm lint:fix command
Take advantage of TypedArray subarray when appropriate
The size and pos properties of Rectangle share the same array buffer (subarray); they may be used to set the rectangle's size and position
Prefer single line if syntax over adding curly braces, when the statement has a very concise expression and concise, single line statement
Do not replace &&= or ||= with = when there is no reason to do so. If you do find a reason to remove either &&= or ||=, leave a comment explaining why the removal occurred
When writing methods, prefer returning idiomatic JavaScript undefined over null

Files:

  • src/lib/litegraph/src/LGraphNode.ts
src/lib/litegraph/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/lib/litegraph/CLAUDE.md)

Type assertions are an absolute last resort. In almost all cases, they are a crutch that leads to brittle code

Files:

  • src/lib/litegraph/src/LGraphNode.ts
🧠 Learnings (39)
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{test,spec}.{ts,tsx} : Use provided test helpers `createTestSubgraph` and `createTestSubgraphNode` from `./fixtures/subgraphHelpers` for consistent subgraph test setup

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to +(tests-ui|src)/**/*.test.ts : Leverage Vitest's utilities for mocking where possible

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to +(tests-ui|src)/**/*.test.ts : Keep module mocks contained - do not use global mutable state within test files; use `vi.hoisted()` if necessary

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
📚 Learning: 2026-01-09T02:07:54.558Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7898
File: src/composables/usePaste.test.ts:248-248
Timestamp: 2026-01-09T02:07:54.558Z
Learning: In test files (e.g., any .test.ts or .test.tsx under src/...), when you create mock objects that partially implement an interface (such as LGraphNode), prefer casting with as Partial<InterfaceType> as InterfaceType rather than as any or as unknown as InterfaceType. This makes the incomplete implementation explicit while preserving type safety, improving readability and maintainability of tests.

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to +(tests-ui|src|browser_tests)/**/*.+(test.ts|spec.ts) : Do not write change detector tests - avoid tests that only assert default values

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to +(tests-ui|src)/**/*.test.ts : Write tests for all changes, especially bug fixes to catch future regressions

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
📚 Learning: 2026-01-08T02:40:15.482Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7894
File: src/renderer/extensions/vueNodes/widgets/components/WidgetToggleSwitch.test.ts:11-14
Timestamp: 2026-01-08T02:40:15.482Z
Learning: In TypeScript test files (e.g., any test under src), avoid duplicating interface/type definitions. Import real type definitions from the component modules under test and reference them directly, so there is a single source of truth and to prevent type drift. This improves maintainability and consistency across tests.

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to +(tests-ui|src)/**/*.test.ts : Do not write tests that just test the mocks - ensure tests fail when code behaves unexpectedly

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to +(tests-ui|src)/**/*.test.ts : Use Vue Test Utils for Component testing and follow best practices for making components easy to test

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to +(tests-ui|src|browser_tests)/**/*.+(test.ts|spec.ts) : Don't Mock What You Don't Own

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-12-09T03:39:54.501Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7169
File: src/platform/remote/comfyui/jobs/jobTypes.ts:1-107
Timestamp: 2025-12-09T03:39:54.501Z
Learning: In the ComfyUI_frontend project, Zod is on v3.x. Do not suggest Zod v4 standalone validators (z.uuid, z.ulid, z.cuid2, z.nanoid) until an upgrade to Zod 4 is performed. When reviewing TypeScript files (e.g., src/platform/remote/comfyui/jobs/jobTypes.ts) validate against Zod 3 capabilities and avoid introducing v4-specific features; flag any proposal to upgrade or incorporate v4-only validators and propose staying with compatible 3.x patterns.

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
📚 Learning: 2025-12-13T11:03:11.264Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7416
File: src/stores/imagePreviewStore.ts:5-7
Timestamp: 2025-12-13T11:03:11.264Z
Learning: In the ComfyUI_frontend repository, lint rules require keeping 'import type' statements separate from non-type imports, even if importing from the same module. Do not suggest consolidating them into a single import statement. Ensure type imports remain on their own line (import type { ... } from 'module') and regular imports stay on separate lines.

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
📚 Learning: 2025-12-17T00:40:09.635Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.stories.ts:45-55
Timestamp: 2025-12-17T00:40:09.635Z
Learning: Prefer pure function declarations over function expressions (e.g., use function foo() { ... } instead of const foo = () => { ... }) for pure functions in the repository. Function declarations are more functional-leaning, offer better hoisting clarity, and can improve readability and tooling consistency. Apply this guideline across TypeScript files in Comfy-Org/ComfyUI_frontend, including story and UI component code, except where a function expression is semantically required (e.g., callbacks, higher-order functions with closures).

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
📚 Learning: 2025-12-30T22:22:33.836Z
Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 7805
File: src/composables/useCoreCommands.ts:439-439
Timestamp: 2025-12-30T22:22:33.836Z
Learning: When accessing reactive properties from Pinia stores in TypeScript files, avoid using .value on direct property access (e.g., useStore().isOverlayExpanded). Pinia auto-wraps refs when accessed directly, returning the primitive value. The .value accessor is only needed when destructuring store properties or when using storeToRefs().

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
📚 Learning: 2025-12-10T03:09:13.807Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7303
File: src/components/topbar/CurrentUserPopover.test.ts:199-205
Timestamp: 2025-12-10T03:09:13.807Z
Learning: In test files, prefer selecting or asserting on accessible properties (text content, aria-label, role, accessible name) over data-testid attributes. This ensures tests validate actual user-facing behavior and accessibility, reducing reliance on implementation details like test IDs.

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
📚 Learning: 2025-12-30T01:31:04.927Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7797
File: tests-ui/tests/lib/litegraph/src/widgets/ComboWidget.test.ts:648-648
Timestamp: 2025-12-30T01:31:04.927Z
Learning: In Vitest v4, when mocking functions that may be called as constructors (using new), the mock implementation must use function() or class syntax rather than an arrow function. Arrow mocks can cause '<anonymous> is not a constructor' errors. This is a breaking change from Vitest v3 where mocks could use an arrow function. Apply this guideline to test files that mock constructor-like calls (e.g., in tests under tests-ui, such as ComboWidget.test.ts) and ensure mock implementations are defined with function() { ... } or class { ... } to preserve constructor behavior.

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
📚 Learning: 2025-12-11T12:25:15.470Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7358
File: src/components/dialog/content/signin/SignUpForm.vue:45-54
Timestamp: 2025-12-11T12:25:15.470Z
Learning: This repository uses CI automation to format code (pnpm format). Do not include manual formatting suggestions in code reviews for Comfy-Org/ComfyUI_frontend. If formatting issues are detected, rely on the CI formatter or re-run pnpm format. Focus reviews on correctness, readability, performance, accessibility, and maintainability rather than style formatting.

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/components/rightSidePanel/settings/SetNodeState.vue
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
📚 Learning: 2026-01-12T17:39:27.738Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7906
File: src/components/sidebar/tabs/AssetsSidebarTab.vue:545-552
Timestamp: 2026-01-12T17:39:27.738Z
Learning: In Vue/TypeScript files (src/**/*.{ts,tsx,vue}), prefer if/else statements over ternary operators when performing side effects or actions (e.g., mutating state, calling methods with side effects). Ternaries should be reserved for computing and returning values.

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/core/layout/sync/patchLGraphNodeMode.ts
  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/renderer/core/layout/store/layoutStore.test.ts
  • src/renderer/core/layout/operations/layoutMutations.ts
  • src/extensions/core/groupOptions.ts
  • src/renderer/extensions/minimap/data/MinimapDataSource.test.ts
  • src/renderer/core/layout/sync/useLayoutSync.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/components/rightSidePanel/settings/SetNodeState.vue
  • src/lib/litegraph/src/LGraphNode.ts
  • src/renderer/core/layout/utils/mappers.ts
  • src/renderer/core/layout/utils/layoutMath.test.ts
  • src/composables/graph/useVueNodeLifecycle.ts
  • src/renderer/core/layout/types.ts
  • src/renderer/core/layout/store/layoutStore.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{test,spec}.{ts,tsx} : When writing tests for subgraph-related code, always import from the barrel export at `@/lib/litegraph/src/litegraph` to avoid circular dependency issues

Applied to files:

  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/lib/litegraph/src/LGraphNode.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{test,spec}.{js,ts,jsx,tsx} : When adding features, always write vitest unit tests using cursor rules in @.cursor

Applied to files:

  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{js,ts,jsx,tsx} : Take advantage of `TypedArray` `subarray` when appropriate

Applied to files:

  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{js,ts,jsx,tsx} : Do not replace `&&=` or `||=` with `=` when there is no reason to do so. If you do find a reason to remove either `&&=` or `||=`, leave a comment explaining why the removal occurred

Applied to files:

  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/lib/litegraph/src/LGraphNode.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{js,ts,jsx,tsx} : The `size` and `pos` properties of `Rectangle` share the same array buffer (`subarray`); they may be used to set the rectangle's size and position

Applied to files:

  • src/composables/canvas/useSelectedLiteGraphItems.test.ts
  • src/composables/canvas/useSelectedLiteGraphItems.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{ts,tsx} : Type assertions are an absolute last resort. In almost all cases, they are a crutch that leads to brittle code

Applied to files:

  • src/composables/canvas/useSelectedLiteGraphItems.ts
  • src/lib/litegraph/src/LGraphNode.ts
📚 Learning: 2025-12-04T21:43:49.363Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7137
File: src/components/rightSidePanel/parameters/TabParameters.vue:10-0
Timestamp: 2025-12-04T21:43:49.363Z
Learning: Vue 3.5+ supports reactive props destructure in <script setup>. Destructuring props directly (e.g., `const { nodes } = defineProps<{ nodes: LGraphNode[] }>()`) maintains reactivity through compiler transformation. This is the recommended modern approach and does not require using `props.x` or `toRef`/`toRefs`.

Applied to files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
📚 Learning: 2025-12-09T03:49:52.828Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/platform/updates/components/WhatsNewPopup.vue:5-13
Timestamp: 2025-12-09T03:49:52.828Z
Learning: In Vue files across the ComfyUI_frontend repo, when a button is needed, prefer the repo's common button components from src/components/button/ (IconButton.vue, TextButton.vue, IconTextButton.vue) over plain HTML <button> elements. These components wrap PrimeVue with the project’s design system styling. Use only the common button components for consistency and theming, and import them from src/components/button/ as needed.

Applied to files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
📚 Learning: 2025-12-09T21:40:12.361Z
Learnt from: benceruleanlu
Repo: Comfy-Org/ComfyUI_frontend PR: 7297
File: src/components/actionbar/ComfyActionbar.vue:33-43
Timestamp: 2025-12-09T21:40:12.361Z
Learning: In Vue single-file components, allow inline Tailwind CSS class strings for static classes and avoid extracting them into computed properties solely for readability. Prefer keeping static class names inline for simplicity and performance. For dynamic or conditional classes, use Vue bindings (e.g., :class) to compose classes.

Applies to all Vue files in the repository (e.g., src/**/*.vue) where Tailwind utilities are used for static styling.

Applied to files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
📚 Learning: 2025-12-16T22:26:49.463Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.vue:17-17
Timestamp: 2025-12-16T22:26:49.463Z
Learning: In Vue 3.5+ with <script setup>, when using defineProps<Props>() with partial destructuring (e.g., const { as = 'button', class: customClass = '' } = defineProps<Props>() ), props that are not destructured (e.g., variant, size) stay accessible by name in the template scope. This pattern is valid: you can destructure only a subset of props for convenience while referencing the remaining props directly in template expressions. Apply this guideline to Vue components across the codebase (all .vue files).

Applied to files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
📚 Learning: 2025-12-22T21:36:08.369Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7649
File: src/platform/cloud/subscription/components/PricingTable.vue:185-201
Timestamp: 2025-12-22T21:36:08.369Z
Learning: In Vue components, avoid creating single-use variants for common UI components (e.g., Button and other shared components). Aim for reusable variants that cover multiple use cases. It’s acceptable to temporarily mix variant props with inline Tailwind classes when a styling need is unique to one place, but plan and consolidate into shared, reusable variants as patterns emerge across the codebase.

Applied to files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
📚 Learning: 2026-01-08T02:26:18.357Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7893
File: src/components/button/IconGroup.vue:5-6
Timestamp: 2026-01-08T02:26:18.357Z
Learning: In components that use the cn utility from '@/utils/tailwindUtil' with tailwind-merge, rely on the behavior that conflicting Tailwind classes are resolved by keeping the last one. For example, cn('base-classes bg-default', propClass) will have any conflicting background class from propClass override bg-default. This additive pattern is intentional and aligns with the shadcn-ui convention; ensure you document or review expectations accordingly in Vue components.

Applied to files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
📚 Learning: 2025-12-18T02:07:38.870Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7598
File: src/components/sidebar/tabs/AssetsSidebarTab.vue:131-131
Timestamp: 2025-12-18T02:07:38.870Z
Learning: Tailwind CSS v4 safe utilities (e.g., items-center-safe, justify-*-safe, place-*-safe) are allowed in Vue components under src/ and in story files. Do not flag these specific safe variants as invalid when reviewing code in src/**/*.vue or related stories.

Applied to files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
📚 Learning: 2025-12-18T21:15:46.862Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7603
File: src/components/queue/QueueOverlayHeader.vue:49-59
Timestamp: 2025-12-18T21:15:46.862Z
Learning: In the ComfyUI_frontend repository, for Vue components, do not add aria-label to buttons that have visible text content (e.g., buttons containing <span> text). The visible text provides the accessible name. Use aria-label only for elements without visible labels (e.g., icon-only buttons). If a button has no visible label, provide a clear aria-label or associate with an aria-labelledby describing its action.

Applied to files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
📚 Learning: 2025-12-21T01:06:02.786Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7649
File: src/components/graph/selectionToolbox/ColorPickerButton.vue:15-18
Timestamp: 2025-12-21T01:06:02.786Z
Learning: In Comfy-Org/ComfyUI_frontend, in Vue component files, when a filled icon is required (e.g., 'pi pi-circle-fill'), you may mix PrimeIcons with Lucide icons since Lucide lacks filled variants. This mixed usage is acceptable when one icon library does not provide an equivalent filled icon. Apply consistently across Vue components in the src directory where icons are used, and document the rationale when a mixed approach is chosen.

Applied to files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
📚 Learning: 2025-12-18T16:03:02.066Z
Learnt from: henrikvilhelmberglund
Repo: Comfy-Org/ComfyUI_frontend PR: 7617
File: src/components/actionbar/ComfyActionbar.vue:301-308
Timestamp: 2025-12-18T16:03:02.066Z
Learning: In the ComfyUI frontend queue system, useQueuePendingTaskCountStore().count indicates the number of tasks in the queue, where count = 1 means a single active/running task and count > 1 means there are pending tasks in addition to the active task. Therefore, in src/components/actionbar/ComfyActionbar.vue, enable the 'Clear Pending Tasks' button only when count > 1 to avoid clearing the currently running task. The active task should be canceled using the 'Cancel current run' button instead. This rule should be enforced via a conditional check on the queue count, with appropriate disabled/aria-disabled states for accessibility, and tests should verify behavior for count = 1 and count > 1.

Applied to files:

  • src/components/rightSidePanel/settings/SetNodeState.vue
📚 Learning: 2026-01-09T02:07:59.035Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7898
File: src/composables/usePaste.test.ts:248-248
Timestamp: 2026-01-09T02:07:59.035Z
Learning: In test files at src/**/*.test.ts, when creating mock objects that partially implement an interface (e.g., LGraphNode), use `as Partial<InterfaceType> as InterfaceType` instead of `as any` or `as unknown as InterfaceType` to explicitly acknowledge the incomplete implementation while maintaining type safety.

Applied to files:

  • src/lib/litegraph/src/LGraphNode.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{js,ts,jsx,tsx} : Prefer single line `if` syntax over adding curly braces, when the statement has a very concise expression and concise, single line statement

Applied to files:

  • src/lib/litegraph/src/LGraphNode.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to +(tests-ui|src)/**/*.test.ts : Do not write tests dependent on non-behavioral features like utility classes or styles

Applied to files:

  • src/renderer/core/layout/utils/layoutMath.test.ts
📚 Learning: 2025-12-11T03:55:57.926Z
Learnt from: simula-r
Repo: Comfy-Org/ComfyUI_frontend PR: 7252
File: src/renderer/extensions/vueNodes/components/ImagePreview.vue:151-158
Timestamp: 2025-12-11T03:55:57.926Z
Learning: In src/renderer/extensions/vueNodes/components/ImagePreview.vue and LGraphNode.vue, keyboard navigation for image galleries should respond to node-level focus (via keyEvent injection from LGraphNode), not require focus within the image preview wrapper itself. This allows users to navigate the gallery with arrow keys immediately when the node is focused/selected.

Applied to files:

  • src/composables/graph/useVueNodeLifecycle.ts
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.{vue,ts} : Leverage VueUse functions for performance-enhancing styles

Applied to files:

  • src/composables/graph/useVueNodeLifecycle.ts
🧬 Code graph analysis (6)
src/renderer/core/layout/sync/patchLGraphNodeMode.ts (2)
src/lib/litegraph/src/LGraphNode.ts (4)
  • LGraphNode (213-215)
  • LGraphNode (225-4199)
  • LGraphNode (746-754)
  • LGraphNode (756-762)
src/renderer/core/layout/store/layoutStore.ts (1)
  • layoutStore (1555-1555)
src/extensions/core/groupOptions.ts (3)
src/renderer/core/layout/store/layoutStore.ts (2)
  • setNodeMode (1468-1485)
  • layoutStore (1555-1555)
src/lib/litegraph/src/LGraphNode.ts (4)
  • LGraphNode (213-215)
  • LGraphNode (225-4199)
  • LGraphNode (746-754)
  • LGraphNode (756-762)
src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts (1)
  • mode (80-82)
src/composables/canvas/useSelectedLiteGraphItems.ts (3)
src/renderer/core/layout/store/layoutStore.ts (1)
  • layoutStore (1555-1555)
src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts (1)
  • mode (80-82)
src/lib/litegraph/src/litegraph.ts (1)
  • LGraphEventMode (127-127)
src/lib/litegraph/src/LGraphNode.ts (1)
src/lib/litegraph/src/litegraph.ts (1)
  • LGraphEventMode (127-127)
src/composables/graph/useVueNodeLifecycle.ts (1)
src/renderer/core/layout/sync/patchLGraphNodeMode.ts (1)
  • patchLGraphNodeMode (15-33)
src/renderer/core/layout/store/layoutStore.ts (4)
src/renderer/core/layout/types.ts (2)
  • SetNodeModeOperation (165-169)
  • NodeId (40-40)
src/lib/litegraph/src/LGraph.ts (2)
  • change (1279-1282)
  • nodes (400-402)
src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts (1)
  • mode (80-82)
src/renderer/core/layout/utils/mappers.ts (1)
  • yNodeToLayout (38-48)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: deploy-and-comment
  • GitHub Check: setup
  • GitHub Check: test
  • GitHub Check: lint-and-format
  • GitHub Check: collect
🔇 Additional comments (24)
src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts (1)

76-92: LGTM!

The mock fixture correctly includes the new mode field to match the updated NodeLayout type. Using vi.hoisted() for shared mock data is the correct pattern per coding guidelines.

src/renderer/core/layout/types.ts (2)

45-54: LGTM!

The mode field is properly added to NodeLayout with a helpful inline comment documenting the LGraphEventMode values.


162-169: LGTM!

The SetNodeModeOperation interface follows the established pattern of other node operations (e.g., SetNodeZIndexOperation), correctly including previousMode for undo/redo support.

src/renderer/extensions/minimap/data/MinimapDataSource.test.ts (1)

28-41: LGTM!

Test fixture correctly updated to include the new mode field, maintaining type conformance with NodeLayout.

src/renderer/core/layout/utils/layoutMath.test.ts (1)

53-67: LGTM!

Test helper createTestNode correctly updated to include the new mode field, ensuring all generated NodeLayout fixtures conform to the updated type.

src/renderer/core/layout/sync/useLayoutSync.ts (1)

56-60: Mode sync uses proper guard to prevent infinite loops.

The implementation correctly prevents sync loops. After calling liteNode.changeMode(layout.mode), the liteNode.mode is updated to match layout.mode, so if the patched changeMode method triggers another onChange callback, the guard condition liteNode.mode !== layout.mode will fail and no recursive call occurs.

src/renderer/core/layout/store/layoutStore.test.ts (1)

20-20: LGTM!

The test fixture correctly includes the new mode field with value 0 (representing LGraphEventMode.ALWAYS), aligning with the updated NodeLayout type.

src/composables/graph/useVueNodeLifecycle.ts (3)

11-11: LGTM!

Import follows repo conventions with type imports kept separate from value imports.


40-42: LGTM!

Correctly extends the node data passed to layoutStore.initializeFromLiteGraph to include the mode property from each LGraphNode, enabling the layout store to track node modes from initialization.


64-66: LGTM!

The patch is correctly applied after layoutStore.initializeFromLiteGraph is called, ensuring the store is seeded before LGraphNode.changeMode starts syncing to it. The patch function is idempotent (uses an isPatched guard), so multiple calls are safe.

src/extensions/core/groupOptions.ts (1)

10-10: LGTM!

Import correctly added for layoutStore access.

src/lib/litegraph/src/LGraphNode.ts (1)

1328-1330: LGTM!

Adding an explicit BYPASS case ensures this mode is handled correctly by changeMode, allowing the mode to be set without falling through to the default case (which would return false and reject the change). This is essential for the centralized mode management to work with bypass operations.

src/composables/canvas/useSelectedLiteGraphItems.ts (3)

3-3: LGTM!

Import correctly added for layoutStore access.


123-128: LGTM!

The mode comparison now correctly reads from layoutStore.getNodeLayoutRef() instead of directly from node properties. The optional chaining (?.mode) safely handles cases where the node layout might not exist in the store.


134-137: LGTM!

Correctly delegates mode changes to layoutStore.setNodeMode, aligning with centralized state management.

src/renderer/core/layout/sync/patchLGraphNodeMode.ts (1)

1-33: LGTM! Clean patch implementation with proper guard and defensive checks.

The double-patch guard, defensive condition check (result && previousMode !== this.mode), and proper ID normalization are all well-implemented. The synchronization with layoutStore.setNodeMode correctly ensures bidirectional consistency between LiteGraph and the centralized store.

src/composables/canvas/useSelectedLiteGraphItems.test.ts (2)

226-275: Good migration to store-based assertions.

The tests correctly initialize the layoutStore before each scenario and verify mode changes through getNodeLayoutRef().value?.mode. The string ID normalization aligns with the store's internal representation.


301-364: Subgraph mode unification test is comprehensive.

The test properly verifies that subgraph children receive the unified state from their parent, with all nodes initialized in layoutStore and assertions checking the store's state rather than direct node properties.

src/renderer/core/layout/operations/layoutMutations.ts (1)

145-160: LGTM! Consistent addition of mode field to node creation.

The default value of 0 (ALWAYS) follows the pattern established in initializeFromLiteGraph and aligns with the NODE_LAYOUT_DEFAULTS.mode value in mappers.

src/components/rightSidePanel/settings/SetNodeState.vue (1)

24-59: LGTM! Clean store-based mode management.

The refactored implementation correctly:

  • Derives nodeIds from props (immutable)
  • Creates reactive refs via layoutStore.getNodeLayoutRef()
  • Returns a unified mode only when all nodes share the same mode
  • Uses the setter with proper null/undefined guards and emits the change event

The pattern of passing only id to the component and delegating state to the store improves separation of concerns.

src/renderer/core/layout/store/layoutStore.ts (3)

299-310: LGTM! Mode change detection follows established patterns.

The mode comparison and operation emission follows the same pattern as position, size, and zIndex changes. The operation includes previousMode for undo support.


1103-1112: LGTM! Handler follows existing patterns.

The implementation correctly updates the CRDT and adds the nodeId to the change for downstream notification.


1464-1485: LGTM! Proper short-circuit prevents sync loops.

The if (currentLayout.mode === mode) return check is crucial for preventing infinite loops during bidirectional synchronization between layoutStore and LiteGraph (via patchLGraphNodeMode).

src/renderer/core/layout/utils/mappers.ts (1)

24-24: LGTM!

The mode field serialization and deserialization follow the established patterns for other NodeLayout fields, with proper fallback handling via getOr.

Also applies to: 45-45

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


// Apply the parent's new mode to all children uniformly
node.mode = newModeForSelectedNode
layoutStore.setNodeMode(node.id.toString(), newModeForSelectedNode)
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider batch mode updates for subgraph children.

When traversing subgraph nodes, each child triggers a separate layoutStore.setNodeMode call. For large subgraphs, using layoutStore.setNodesMode with a pre-collected map of node IDs to modes could be more efficient.

♻️ Optional: Collect child nodes and batch update
       // If this selected node is a subgraph, apply the same mode uniformly to all its children
       // This ensures predictable behavior: all children get the same state as their parent
       if (selectedNode.isSubgraphNode?.() && selectedNode.subgraph) {
+        const childNodeModes: Record<string, number> = {}
         traverseNodesDepthFirst([selectedNode], {
           visitor: (node) => {
             // Skip the parent node since we already handled it above
             if (node === selectedNode) return undefined
 
-            // Apply the parent's new mode to all children uniformly
-            layoutStore.setNodeMode(node.id.toString(), newModeForSelectedNode)
+            childNodeModes[node.id.toString()] = newModeForSelectedNode
             return undefined
           }
         })
+        if (Object.keys(childNodeModes).length > 0) {
+          layoutStore.setNodesMode(childNodeModes)
+        }
       }
🤖 Prompt for AI Agents
In `@src/composables/canvas/useSelectedLiteGraphItems.ts` at line 148, The loop
currently calls layoutStore.setNodeMode(node.id.toString(),
newModeForSelectedNode) for each child which is inefficient for large subgraphs;
modify the traversal in useSelectedLiteGraphItems.ts to collect a map/object of
child node IDs to newModeForSelectedNode (use node.id.toString() as the key) and
after traversal call layoutStore.setNodesMode(collectedMap) once; keep the
existing per-node logic to determine newModeForSelectedNode but replace
individual setNodeMode calls with building the map and a single batch
setNodesMode call.

Comment on lines 16 to 18
function setNodeMode(node: LGraphNode, mode: number) {
node.mode = mode
node.graph?.change()
layoutStore.setNodeMode(node.id.toString(), mode)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Good refactor to centralized mode management.

The function now correctly delegates to layoutStore.setNodeMode. However, consider using layoutStore.setNodesMode for batch updates when changing mode for all nodes in a group, as this could reduce redundant store operations.

♻️ Optional: Use batch mode update
 function setNodeMode(node: LGraphNode, mode: number) {
   layoutStore.setNodeMode(node.id.toString(), mode)
 }
+
+function setNodesModeForGroup(nodes: LGraphNode[], mode: number) {
+  const nodeIdModes: Record<string, number> = {}
+  for (const node of nodes) {
+    nodeIdModes[node.id.toString()] = mode
+  }
+  layoutStore.setNodesMode(nodeIdModes)
+}

Then update the callbacks to use the batch function instead of looping.

🤖 Prompt for AI Agents
In `@src/extensions/core/groupOptions.ts` around lines 16 - 18, The current
setNodeMode(node: LGraphNode, mode: number) delegates to layoutStore.setNodeMode
for single-node updates; when you change mode for an entire group, replace the
per-node loop with a single batch call to layoutStore.setNodesMode(idsArray,
mode) to avoid repetitive store writes—keep setNodeMode for individual updates
but modify the group callbacks (where you currently iterate nodes and call
setNodeMode) to collect node.id strings into an array and call
layoutStore.setNodesMode once with that array and the new mode.

Comment on lines +1487 to +1499
/**
* Set the execution mode for multiple nodes.
* Applies the mode to all nodes atomically.
*/
setNodesMode(nodeIds: NodeId[], mode: number): void {
if (nodeIds.length === 0) return

// Apply mode to each node
// Note: We could create a batch operation type if needed for better performance
nodeIds.forEach((nodeId) => {
this.setNodeMode(nodeId, mode)
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider batch operation for multi-node mode changes.

The current implementation creates N separate operations for N nodes, each triggering its own version increment and change notification. For large selections, this could impact performance.

The existing batchUpdateNodeBounds pattern (lines 1504-1551) demonstrates how to atomically update multiple nodes in a single operation with one notification cycle. A similar BatchSetNodeModeOperation would improve efficiency.

♻️ Potential batch operation pattern
+interface BatchSetNodeModeOperation extends OpBase {
+  type: 'batchSetNodeMode'
+  entity: 'node'
+  nodeIds: NodeId[]
+  mode: number
+  previousModes: Record<NodeId, number>
+}

 setNodesMode(nodeIds: NodeId[], mode: number): void {
   if (nodeIds.length === 0) return
 
-  // Apply mode to each node
-  // Note: We could create a batch operation type if needed for better performance
-  nodeIds.forEach((nodeId) => {
-    this.setNodeMode(nodeId, mode)
-  })
+  // Single node optimization
+  if (nodeIds.length === 1) {
+    this.setNodeMode(nodeIds[0], mode)
+    return
+  }
+
+  // Batch operation for multiple nodes
+  const previousModes: Record<NodeId, number> = {}
+  const validNodeIds: NodeId[] = []
+  
+  for (const nodeId of nodeIds) {
+    const ynode = this.ynodes.get(nodeId)
+    if (!ynode) continue
+    const currentLayout = yNodeToLayout(ynode)
+    if (currentLayout.mode === mode) continue
+    previousModes[nodeId] = currentLayout.mode
+    validNodeIds.push(nodeId)
+  }
+  
+  if (validNodeIds.length === 0) return
+  
+  this.applyOperation({
+    type: 'batchSetNodeMode',
+    entity: 'node',
+    nodeIds: validNodeIds,
+    mode,
+    previousModes,
+    timestamp: Date.now(),
+    source: this.currentSource,
+    actor: this.currentActor
+  })
 }
🤖 Prompt for AI Agents
In `@src/renderer/core/layout/store/layoutStore.ts` around lines 1487 - 1499, The
setNodesMode method currently calls setNodeMode for each node causing N
operations/notifications; replace this with a single batched operation following
the batchUpdateNodeBounds pattern: create a BatchSetNodeModeOperation (or
similar) that takes nodeIds and mode, applies mode to each node in one atomic
update, increments the store version once, and emits a single
change/notification; update setNodesMode to construct and push/commit that batch
operation (refer to setNodesMode, setNodeMode, batchUpdateNodeBounds, and the
new BatchSetNodeModeOperation) so large selections perform efficiently.

size: { width: 100, height: 50 },
zIndex: 0,
visible: true,
mode: 0, // LGraphEventMode.ALWAYS
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find LGraphEventMode definition
rg -n "enum LGraphEventMode|LGraphEventMode\s*=" --type ts -B2 -A10

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1817


🏁 Script executed:

#!/bin/bash
# Examine the mappers.ts file to see current imports and line 13 context
cat -n src/renderer/core/layout/utils/mappers.ts | head -60

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1937


🏁 Script executed:

#!/bin/bash
# Search for existing imports from litegraph in mappers.ts
rg -n "import.*from.*litegraph" src/renderer/core/layout/utils/mappers.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


🏁 Script executed:

#!/bin/bash
# Find and examine NodeLayout type definition
rg -n "type NodeLayout|interface NodeLayout" --type ts -A20 | head -50

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 2907


🏁 Script executed:

#!/bin/bash
# Check the litegraph barrel export
cat -n src/lib/litegraph/src/litegraph.ts | head -50

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1797


🏁 Script executed:

#!/bin/bash
# Check what's exported from the globalEnums
rg -n "export.*LGraphEventMode" --type ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 145


🏁 Script executed:

#!/bin/bash
# Check if there are any existing imports from litegraph in renderer/core/layout
find src/renderer/core/layout -type f \( -name "*.ts" -o -name "*.tsx" \) -exec grep -l "from.*litegraph" {} \;

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 449


🏁 Script executed:

#!/bin/bash
# Check what files in layout module import from litegraph, especially patchLGraphNodeMode
head -20 src/renderer/core/layout/sync/patchLGraphNodeMode.ts
head -20 src/renderer/core/layout/operations/layoutMutations.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1298


🏁 Script executed:

#!/bin/bash
# Check the full barrel export to see if LGraphEventMode is exported
grep -n "LGraphEventMode" src/lib/litegraph/src/litegraph.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 92


🏁 Script executed:

#!/bin/bash
# Check if there's any pattern of importing LGraphEventMode directly in the codebase
rg "import.*LGraphEventMode" --type ts -A2 -B2

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 5773


Import LGraphEventMode.ALWAYS instead of using the magic number 0.

This improves type safety and makes the code self-documenting, eliminating the need for the explanatory comment. The enum is already exported from the barrel at @/lib/litegraph/src/litegraph and used throughout the codebase with this import pattern.

🤖 Prompt for AI Agents
In `@src/renderer/core/layout/utils/mappers.ts` at line 13, Replace the magic
number assignment "mode: 0" in the mapper object with the enum value
LGraphEventMode.ALWAYS and add an import for LGraphEventMode from
"@/lib/litegraph/src/litegraph"; locate the occurrence of "mode: 0" in
mappers.ts and change it to "mode: LGraphEventMode.ALWAYS", then add the named
import (or extend an existing import) for LGraphEventMode at the top of the file
so the enum is referenced instead of the hardcoded 0.

Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

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

Can you give a high-level explanation of the approach here?

@LittleSound
Copy link
Collaborator Author

Sorry. what do you mean?

@LittleSound
Copy link
Collaborator Author

I encountered an issue: layoutStore is specifically designed for Nodes 2.0. After switching to layoutStore, if Nodes 2.0 is not started, it will be impossible to modify the state of Nodes.

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.

2 participants