Skip to content

Conversation

@Myestery
Copy link
Collaborator

@Myestery Myestery commented Dec 30, 2025

Summary

  • Forward keydown events to litegraph's processKey when Vue nodes have focus (litegraph only binds keydown to canvas)
  • Sync pointer state with litegraph canvas during link dragging for spacebar panning while dragging connections
  • Add tests for keydown forwarding behavior

Test plan

  • Enable vueNodes mode and "Drag Navigation" (legacy) mode
  • Select a Vue node, hold spacebar and drag - canvas should pan
  • Drag a link connection, hold spacebar and drag - canvas should pan while link stays attached

Fixes #7806

┆Issue is synchronized with this Notion page by Unito

Forward keydown events to litegraph's processKey when Vue nodes have
focus. Litegraph only binds keydown to the canvas element, so spacebar
panning didn't work when Vue nodes were focused.

Also sync pointer state with litegraph canvas during link dragging to
enable spacebar panning while dragging connections.

Fixes #7806
@Myestery Myestery requested a review from a team as a code owner December 30, 2025 23:50
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 30, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (4)
  • browser_tests/tests/copyPaste.spec.ts-snapshots/paste-in-text-area-with-node-previously-copied-chromium-linux.png is excluded by !**/*.png
  • browser_tests/tests/interaction.spec.ts-snapshots/node-title-edited-chromium-linux.png is excluded by !**/*.png
  • browser_tests/tests/mobileBaseline.spec.ts-snapshots/mobile-settings-dialog-mobile-chrome-linux.png is excluded by !**/*.png
  • browser_tests/tests/nodeSearchBox.spec.ts-snapshots/added-node-no-connection-chromium-linux.png is excluded by !**/*.png

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

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

📝 Walkthrough

Walkthrough

Guards were added so pan/read-only (canvas navigation) mode bypasses Vue node and slot drag handling and forwards pointer events to the litegraph canvas; litegraph pointer state is synchronized during link drags; a document-level keydown listener is bound in Vue Nodes mode; a test import was reordered.

Changes

Cohort / File(s) Summary
Node pointer interactions
src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts, src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
Added early-return guards: when canvas is in pan/read_only (via shouldHandleNodePointerEvents), onPointerdown/onPointermove forward events to litegraph instead of starting node drag/resize; test file only reorders imports.
Slot/link pointer interactions
src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
Prevent starting/moving link drags in read_only/pan mode; on drag start sync canvas.last_mouse and canvas.pointer.isDown; clear canvas.pointer.isDown during drag cleanup; stop propagation only when not in read_only.
Canvas keyboard & focus handling
src/lib/litegraph/src/LGraphCanvas.ts
When Vue Nodes mode is active, bind a document-level keydown listener (same callback) and remove it on unbind; expand typing-surface guard to include input, textarea, and contentEditable targets for key processing and Delete/Backspace handling.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant VueHandlers as Vue Node/Slot Handlers
    participant Document
    participant Canvas as Litegraph Canvas

    Note over Document,Canvas: Document-level keydown bound in Vue Nodes mode
    User->>Document: keydown (e.g. Space)
    Document->>VueHandlers: deliver keydown (Vue Nodes mode)
    VueHandlers->>VueHandlers: toggle pan/read_only state

    Note over User,VueHandlers: pointer actions while panning
    User->>VueHandlers: pointerdown / pointermove / pointerup
    alt pan/read_only active
        VueHandlers->>Canvas: forward pointer events (processMouseDown/Move/Up)
        Canvas->>Canvas: update last_mouse / pointer.isDown, pan viewport
    else normal node interaction
        VueHandlers->>VueHandlers: handle node/slot drag/resize (stop propagation)
    end

    Note over Document,VueHandlers: exit pan mode
    User->>Document: keyup
    Document->>VueHandlers: deliver keyup
    VueHandlers->>VueHandlers: clear pan/read_only state
Loading

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed All code changes directly address the objectives: keydown forwarding to litegraph (LGraphCanvas.ts), pointer state syncing during link drags (useSlotLinkInteraction.ts), and pointer event guards for pan mode (useNodePointerInteractions.ts).
Out of Scope Changes check ✅ Passed All changes are scoped to spacebar panning functionality: keydown event binding, pointer state synchronization, and pan mode guards in Vue node interactions.

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 Dec 30, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 01/06/2026, 07:37:07 PM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Dec 30, 2025

🎭 Playwright Test Results

Some tests failed

⏰ Completed at: 01/06/2026, 07:42:29 PM UTC

📈 Summary

  • Total Tests: 511
  • Passed: 500 ✅
  • Failed: 1 ❌
  • Flaky: 2 ⚠️
  • Skipped: 8 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 490 / ❌ 1 / ⚠️ 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

🎉 Click on the links above to view detailed test results for each browser configuration.

@Myestery Myestery requested a review from DrJKL December 30, 2025 23:51
@github-actions
Copy link

github-actions bot commented Dec 30, 2025

Bundle Size Report

Summary

  • Raw size: 17.4 MB baseline 17.4 MB — 🔴 +797 B
  • Gzip: 3.57 MB baseline 3.57 MB — 🔴 +101 B
  • Brotli: 2.72 MB baseline 2.72 MB — 🔴 +141 B
  • Bundles: 99 current • 99 baseline • 43 added / 43 removed

Category Glance
App Entry Points 🔴 +694 B (3.23 MB) · Graph Workspace 🔴 +103 B (1.01 MB) · Vendor & Third-Party ⚪ 0 B (9.19 MB) · Other ⚪ 0 B (3.5 MB) · Panels & Settings ⚪ 0 B (300 kB) · UI Components ⚪ 0 B (193 kB) · + 3 more

Per-category breakdown
App Entry Points — 3.23 MB (baseline 3.23 MB) • 🔴 +694 B

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-DSiesSpT.js (new) 3.04 MB 🔴 +3.04 MB 🔴 +637 kB 🔴 +484 kB
assets/index-BZIlvHie.js (removed) 3.03 MB 🟢 -3.03 MB 🟢 -637 kB 🟢 -484 kB
assets/index-DaKCWou6.js (removed) 194 kB 🟢 -194 kB 🟢 -42.3 kB 🟢 -35.2 kB
assets/index-jijpHWTc.js (new) 194 kB 🔴 +194 kB 🔴 +42.3 kB 🔴 +35.2 kB
assets/index-1rddHREd.js (removed) 345 B 🟢 -345 B 🟢 -242 B 🟢 -238 B
assets/index-DfU6IHib.js (new) 345 B 🔴 +345 B 🔴 +244 B 🔴 +236 B

Status: 3 added / 3 removed

Graph Workspace — 1.01 MB (baseline 1.01 MB) • 🔴 +103 B

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-X6uzOxmG.js (new) 1.01 MB 🔴 +1.01 MB 🔴 +196 kB 🔴 +149 kB
assets/GraphView-fwsQSdT5.js (removed) 1.01 MB 🟢 -1.01 MB 🟢 -196 kB 🟢 -149 kB

Status: 1 added / 1 removed

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

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/UserSelectView-DKBf3aDK.js (removed) 6.63 kB 🟢 -6.63 kB 🟢 -2.14 kB 🟢 -1.9 kB
assets/UserSelectView-IeSopN-C.js (new) 6.63 kB 🔴 +6.63 kB 🔴 +2.14 kB 🔴 +1.89 kB

Status: 1 added / 1 removed

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

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/LegacyCreditsPanel-Cn6BFmJg.js (new) 22.7 kB 🔴 +22.7 kB 🔴 +5.25 kB 🔴 +4.6 kB
assets/LegacyCreditsPanel-hlomBi8D.js (removed) 22.7 kB 🟢 -22.7 kB 🟢 -5.25 kB 🟢 -4.6 kB
assets/KeybindingPanel-CppdSVBx.js (removed) 14.8 kB 🟢 -14.8 kB 🟢 -3.57 kB 🟢 -3.13 kB
assets/KeybindingPanel-DmtRKa37.js (new) 14.8 kB 🔴 +14.8 kB 🔴 +3.57 kB 🔴 +3.12 kB
assets/ExtensionPanel-BMhD18Mc.js (removed) 11.1 kB 🟢 -11.1 kB 🟢 -2.61 kB 🟢 -2.29 kB
assets/ExtensionPanel-CBMemuba.js (new) 11.1 kB 🔴 +11.1 kB 🔴 +2.61 kB 🔴 +2.29 kB
assets/AboutPanel-B5Ewh2lQ.js (removed) 9.16 kB 🟢 -9.16 kB 🟢 -2.46 kB 🟢 -2.2 kB
assets/AboutPanel-y-x0REDh.js (new) 9.16 kB 🔴 +9.16 kB 🔴 +2.46 kB 🔴 +2.21 kB
assets/ServerConfigPanel-BDr_GGv1.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -2.04 kB 🟢 -1.8 kB
assets/ServerConfigPanel-pHfRvD3X.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +2.04 kB 🔴 +1.8 kB
assets/UserPanel-C7QJPBKu.js (new) 6.88 kB 🔴 +6.88 kB 🔴 +1.79 kB 🔴 +1.56 kB
assets/UserPanel-USN8vWuh.js (removed) 6.88 kB 🟢 -6.88 kB 🟢 -1.79 kB 🟢 -1.56 kB
assets/settings-BhbWhsRg.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BIdKi-OT.js 26.2 kB 26.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-Bu3OR-lX.js 24.6 kB 24.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-ByL6gy5c.js 25.4 kB 25.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CjlRFMdL.js 32.8 kB 32.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DkGwvylK.js 26.9 kB 26.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-Dyd027Dx.js 24.7 kB 24.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-MzsBgiwB.js 21.7 kB 21.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-wwBxqLH5.js 21.3 kB 21.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-xx2Yb6R2.js 23.8 kB 23.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 6 added / 6 removed

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

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/LazyImage.vue_vue_type_script_setup_true_lang-BKxQ6wH6.js (removed) 60.1 kB 🟢 -60.1 kB 🟢 -12.4 kB 🟢 -10.8 kB
assets/LazyImage.vue_vue_type_script_setup_true_lang-CvyPzTOi.js (new) 60.1 kB 🔴 +60.1 kB 🔴 +12.4 kB 🔴 +10.8 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-C4cvLCDo.js (removed) 54.4 kB 🟢 -54.4 kB 🟢 -8.6 kB 🟢 -7.37 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-S1VFgRHZ.js (new) 54.4 kB 🔴 +54.4 kB 🔴 +8.6 kB 🔴 +7.38 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-BPnzcanv.js (removed) 49 kB 🟢 -49 kB 🟢 -10.5 kB 🟢 -9.13 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-DfgFzY1W.js (new) 49 kB 🔴 +49 kB 🔴 +10.5 kB 🔴 +9.13 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-7IDLE7r7.js (removed) 10.9 kB 🟢 -10.9 kB 🟢 -2.9 kB 🟢 -2.55 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-Cc8jI6yq.js (new) 10.9 kB 🔴 +10.9 kB 🔴 +2.89 kB 🔴 +2.55 kB
assets/ComfyQueueButton-BRR7xDTJ.js (new) 8.83 kB 🔴 +8.83 kB 🔴 +2.58 kB 🔴 +2.3 kB
assets/ComfyQueueButton-DXpKgNRJ.js (removed) 8.83 kB 🟢 -8.83 kB 🟢 -2.58 kB 🟢 -2.3 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-CJ3bNxIv.js (removed) 3.72 kB 🟢 -3.72 kB 🟢 -1.45 kB 🟢 -1.32 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-DUtKU5cx.js (new) 3.72 kB 🔴 +3.72 kB 🔴 +1.45 kB 🔴 +1.32 kB
assets/WidgetButton-CouCW8Gg.js (new) 2.21 kB 🔴 +2.21 kB 🔴 +995 B 🔴 +893 B
assets/WidgetButton-DQoEAJTN.js (removed) 2.21 kB 🟢 -2.21 kB 🟢 -996 B 🟢 -894 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-C_lU3rGu.js (new) 2.14 kB 🔴 +2.14 kB 🔴 +889 B 🔴 +765 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-Xj8C38-k.js (removed) 2.14 kB 🟢 -2.14 kB 🟢 -890 B 🟢 -774 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-CNONrH5j.js (new) 897 B 🔴 +897 B 🔴 +501 B 🔴 +442 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-CZHSPWbg.js (removed) 897 B 🟢 -897 B 🟢 -502 B 🟢 -433 B
assets/UserAvatar.vue_vue_type_script_setup_true_lang-Btc-ocVv.js 1.34 kB 1.34 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 9 added / 9 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-DE06TnMx.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -1.83 kB 🟢 -1.57 kB
assets/keybindingService-Dk4GABQT.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +1.83 kB 🔴 +1.59 kB
assets/audioService-BZr6JR7B.js (removed) 2.2 kB 🟢 -2.2 kB 🟢 -963 B 🟢 -832 B
assets/audioService-zGCx9HrR.js (new) 2.2 kB 🔴 +2.2 kB 🔴 +961 B 🔴 +830 B
assets/serverConfigStore-CLS4uKu9.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-8CYBO9WU.js (new) 1.41 kB 🔴 +1.41 kB 🔴 +652 B 🔴 +547 B
assets/audioUtils-CPDeYG7c.js (removed) 1.41 kB 🟢 -1.41 kB 🟢 -652 B 🟢 -548 B

Status: 1 added / 1 removed

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

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-chart-vIZEp4HX.js 452 kB 452 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-other-fFl5a9Y4.js 3.9 MB 3.9 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-woBPd4cb.js 1.95 MB 1.95 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-r9r5tF_O.js 2.08 MB 2.08 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-C79JtMXE.js 232 kB 232 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-BXnt3M34.js 160 kB 160 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-xterm-BF8peZ5_.js 420 kB 420 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Other — 3.5 MB (baseline 3.5 MB) • ⚪ 0 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/SubscriptionRequiredDialogContent-DyoQSk9f.js (removed) 29 kB 🟢 -29 kB 🟢 -6.42 kB 🟢 -5.58 kB
assets/SubscriptionRequiredDialogContent-n7ehy2kN.js (new) 29 kB 🔴 +29 kB 🔴 +6.42 kB 🔴 +5.61 kB
assets/WidgetRecordAudio-B9F3AIGP.js (removed) 20.4 kB 🟢 -20.4 kB 🟢 -5.24 kB 🟢 -4.63 kB
assets/WidgetRecordAudio-DVTIfpDc.js (new) 20.4 kB 🔴 +20.4 kB 🔴 +5.23 kB 🔴 +4.64 kB
assets/AudioPreviewPlayer-1RdJR4kb.js (new) 13.3 kB 🔴 +13.3 kB 🔴 +3.35 kB 🔴 +2.99 kB
assets/AudioPreviewPlayer-IlQ4ktcD.js (removed) 13.3 kB 🟢 -13.3 kB 🟢 -3.35 kB 🟢 -2.99 kB
assets/ValueControlPopover-DWOAfji_.js (removed) 5.49 kB 🟢 -5.49 kB 🟢 -1.7 kB 🟢 -1.51 kB
assets/ValueControlPopover-DZW_VvDs.js (new) 5.49 kB 🔴 +5.49 kB 🔴 +1.7 kB 🔴 +1.52 kB
assets/WidgetGalleria-D_Y6oCxF.js (removed) 4.1 kB 🟢 -4.1 kB 🟢 -1.45 kB 🟢 -1.3 kB
assets/WidgetGalleria-DmxM45oL.js (new) 4.1 kB 🔴 +4.1 kB 🔴 +1.44 kB 🔴 +1.3 kB
assets/WidgetColorPicker-B8a22DY_.js (new) 3.41 kB 🔴 +3.41 kB 🔴 +1.38 kB 🔴 +1.23 kB
assets/WidgetColorPicker-DSXtP_vF.js (removed) 3.41 kB 🟢 -3.41 kB 🟢 -1.38 kB 🟢 -1.23 kB
assets/WidgetTextarea-CRw9mQPV.js (new) 3.08 kB 🔴 +3.08 kB 🔴 +1.21 kB 🔴 +1.08 kB
assets/WidgetTextarea-D03pVz5L.js (removed) 3.08 kB 🟢 -3.08 kB 🟢 -1.21 kB 🟢 -1.09 kB
assets/WidgetMarkdown-DGkAiBU-.js (removed) 3.08 kB 🟢 -3.08 kB 🟢 -1.28 kB 🟢 -1.13 kB
assets/WidgetMarkdown-Ue9i5dFR.js (new) 3.08 kB 🔴 +3.08 kB 🔴 +1.28 kB 🔴 +1.13 kB
assets/WidgetAudioUI--yY_nzir.js (new) 2.89 kB 🔴 +2.89 kB 🔴 +1.17 kB 🔴 +1.06 kB
assets/WidgetAudioUI-G8U29-Bb.js (removed) 2.89 kB 🟢 -2.89 kB 🟢 -1.17 kB 🟢 -1.06 kB
assets/WidgetInputText-3pW72iaX.js (removed) 1.99 kB 🟢 -1.99 kB 🟢 -919 B 🟢 -845 B
assets/WidgetInputText-BLEF6V7I.js (new) 1.99 kB 🔴 +1.99 kB 🔴 +917 B 🔴 +849 B
assets/WidgetToggleSwitch-BOOAsnNQ.js (new) 1.76 kB 🔴 +1.76 kB 🔴 +834 B 🔴 +729 B
assets/WidgetToggleSwitch-NNBOmTPV.js (removed) 1.76 kB 🟢 -1.76 kB 🟢 -835 B 🟢 -733 B
assets/MediaImageBottom-DZN-kgkt.js (new) 1.55 kB 🔴 +1.55 kB 🔴 +730 B 🔴 +638 B
assets/MediaImageBottom-PHhcQaM6.js (removed) 1.55 kB 🟢 -1.55 kB 🟢 -735 B 🟢 -637 B
assets/MediaAudioBottom-C3lgr33a.js (removed) 1.51 kB 🟢 -1.51 kB 🟢 -732 B 🟢 -647 B
assets/MediaAudioBottom-C7Ewis1l.js (new) 1.51 kB 🔴 +1.51 kB 🔴 +732 B 🔴 +648 B
assets/Media3DBottom-BAZla0Tm.js (removed) 1.5 kB 🟢 -1.5 kB 🟢 -729 B 🟢 -647 B
assets/Media3DBottom-D9ym429f.js (new) 1.5 kB 🔴 +1.5 kB 🔴 +729 B 🔴 +647 B
assets/MediaVideoBottom-Bqeh_mIl.js (removed) 1.5 kB 🟢 -1.5 kB 🟢 -729 B 🟢 -649 B
assets/MediaVideoBottom-CdP7Nfxw.js (new) 1.5 kB 🔴 +1.5 kB 🔴 +729 B 🔴 +647 B
assets/Media3DTop-DMKIbAc9.js (new) 1.49 kB 🔴 +1.49 kB 🔴 +764 B 🔴 +655 B
assets/Media3DTop-DUIV8MdT.js (removed) 1.49 kB 🟢 -1.49 kB 🟢 -764 B 🟢 -653 B
assets/WidgetSelect-BlsTQwgI.js (removed) 733 B 🟢 -733 B 🟢 -361 B 🟢 -319 B
assets/WidgetSelect-D3_EF3Dg.js (new) 733 B 🔴 +733 B 🔴 +358 B 🔴 +323 B
assets/WidgetInputNumber-BQ0SEopl.js (removed) 673 B 🟢 -673 B 🟢 -349 B 🟢 -289 B
assets/WidgetInputNumber-CppY_DKi.js (new) 673 B 🔴 +673 B 🔴 +345 B 🔴 +288 B
assets/Load3D-BF9vF42L.js (removed) 424 B 🟢 -424 B 🟢 -264 B 🟢 -224 B
assets/Load3D-DvCR-K_E.js (new) 424 B 🔴 +424 B 🔴 +264 B 🔴 +223 B
assets/WidgetLegacy-a1aWSpU4.js (new) 364 B 🔴 +364 B 🔴 +235 B 🔴 +196 B
assets/WidgetLegacy-BuntN69X.js (removed) 364 B 🟢 -364 B 🟢 -235 B 🟢 -196 B
assets/commands-09qoDJrw.js 13.8 kB 13.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BWp4HdfU.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CcfGaui5.js 14.4 kB 14.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CisfgZf5.js 13.7 kB 13.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CkU12Foh.js 13 kB 13 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CoH2DJa6.js 14.2 kB 14.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-COSt-Bjx.js 14.9 kB 14.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DalfIW5f.js 15.9 kB 15.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DfTl0eCm.js 13.5 kB 13.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DwSJL865.js 13.7 kB 13.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Ba_fO77I.js 91.3 kB 91.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Bdc58rJq.js 97.1 kB 97.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-C9ZJBRdI.js 81.5 kB 81.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CAL83XT3.js 84.6 kB 84.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CHLLfvpG.js 82.4 kB 82.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Cw9RZWRY.js 89 B 89 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DDqR5EuX.js 71.3 kB 71.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DLHyaEcz.js 92.1 kB 92.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-O7KfJeMO.js 79.9 kB 79.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-OzGsrlqJ.js 112 kB 112 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaAudioTop-DrF_Vdi7.js 1.46 kB 1.46 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageTop-DmgiGEEz.js 1.75 kB 1.75 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoTop-BXyavTZf.js 2.65 kB 2.65 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-aW9En70v.js 260 kB 260 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BIckSVgU.js 273 kB 273 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BiYpVi7D.js 263 kB 263 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Bw_Jitw_.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CCEXtYfM.js 243 kB 243 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CvmVDWYd.js 323 kB 323 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-D_wreoPJ.js 267 kB 267 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Dz-0ZIBN.js 297 kB 297 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-VZsNmhG7.js 264 kB 264 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Zy145v5w.js 279 kB 279 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/OBJLoader2Worker-GDlTeC1j.js 4.69 kB 4.69 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetChart-dhwVJAgU.js 2.48 kB 2.48 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetImageCompare-C2io158s.js 3.18 kB 3.18 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widgetPropFilter-BIbGSUAt.js 1.28 kB 1.28 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 20 added / 20 removed

@DrJKL DrJKL self-assigned this Dec 30, 2025
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: 1

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 68d1d21 and f5ac48c.

📒 Files selected for processing (3)
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
🧰 Additional context used
📓 Path-based instructions (12)
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.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
src/**/*.ts

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

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

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use TypeScript exclusively; do not write new JavaScript code
Use sorted and grouped imports organized by plugin/source
Enforce ESLint rules including Vue + TypeScript rules, disallow floating promises, disallow unused imports, and restrict i18n raw text in templates
Do not use any type or as any type assertions; fix the underlying type issue instead
Write code that is expressive and self-documenting; avoid redundant comments and clean as you go
Keep functions short and functional; minimize nesting and follow the arrow anti-pattern
Avoid mutable state; prefer immutability and assignment at point of declaration
Use function declarations instead of function expressions when possible
Use es-toolkit for utility functions
Implement proper error handling in code

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
**/**/use[A-Z]*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables using the pattern useXyz.ts

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
**/*.{ts,tsx,vue,js,jsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Minimize the surface area (exported values) of each module and composable

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.test.ts: Use unit/component tests in tests-ui/ or src/**/*.test.ts with Vitest framework
For mocking in tests, leverage Vitest utilities; keep module mocks contained and avoid global mutable state within test files
Do not write change detector tests or tests dependent on non-behavioral features like utility classes or styles
Aim for behavioral coverage of critical and new features in unit tests

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
🧠 Learnings (21)
📓 Common learnings
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.
📚 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/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use useIntersectionObserver for visibility detection instead of custom scroll handlers

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Mock external dependencies in tests

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : For mocking in tests, leverage Vitest utilities; keep module mocks contained and avoid global mutable state within test files

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Always prefer vitest mock functions over writing verbose manual mocks

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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/**/*.{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
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Test across multiple viewports

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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/**/*.{test,spec}.{js,ts,jsx,tsx} : When adding features, always write vitest unit tests using cursor rules in @.cursor

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : Use unit/component tests in `tests-ui/` or `src/**/*.test.ts` with Vitest framework

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Use `vitest` for unit testing in this project

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Use existing test utilities rather than writing custom utilities

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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
📚 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
🧬 Code graph analysis (2)
src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts (3)
src/scripts/app.ts (1)
  • app (1772-1772)
src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts (1)
  • canvas (26-28)
src/lib/litegraph/src/LGraphCanvas.ts (1)
  • canvas (1900-1910)
src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts (1)
src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts (1)
  • useNodePointerInteractions (32-217)
⏰ 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: lint-and-format
  • GitHub Check: collect
  • GitHub Check: test
🔇 Additional comments (8)
src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts (3)

296-298: LGTM! Proper pointer state cleanup.

Good addition to reset canvas.pointer.isDown on interaction cleanup. The optional chaining safely handles cases where the canvas or pointer may not exist.


715-718: LGTM! Pointer state initialization on drag start.

Correctly initializes pointer.isDown and records the initial mouse position in last_mouse, which is necessary for the canvas to track pointer state during the drag operation. The optional chaining on canvas.pointer safely handles edge cases.


415-419: No changes needed — the condition is correct.

The logic correctly identifies spacebar panning mode. The read_only flag is specifically set to true when the spacebar is pressed and false when it's released (in LGraphCanvas.processKey). Combined with dragging_canvas, this condition correctly detects when the user is performing spacebar+drag navigation ("Drag Navigation legacy mode") and forwards the mouse move event to the canvas for panning. This approach is consistent throughout the codebase, including in useCanvasInteractions.ts and useNodePointerInteractions.ts.

src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts (3)

16-30: LGTM! Well-structured mock setup.

The hoisted mock pattern and getter-based app.canvas mock are correct for Vitest. This ensures the mock is properly available during module loading.


345-365: LGTM! Good test coverage for keydown forwarding.

The test correctly:

  1. Initializes the composable to trigger setup
  2. Creates a DOM element to simulate a Vue node
  3. Dispatches a spacebar keydown event
  4. Verifies forwarding to canvas.processKey
  5. Cleans up the DOM element

This aligns with the PR objective of forwarding keydown events when Vue nodes have focus.


367-381: Consider using vi.resetAllMocks() instead of manual mockClear().

The beforeEach at line 153 already calls vi.resetAllMocks(), so the manual mockCanvas.processKey.mockClear() on line 369 may be redundant if tests run in isolation. However, since tests within a describe block share state and multiple tests in this suite initialize the composable (which sets up the global keydown listener only once due to the keydownForwardingInitialized guard), the explicit clear is actually necessary here.

src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts (2)

35-35: One-time initialization is correctly placed.

Calling initKeydownForwarding() at the start of the composable ensures the global listener is set up as soon as any Vue node needs pointer interactions. The initialization guard prevents duplicate listeners.


90-94: LGTM! Consistent pointer event forwarding in panning mode.

This addition is consistent with the existing forwarding pattern in onPointerdown (lines 64-67) and onPointerup (lines 158-162), ensuring pointer events are properly delegated to the canvas when it's in panning mode.

Comment on lines 715 to 717
if (canvas.pointer) {
canvas.pointer.isDown = true
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels like something that we should not be storing statefully. Can we derive the button state from the MouseEvent buttons instead?

Comment on lines 13 to 30
// Forward keydown events to litegraph's processKey when Vue nodes have focus
let keydownForwardingInitialized = false

function initKeydownForwarding() {
if (keydownForwardingInitialized) return
keydownForwardingInitialized = true

document.addEventListener(
'keydown',
(e) => {
const canvas = app.canvas
if (!canvas) return
if (e.target === canvas.canvas) return
canvas.processKey(e)
},
true
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't want to add more arbitrary event listeners in various composables if we can help it.
Could you use this?

@DrJKL DrJKL assigned Myestery and unassigned DrJKL Dec 31, 2025
…n state

- Refactored spacebar forwarding to use useMagicKeys from VueUse instead of raw event listeners
- Added filtering for editable elements (input, textarea, contentEditable)
- Changed panning check in useSlotLinkInteraction to derive button state from event.buttons instead of storing canvas.pointer.isDown statefully
- Updated tests to work with the new useMagicKeys approach using vi.hoisted pattern
Comment on lines 18 to 24
function isEditableElement(el: Element | null): boolean {
if (!el) return false
const tag = el.tagName.toUpperCase()
if (tag === 'INPUT' || tag === 'TEXTAREA') return true
if (el instanceof HTMLElement && el.isContentEditable) return true
return false
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we consolidate the logic here with the logic in keybindingService?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or just use keybindingService somehow?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

let me see

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so I just checked and its a bit complicated since it will require keybindingService to handle keyup events and we now need to take away the magickeys and alter graphview too

Comment on lines 30 to 31
const { space } = useMagicKeys()
const activeElement = useActiveElement()
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to (or should) have these instantiated conditionally. We can just include them in the composable directly.

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: 1

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f8f525 and 1d1e16b.

📒 Files selected for processing (1)
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
🧰 Additional context used
📓 Path-based instructions (11)
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.ts
src/**/*.ts

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

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

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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.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

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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.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.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.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use TypeScript exclusively; do not write new JavaScript code
Use sorted and grouped imports organized by plugin/source
Enforce ESLint rules including Vue + TypeScript rules, disallow floating promises, disallow unused imports, and restrict i18n raw text in templates
Do not use any type or as any type assertions; fix the underlying type issue instead
Write code that is expressive and self-documenting; avoid redundant comments and clean as you go
Keep functions short and functional; minimize nesting and follow the arrow anti-pattern
Avoid mutable state; prefer immutability and assignment at point of declaration
Use function declarations instead of function expressions when possible
Use es-toolkit for utility functions
Implement proper error handling in code

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
**/**/use[A-Z]*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables using the pattern useXyz.ts

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
**/*.{ts,tsx,vue,js,jsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Minimize the surface area (exported values) of each module and composable

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
🧠 Learnings (21)
📓 Common learnings
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.
📚 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/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use useIntersectionObserver for visibility detection instead of custom scroll handlers

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/*.{vue,ts,tsx} : Follow Vue 3 composition API style guide

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.vue : Leverage VueUse functions for performance-enhancing styles in Vue components

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Use ref/reactive for state management in Vue 3 Composition API

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.vue : Prefer `useModel` over separately defining prop and emit for two-way binding

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.vue : Avoid new usage of PrimeVue components; use VueUse, shadcn/vue, or Reka UI instead

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Use lifecycle hooks: onMounted, onUpdated in Vue 3 Composition API

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Prefer emit/event-name for state changes over other communication patterns

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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 : Utilize ref and reactive for reactive state

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.vue : Prefer `computed()` over `ref` with `watch` when deriving values

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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 : Use watch and watchEffect for side effects

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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.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.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.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.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.ts
🧬 Code graph analysis (1)
src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts (2)
src/lib/litegraph/src/LGraphCanvas.ts (2)
  • canvas (1900-1910)
  • event (3693-3698)
src/scripts/app.ts (1)
  • app (1772-1772)
⏰ 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). (4)
  • GitHub Check: setup
  • GitHub Check: lint-and-format
  • GitHub Check: test
  • GitHub Check: collect
🔇 Additional comments (5)
src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts (5)

1-14: Imports are well-organized and appropriate for the new spacebar panning feature.

The additions of watch, useActiveElement, useMagicKeys, and app are all necessary for the spacebar forwarding functionality.


15-21: Well-implemented helper that addresses the editable element filtering concern.

This correctly guards against interfering with text input in INPUT, TEXTAREA, and contentEditable elements, addressing the previous review feedback.


77-81: Consistent panning mode handling across pointer events.

The pattern of checking shouldHandleNodePointerEvents and forwarding to canvas is correctly applied in onPointerdown, onPointermove, and onPointerup. This ensures smooth panning behavior while spacebar is held.


104-108: Essential addition for smooth pan-while-drag behavior.

Forwarding pointermove events during pan mode ensures the canvas receives the drag updates needed for smooth panning while holding spacebar.


27-46: The canvas.pointer.isDown property is valid and the logic correctly mirrors litegraph's implementation.

Code is correct as written.

- Set canvas.read_only directly when spacebar pressed
- Skip stopPropagation when read_only is true in slot link handler
- Remove manual dragging_canvas and processMouseMove management
- Litegraph handles panning through its normal event handlers
@Myestery Myestery assigned DrJKL and unassigned DrJKL Dec 31, 2025
Comment on lines 15 to 37
function isEditableElement(el: Element | null): boolean {
if (!el) return false
const tag = el.tagName.toUpperCase()
if (tag === 'INPUT' || tag === 'TEXTAREA') return true
if (el instanceof HTMLElement && el.isContentEditable) return true
return false
}

// Forward spacebar key events to litegraph for panning when Vue nodes have focus
const { space } = useMagicKeys()
const activeElement = useActiveElement()

watch(space, (isPressed) => {
const canvas = app.canvas
if (!canvas) return

// Skip if canvas has focus (litegraph handles it) or if in editable element
if (activeElement.value === canvas.canvas) return
if (isEditableElement(activeElement.value || null)) return

// pointer events will bubble to litegraph
canvas.read_only = isPressed
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure we need these changes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah
We want to filter some events

Move spacebar detection to document-level listener in LGraphCanvas when
vueNodesMode is enabled. Implement direct panning in useSlotLinkInteraction
when spacebar is held during connection drag, bypassing litegraph event
handling for smoother panning while maintaining link position updates.

Fixes #7806
Remove duplicate panning state management from useSlotLinkInteraction.
Instead of Vue manually manipulating canvas.ds.offset, sync pointer.isDown
with litegraph and let events bubble when in panning mode (read_only).

- Remove isPanningDuringLinkDrag and lastPanningMouse local state
- Remove manual offset manipulation in handlePointerMove
- Conditionally stopPropagation only when NOT in panning mode
- Set canvas.pointer.isDown so spacebar triggers litegraph panning
@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 Jan 5, 2026
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: 1

Fix all issues with AI Agents 🤖
In @src/lib/litegraph/src/LGraphCanvas.ts:
- Around line 1995-2004: The document-level keydown listener is added
conditionally in bindEvents based on LiteGraph.vueNodesMode but removed
conditionally in unbindEvents, which can leave listeners dangling if
vueNodesMode changes; update unbindEvents to always call
document.removeEventListener('keydown', this._key_callback) (guarded only by
existence of this._key_callback) instead of checking LiteGraph.vueNodesMode, and
apply the same unconditional removal for the other occurrence around lines
2033-2036; reference the symbols _key_callback, processKey,
LiteGraph.vueNodesMode, bindEvents and unbindEvents when making the change.

Caution

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

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

17-22: Consider adding test coverage for pan mode pointer forwarding.

The new pan mode forwarding guard in useNodePointerInteractions.ts (lines 68-72) isn't covered by tests. The current mock for shouldHandleNodePointerEvents is hardcoded to ref(true), which only tests the non-panning scenario.

Consider making the mock dynamic and adding tests that verify:

  • onPointermove forwards events to canvas when shouldHandleNodePointerEvents is false
  • Normal drag/selection behavior is preserved when shouldHandleNodePointerEvents is true

This would ensure the spacebar panning feature works correctly during pointer interactions.

🔎 Example test structure
it('should forward pointermove to canvas when in pan mode', () => {
  // Make shouldHandleNodePointerEvents dynamic
  const shouldHandle = ref(false) // Pan mode active
  // Update mock to use shouldHandle ref...
  
  const { pointerHandlers } = useNodePointerInteractions('test-node-123')
  
  const moveEvent = createPointerEvent('pointermove', { 
    clientX: 150, 
    clientY: 150,
    buttons: 1 
  })
  pointerHandlers.onPointermove(moveEvent)
  
  expect(forwardEventToCanvasMock).toHaveBeenCalledWith(moveEvent)
  expect(layoutStore.isDraggingVueNodes.value).toBe(false)
})
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc082d8 and 9427d7e.

📒 Files selected for processing (4)
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
🧰 Additional context used
📓 Path-based instructions (14)
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/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
src/**/*.ts

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

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

Files:

  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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

Files:

  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use TypeScript exclusively; do not write new JavaScript code
Use sorted and grouped imports organized by plugin/source
Enforce ESLint rules including Vue + TypeScript rules, disallow floating promises, disallow unused imports, and restrict i18n raw text in templates
Do not use any type or as any type assertions; fix the underlying type issue instead
Write code that is expressive and self-documenting; avoid redundant comments and clean as you go
Keep functions short and functional; minimize nesting and follow the arrow anti-pattern
Avoid mutable state; prefer immutability and assignment at point of declaration
Use function declarations instead of function expressions when possible
Use es-toolkit for utility functions
Implement proper error handling in code

Files:

  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
**/**/use[A-Z]*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables using the pattern useXyz.ts

Files:

  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
**/*.{ts,tsx,vue,js,jsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width

Files:

  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Minimize the surface area (exported values) of each module and composable

Files:

  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
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/LGraphCanvas.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/LGraphCanvas.ts
**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.test.ts: Use unit/component tests in tests-ui/ or src/**/*.test.ts with Vitest framework
For mocking in tests, leverage Vitest utilities; keep module mocks contained and avoid global mutable state within test files
Do not write change detector tests or tests dependent on non-behavioral features like utility classes or styles
Aim for behavioral coverage of critical and new features in unit tests

Files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
🧠 Learnings (33)
📓 Common learnings
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.
📚 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/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use useIntersectionObserver for visibility detection instead of custom scroll handlers

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • 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/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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/useSlotLinkInteraction.ts
  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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/**/*.{test,spec}.{js,ts,jsx,tsx} : When adding features, always write vitest unit tests using cursor rules in @.cursor

Applied to files:

  • src/lib/litegraph/src/LGraphCanvas.ts
  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.vue : Leverage VueUse functions for performance-enhancing styles in Vue components

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Use ref/reactive for state management in Vue 3 Composition API

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.vue : Prefer `useModel` over separately defining prop and emit for two-way binding

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.vue : Avoid new usage of PrimeVue components; use VueUse, shadcn/vue, or Reka UI instead

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Use lifecycle hooks: onMounted, onUpdated in Vue 3 Composition API

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Prefer emit/event-name for state changes over other communication patterns

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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 : Utilize ref and reactive for reactive state

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.{ts,tsx,vue} : Do not use `any` type or `as any` type assertions; fix the underlying type issue instead

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Use existing test utilities rather than writing custom utilities

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.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/**/*.{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
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Prefer the use of `test.extend` over loose variables; import `test as baseTest` from `vitest`

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : Do not write change detector tests or tests dependent on non-behavioral features like utility classes or styles

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.{ts,tsx,vue} : Use sorted and grouped imports organized by plugin/source

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Follow existing test patterns in the codebase

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : For mocking in tests, leverage Vitest utilities; keep module mocks contained and avoid global mutable state within test files

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Always prefer vitest mock functions over writing verbose manual mocks

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Mock external dependencies in tests

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Test across multiple viewports

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.ts
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Use `vitest` for unit testing in this project

Applied to files:

  • src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.test.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
📚 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
🧬 Code graph analysis (1)
src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts (1)
src/scripts/app.ts (1)
  • app (1772-1772)
⏰ 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). (12)
  • GitHub Check: playwright-tests-chromium-sharded (7, 8)
  • GitHub Check: playwright-tests-chromium-sharded (2, 8)
  • GitHub Check: playwright-tests-chromium-sharded (8, 8)
  • GitHub Check: playwright-tests-chromium-sharded (4, 8)
  • GitHub Check: playwright-tests-chromium-sharded (3, 8)
  • GitHub Check: playwright-tests-chromium-sharded (1, 8)
  • GitHub Check: playwright-tests (chromium-0.5x)
  • GitHub Check: playwright-tests (mobile-chrome)
  • GitHub Check: playwright-tests (chromium-2x)
  • GitHub Check: test
  • GitHub Check: lint-and-format
  • GitHub Check: collect
🔇 Additional comments (4)
src/renderer/extensions/vueNodes/composables/useNodePointerInteractions.ts (1)

68-72: LGTM! Consistent pan mode forwarding added.

The pan mode guard in onPointermove correctly mirrors the existing pattern in onPointerdown and onPointerup, ensuring pointer events are forwarded to the canvas when panning mode is active. This directly addresses the PR objective of enabling spacebar panning during node interactions.

src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts (3)

285-300: Good: cleaning up also resets LiteGraph pointer state

cleanupInteraction now explicitly clears app.canvas.pointer.isDown after ending a drag:

// Reset litegraph pointer state
if (app.canvas) {
  app.canvas.pointer.isDown = false
}

This correctly mirrors the manual pointer.isDown = true set at drag start and prevents the canvas from remaining in a “pointer down” state after a Vue-managed link drag, which is important for spacebar panning semantics. The logic looks consistent with how this composable owns the pointer state for these drags.


414-421: Spacebar panning: let LiteGraph handle pointer events while still finalizing Vue drag state

The new read_only checks in handlePointerMove and handlePointerUp look right for restoring legacy spacebar panning:

const handlePointerMove = (event: PointerEvent) => {
  if (!pointerSession.matches(event)) return

  // When in panning mode (read_only), let litegraph handle panning - don't stop propagation
  if (app.canvas?.read_only) return

  // Not in panning mode - Vue handles link drag, stop propagation to prevent litegraph interference
  event.stopPropagation()
  ...
}

const handlePointerUp = (event: PointerEvent) => {
  // When in panning mode, let litegraph handle - but still cleanup our link drag state
  if (!app.canvas?.read_only) {
    event.stopPropagation()
  }
  finishInteraction(event)
}
  • While read_only is true, link-drag motion is effectively paused on the Vue side and events are allowed to bubble to LGraphCanvas so it can pan the canvas.
  • On pointer up, LiteGraph still sees the event in panning mode (no stopPropagation), but finishInteraction/cleanupInteraction always run, so Vue drag state and pointer.isDown are cleaned up consistently.

This matches the intended “hold spacebar to pan even during a Vue link drag” behavior without introducing obvious double-handling problems.

Also applies to: 550-556


595-603: Guard link drags in read‑only mode and correctly seed LiteGraph pointer state

The new guards and pointer sync in onPointerDown look appropriate:

if (event.button !== 0) return
if (!nodeId) return
if (pointerSession.isActive()) return

// Don't start link drag if in panning mode - let litegraph handle panning
if (app.canvas?.read_only) return
...
pointerSession.begin(event.pointerId)
// Sync pointer state with litegraph so spacebar panning works
canvas.last_mouse = [event.clientX, event.clientY]
canvas.pointer.isDown = true
  • Early-returning when app.canvas.read_only is true avoids starting a new link drag while the canvas is globally read-only or in “hand/pan” mode.
  • Initializing canvas.last_mouse and canvas.pointer.isDown ensures processKey’s spacebar logic can immediately transition into dragging_canvas and that processMouseMove has a correct baseline delta when panning begins mid-drag.

Combined with the reset in cleanupInteraction, this is a coherent bridge between Vue slot interactions and LiteGraph’s internal pointer model.

Also applies to: 721-725

Remove the LiteGraph.vueNodesMode check when removing the document-level
keydown listener in unbindEvents. If vueNodesMode was true during bindEvents
but changed before unbindEvents, the listener would be left dangling.
Now guarded only by existence of _key_callback.
@Myestery Myestery requested a review from DrJKL January 5, 2026 21:49
@Myestery Myestery assigned christian-byrne and unassigned Myestery Jan 5, 2026
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: 1

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9427d7e and 0e47f9f.

📒 Files selected for processing (1)
  • src/lib/litegraph/src/LGraphCanvas.ts
🧰 Additional context used
📓 Path-based instructions (9)
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/lib/litegraph/src/LGraphCanvas.ts
src/**/*.ts

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

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

Files:

  • src/lib/litegraph/src/LGraphCanvas.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

Files:

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

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/lib/litegraph/src/LGraphCanvas.ts
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/LGraphCanvas.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/LGraphCanvas.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use TypeScript exclusively; do not write new JavaScript code
Use sorted and grouped imports organized by plugin/source
Enforce ESLint rules including Vue + TypeScript rules, disallow floating promises, disallow unused imports, and restrict i18n raw text in templates
Do not use any type or as any type assertions; fix the underlying type issue instead
Write code that is expressive and self-documenting; avoid redundant comments and clean as you go
Keep functions short and functional; minimize nesting and follow the arrow anti-pattern
Avoid mutable state; prefer immutability and assignment at point of declaration
Use function declarations instead of function expressions when possible
Use es-toolkit for utility functions
Implement proper error handling in code

Files:

  • src/lib/litegraph/src/LGraphCanvas.ts
**/*.{ts,tsx,vue,js,jsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width

Files:

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

📄 CodeRabbit inference engine (AGENTS.md)

Minimize the surface area (exported values) of each module and composable

Files:

  • src/lib/litegraph/src/LGraphCanvas.ts
🧠 Learnings (9)
📓 Common learnings
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.
📚 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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.ts
🧬 Code graph analysis (1)
src/lib/litegraph/src/LGraphCanvas.ts (1)
src/lib/litegraph/src/litegraph.ts (1)
  • LiteGraph (17-17)
⏰ 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). (4)
  • GitHub Check: lint-and-format
  • GitHub Check: test
  • GitHub Check: setup
  • GitHub Check: collect
🔇 Additional comments (1)
src/lib/litegraph/src/LGraphCanvas.ts (1)

2033-2037: Unconditional document keydown removal fixes prior cleanup asymmetry

Always removing the document‑level keydown listener when _key_callback exists (instead of gating on LiteGraph.vueNodesMode) correctly addresses the earlier risk of leaving a dangling listener if Vue Nodes mode changes between bind/unbind. This looks good given the new conditional add in bindEvents.

Myestery and others added 2 commits January 6, 2026 20:14
Broaden the target guard in processKey to skip all text-editable surfaces
(input, textarea, contenteditable) before handling shortcuts. This prevents
space/Ctrl+A/C from being blocked when typing in prompt textareas or other
multiline fields in Vue nodes mode.
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

🔧 Auto-fixes Applied

This PR has been automatically updated to fix linting and formatting issues.

⚠️ Important: Your local branch is now behind. Run git pull before making additional changes to avoid conflicts.

Changes made:

  • ESLint auto-fixes
  • Prettier formatting

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: 2

🤖 Fix all issues with AI Agents
In @src/lib/litegraph/src/LGraphCanvas.ts:
- Around line 3719-3725: The processKey handler introduces an early return for
inputs/textareas/contentEditable using a local const target but later re-fetches
e.target and uses @ts-expect-error for the Delete/Backspace check; update
processKey to reuse the same const target (the one defined near the new
early-return) for all subsequent element checks (including the Delete/Backspace
handling at the block around the later lines 3760-3771), extend the guard to
include target.isContentEditable consistently, and remove the @ts-expect-error
since the reused typed target will cover HTMLElement properties.
- Around line 1998-2001: The removeEventListener calls in unbindEvents() are
missing the capture option so listeners added with capture=true in bindEvents()
are not removed; update unbindEvents() to pass true for the capture parameter on
each matching removal (e.g. document.removeEventListener('keydown',
this._key_callback, true) and canvas.removeEventListener('pointerdown',
this._mousedown_callback, true)), doing the same for 'keyup', Vue document
keydown removal, pointerup and pointercancel so the _key_callback,
_mousedown_callback, _mouseup_callback and _mousecancel_callback listeners are
removed using the exact same capture flag used when added.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e47f9f and a47081c.

📒 Files selected for processing (1)
  • src/lib/litegraph/src/LGraphCanvas.ts
🧰 Additional context used
📓 Path-based instructions (9)
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/lib/litegraph/src/LGraphCanvas.ts
src/**/*.ts

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

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

Files:

  • src/lib/litegraph/src/LGraphCanvas.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

Files:

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

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/lib/litegraph/src/LGraphCanvas.ts
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/LGraphCanvas.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/LGraphCanvas.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use TypeScript exclusively; do not write new JavaScript code
Use sorted and grouped imports organized by plugin/source
Enforce ESLint rules including Vue + TypeScript rules, disallow floating promises, disallow unused imports, and restrict i18n raw text in templates
Do not use any type or as any type assertions; fix the underlying type issue instead
Write code that is expressive and self-documenting; avoid redundant comments and clean as you go
Keep functions short and functional; minimize nesting and follow the arrow anti-pattern
Avoid mutable state; prefer immutability and assignment at point of declaration
Use function declarations instead of function expressions when possible
Use es-toolkit for utility functions
Implement proper error handling in code

Files:

  • src/lib/litegraph/src/LGraphCanvas.ts
**/*.{ts,tsx,vue,js,jsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width

Files:

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

📄 CodeRabbit inference engine (AGENTS.md)

Minimize the surface area (exported values) of each module and composable

Files:

  • src/lib/litegraph/src/LGraphCanvas.ts
🧠 Learnings (9)
📓 Common learnings
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.
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
📚 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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.ts
⏰ 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). (4)
  • GitHub Check: lint-and-format
  • GitHub Check: setup
  • GitHub Check: test
  • GitHub Check: collect

…ariable

- Add capture:true to removeEventListener calls that were added with capture
  to prevent event listener leaks when unbinding
- Reuse existing target variable in Delete/Backspace check instead of
  re-accessing e.target with @ts-expect-error
- Add isContentEditable check to Delete/Backspace guard for consistency
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: 1

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

1994-2003: Avoid double-invoking processKey for canvas-targeted keydowns in Vue nodes mode

With both canvas and document registering keydown using the same callback, key events whose target is the canvas in LiteGraph.vueNodesMode will call processKey twice for non-handled keys (no block_default), so onKeyDown on selected nodes will also fire twice. This can subtly break node-level keyboard interactions.

You can eliminate the duplication by binding to either document or canvas:

Proposed fix: choose document vs canvas keydown based on vueNodesMode
     this._key_callback = this.processKey.bind(this)

-    canvas.addEventListener('keydown', this._key_callback, true)
-    // In Vue nodes mode, also listen on document for keydown since Vue elements may have focus
-    if (LiteGraph.vueNodesMode) {
-      document.addEventListener('keydown', this._key_callback, true)
-    }
+    if (LiteGraph.vueNodesMode) {
+      // In Vue nodes mode, listen on document since Vue elements may have focus
+      document.addEventListener('keydown', this._key_callback, true)
+    } else {
+      canvas.addEventListener('keydown', this._key_callback, true)
+    }

This keeps the desired document-level forwarding for Vue nodes while preserving the legacy canvas-only behavior and avoids duplicate processKey calls.

🤖 Fix all issues with AI Agents
In @src/lib/litegraph/src/LGraphCanvas.ts:
- Around line 3724-3731: Change the type assertion on the event target to use a
runtime instanceof check: replace the cast "const target = e.target as
HTMLElement | null" with code that first checks "if (!(e.target instanceof
HTMLElement)) return" (or assign after that check) and then keep the existing
localName/isContentEditable guards; apply the same replacement for the duplicate
block around the other occurrence (the block referencing target, e.target,
localName, and isContentEditable) so no type assertion is used and the
early-return logic remains identical.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 571bb51 and 0f6fb90.

📒 Files selected for processing (1)
  • src/lib/litegraph/src/LGraphCanvas.ts
🧰 Additional context used
📓 Path-based instructions (9)
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/lib/litegraph/src/LGraphCanvas.ts
src/**/*.ts

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

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

Files:

  • src/lib/litegraph/src/LGraphCanvas.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

Files:

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

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/lib/litegraph/src/LGraphCanvas.ts
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/LGraphCanvas.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/LGraphCanvas.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use TypeScript exclusively; do not write new JavaScript code
Use sorted and grouped imports organized by plugin/source
Enforce ESLint rules including Vue + TypeScript rules, disallow floating promises, disallow unused imports, and restrict i18n raw text in templates
Do not use any type or as any type assertions; fix the underlying type issue instead
Write code that is expressive and self-documenting; avoid redundant comments and clean as you go
Keep functions short and functional; minimize nesting and follow the arrow anti-pattern
Avoid mutable state; prefer immutability and assignment at point of declaration
Use function declarations instead of function expressions when possible
Use es-toolkit for utility functions
Implement proper error handling in code

Files:

  • src/lib/litegraph/src/LGraphCanvas.ts
**/*.{ts,tsx,vue,js,jsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width

Files:

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

📄 CodeRabbit inference engine (AGENTS.md)

Minimize the surface area (exported values) of each module and composable

Files:

  • src/lib/litegraph/src/LGraphCanvas.ts
🧠 Learnings (10)
📓 Common learnings
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.
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
📚 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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.ts
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{composables,components}/**/*.{ts,tsx,vue} : Clean up subscriptions in state management to prevent memory leaks

Applied to files:

  • src/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.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/lib/litegraph/src/LGraphCanvas.ts
🧬 Code graph analysis (1)
src/lib/litegraph/src/LGraphCanvas.ts (2)
src/lib/litegraph/src/litegraph.ts (1)
  • LiteGraph (17-17)
src/lib/litegraph/src/CanvasPointer.ts (1)
  • e (230-252)
⏰ 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). (11)
  • GitHub Check: playwright-tests (chromium-2x)
  • GitHub Check: playwright-tests-chromium-sharded (2, 8)
  • GitHub Check: playwright-tests-chromium-sharded (4, 8)
  • GitHub Check: playwright-tests (mobile-chrome)
  • GitHub Check: playwright-tests-chromium-sharded (8, 8)
  • GitHub Check: playwright-tests-chromium-sharded (1, 8)
  • GitHub Check: playwright-tests-chromium-sharded (5, 8)
  • GitHub Check: playwright-tests-chromium-sharded (3, 8)
  • GitHub Check: playwright-tests-chromium-sharded (7, 8)
  • GitHub Check: playwright-tests-chromium-sharded (6, 8)
  • GitHub Check: playwright-tests (chromium-0.5x)
🔇 Additional comments (1)
src/lib/litegraph/src/LGraphCanvas.ts (1)

2025-2043: Event listener teardown now correctly mirrors captured bindings

Matching removeEventListener(..., true) calls for the captured keyboard and pointer listeners (and always removing the potential document keydown listener) fixes the prior leak risk when canvases are destroyed or re-bound. This looks correct and robust.

Comment on lines +3724 to +3731
// Skip all text-editable surfaces to avoid blocking typing/selection/copy
const target = e.target as HTMLElement | null
if (
target?.localName === 'input' ||
target?.localName === 'textarea' ||
target?.isContentEditable
)
return
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

Text-editable guard behavior is correct; prefer instanceof HTMLElement over type assertion

The new early-return and Delete/Backspace guard now correctly skip all text-editable surfaces, which fixes the prior regression where space / Ctrl+A / Ctrl+C / Delete could be intercepted while typing. That behavior looks solid.

To better align with the “avoid type assertions in litegraph TS” guideline and the earlier suggestion for this block, consider tightening the typing with an instanceof check instead of asserting:

Proposed cleanup of target typing
-    // Skip all text-editable surfaces to avoid blocking typing/selection/copy
-    const target = e.target as HTMLElement | null
+    // Skip all text-editable surfaces to avoid blocking typing/selection/copy
+    const target =
+      e.target instanceof HTMLElement ? e.target : null
@@
       } else if (e.key === 'Delete' || e.key === 'Backspace') {
-        // delete or backspace (but don't intercept when editing text)
+        // delete or backspace (but don't intercept when editing text)
         if (
           target?.localName !== 'input' &&
           target?.localName !== 'textarea' &&
           !target?.isContentEditable
         ) {

Functionality stays the same, but this removes an unnecessary assertion and keeps the guard in line with the TypeScript/litegraph typing guidelines.

Also applies to: 3767-3772

🤖 Prompt for AI Agents
In @src/lib/litegraph/src/LGraphCanvas.ts around lines 3724 - 3731, Change the
type assertion on the event target to use a runtime instanceof check: replace
the cast "const target = e.target as HTMLElement | null" with code that first
checks "if (!(e.target instanceof HTMLElement)) return" (or assign after that
check) and then keep the existing localName/isContentEditable guards; apply the
same replacement for the duplicate block around the other occurrence (the block
referencing target, e.target, localName, and isContentEditable) so no type
assertion is used and the early-return logic remains identical.

@Myestery Myestery added the New Browser Test Expectations New browser test screenshot should be set by github action label Jan 6, 2026
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Updating Playwright Expectations

@github-actions github-actions bot removed the New Browser Test Expectations New browser test screenshot should be set by github action label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spacebar panning in Nodes 2.0

5 participants