Skip to content

Conversation

@jtydhr88
Copy link
Collaborator

@jtydhr88 jtydhr88 commented Dec 26, 2025

Summary

  • Fix widget callback signature to pass node as 3rd parameter for extensions like Impact Pack
  • Add triggerDraw call to update all legacy widgets when any widget value changes
  • Support computeLayoutSize for dynamic widget height calculation
  • Set node.canvasHeight for extensions that rely on this property
  • Use step/10 for number input buttons to match litegraph behavior

Fixes display and interaction issues with Impact Pack's Mask Rect Area nodes.

fix #7615 and #7616

it also requires Impact pack PR ltdrdata/ComfyUI-Impact-Pack#1167

Screenshots

Before

2025-12-26.13-56-15.mp4

After

2025-12-26.13-49-09.mp4

┆Issue is synchronized with this Notion page by Unito

@jtydhr88 jtydhr88 requested a review from a team as a code owner December 26, 2025 18:57
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Dec 26, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

📝 Walkthrough

Walkthrough

Expose widgets' computeLayoutSize capability as hasLayoutSize, change widget callback invocation to include canvas and node and trigger sibling redraws, sync processed widgets by name for grid row sizing, refine numeric step fallback, and prefer widget-provided layout height for legacy widgets.

Changes

Cohort / File(s) Summary
Safe widget mapping & manager
src/composables/graph/useGraphNodeManager.ts
Added hasLayoutSize?: boolean to SafeWidgetData; safeWidgetMapper now passes (value, app.canvas, node) to widget callbacks; triggers node.widgets?.forEach(w => w.triggerDraw?.()) after callback; sets hasLayoutSize via typeof widget.computeLayoutSize === 'function'.
Node widgets layout / grid rows
src/renderer/extensions/vueNodes/components/NodeWidgets.vue
Synchronizes processedWidgets with nodeData.widgets by name; excludes widgets with w.options?.hidden; computes gridTemplateRows using `shouldExpand(w.type)
Legacy widget height handling
src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
Introduced reactive containerHeight; derive height priority: widgetInstance.computedHeightwidgetInstance.computeLayoutSize(node).minHeightwidgetInstance.computeSize(width)[1]; persist to node.canvasHeight and apply as wrapper min-height; use derived height for canvas sizing/drawing.
Number input step logic
src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue, src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
Added step?: number to NumberWidgetOptions; step resolution: use options.step2 if present, else if options.step > 10 use step / 10, otherwise fall back to precision-derived step; minor local variable rename.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as Renderer (NodeWidgets)
  participant GM as GraphManager (safeWidgetMapper)
  participant Node as Node (node.widgets)
  participant Widget as WidgetInstance

  UI->>GM: widget input changed (value)
  GM->>Widget: invoke callback(value, app.canvas, node)
  GM->>Node: trigger node.widgets?.forEach(w => w.triggerDraw?.())
  Note right of Node: Sibling widgets receive triggerDraw
  Node->>UI: canvas redraw requests (per widget)
  UI->>Widget: draw on canvas with updated sizing (hasLayoutSize / computed height)
Loading

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The pull request addresses all coding requirements from issue #7615: fixes widget callback signature to pass node parameter [#7615], adds triggerDraw for widget updates [#7615], supports computeLayoutSize for dynamic height [#7615], sets node.canvasHeight [#7615], and implements step/10 logic [#7615].
Out of Scope Changes check ✅ Passed All changes are directly scoped to restoring Mask Rect Area node functionality: widget callback/draw mechanisms, layout sizing, and number input stepping align with PR objectives and issue #7615 requirements.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch widget-height-impactPack

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 26, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 12/26/2025, 07:42:19 PM UTC

📈 Summary

  • Total Tests: 507
  • Passed: 495 ✅
  • Failed: 0
  • Flaky: 4 ⚠️
  • Skipped: 8 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 485 / ❌ 0 / ⚠️ 3 / ⏭️ 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.

@github-actions
Copy link

github-actions bot commented Dec 26, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 12/26/2025, 07:33:37 PM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Dec 26, 2025

Bundle Size Report

Summary

  • Raw size: 17.3 MB baseline 17.3 MB — 🔴 +988 B
  • Gzip: 3.54 MB baseline 3.54 MB — 🔴 +219 B
  • Brotli: 2.7 MB baseline 2.7 MB — 🔴 +125 B
  • Bundles: 98 current • 98 baseline • 42 added / 42 removed

Category Glance
App Entry Points 🔴 +571 B (3.19 MB) · UI Components 🔴 +271 B (196 kB) · Graph Workspace 🔴 +146 B (995 kB) · Vendor & Third-Party ⚪ 0 B (9.1 MB) · Other ⚪ 0 B (3.47 MB) · Panels & Settings ⚪ 0 B (296 kB) · + 3 more

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

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-BBVsBXBi.js (new) 3 MB 🔴 +3 MB 🔴 +632 kB 🔴 +480 kB
assets/index-eSl4fiw3.js (removed) 3 MB 🟢 -3 MB 🟢 -632 kB 🟢 -480 kB
assets/index-_fouHU0-.js (new) 192 kB 🔴 +192 kB 🔴 +41.8 kB 🔴 +34.8 kB
assets/index-e7kMEInS.js (removed) 192 kB 🟢 -192 kB 🟢 -41.8 kB 🟢 -34.8 kB
assets/index-BNjSpxVh.js (new) 345 B 🔴 +345 B 🔴 +242 B 🔴 +237 B
assets/index-D_kv6Nqt.js (removed) 345 B 🟢 -345 B 🟢 -247 B 🟢 -200 B

Status: 3 added / 3 removed

Graph Workspace — 995 kB (baseline 995 kB) • 🔴 +146 B

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-l38kpDCD.js (new) 995 kB 🔴 +995 kB 🔴 +194 kB 🔴 +148 kB
assets/GraphView-41GwIp0J.js (removed) 995 kB 🟢 -995 kB 🟢 -194 kB 🟢 -148 kB

Status: 1 added / 1 removed

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

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/UserSelectView-a3toC5Aq.js (new) 6.54 kB 🔴 +6.54 kB 🔴 +2.14 kB 🔴 +1.89 kB
assets/UserSelectView-Ablz8IlG.js (removed) 6.54 kB 🟢 -6.54 kB 🟢 -2.14 kB 🟢 -1.89 kB

Status: 1 added / 1 removed

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

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/LegacyCreditsPanel-C8N6sXet.js (removed) 21.4 kB 🟢 -21.4 kB 🟢 -5.16 kB 🟢 -4.51 kB
assets/LegacyCreditsPanel-DV9r16kh.js (new) 21.4 kB 🔴 +21.4 kB 🔴 +5.16 kB 🔴 +4.51 kB
assets/KeybindingPanel-D4MEnuNJ.js (removed) 13.6 kB 🟢 -13.6 kB 🟢 -3.42 kB 🟢 -3.01 kB
assets/KeybindingPanel-yLqwToHd.js (new) 13.6 kB 🔴 +13.6 kB 🔴 +3.42 kB 🔴 +3.02 kB
assets/ExtensionPanel-DUsFeWxF.js (removed) 10.8 kB 🟢 -10.8 kB 🟢 -2.57 kB 🟢 -2.24 kB
assets/ExtensionPanel-XYlKl6fu.js (new) 10.8 kB 🔴 +10.8 kB 🔴 +2.57 kB 🔴 +2.24 kB
assets/AboutPanel-BKeVzQHt.js (removed) 9.16 kB 🟢 -9.16 kB 🟢 -2.46 kB 🟢 -2.21 kB
assets/AboutPanel-CIlnvwr0.js (new) 9.16 kB 🔴 +9.16 kB 🔴 +2.46 kB 🔴 +2.21 kB
assets/ServerConfigPanel-C11RAIVE.js (new) 7.07 kB 🔴 +7.07 kB 🔴 +1.98 kB 🔴 +1.76 kB
assets/ServerConfigPanel-D5qHRLtT.js (removed) 7.07 kB 🟢 -7.07 kB 🟢 -1.98 kB 🟢 -1.77 kB
assets/UserPanel-C4YZGzh4.js (new) 6.23 kB 🔴 +6.23 kB 🔴 +1.72 kB 🔴 +1.5 kB
assets/UserPanel-DAMahL4a.js (removed) 6.23 kB 🟢 -6.23 kB 🟢 -1.71 kB 🟢 -1.5 kB
assets/settings-AN2JfZVQ.js 21.7 kB 21.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
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-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 — 196 kB (baseline 196 kB) • 🔴 +271 B

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/LazyImage.vue_vue_type_script_setup_true_lang-BF2GjQ6D.js (new) 59.9 kB 🔴 +59.9 kB 🔴 +12.4 kB 🔴 +10.8 kB
assets/LazyImage.vue_vue_type_script_setup_true_lang-lzCPR8P7.js (removed) 59.9 kB 🟢 -59.9 kB 🟢 -12.4 kB 🟢 -10.8 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-BF3AUWiH.js (removed) 54.3 kB 🟢 -54.3 kB 🟢 -8.62 kB 🟢 -7.41 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-D4lDBhxF.js (new) 54.3 kB 🔴 +54.3 kB 🔴 +8.62 kB 🔴 +7.42 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-BGhA0aGK.js (new) 48.8 kB 🔴 +48.8 kB 🔴 +10.5 kB 🔴 +9.14 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-Bt7rjpyD.js (removed) 48.8 kB 🟢 -48.8 kB 🟢 -10.5 kB 🟢 -9.14 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-DljVBTa4.js (new) 14.6 kB 🔴 +14.6 kB 🔴 +3.79 kB 🔴 +3.35 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-DRjviSg0.js (removed) 14.3 kB 🟢 -14.3 kB 🟢 -3.73 kB 🟢 -3.29 kB
assets/ComfyQueueButton-CRDJNf-L.js (new) 8.45 kB 🔴 +8.45 kB 🔴 +2.47 kB 🔴 +2.19 kB
assets/ComfyQueueButton-svkmskmy.js (removed) 8.45 kB 🟢 -8.45 kB 🟢 -2.47 kB 🟢 -2.2 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-BtgjsBuC.js (removed) 3.68 kB 🟢 -3.68 kB 🟢 -1.45 kB 🟢 -1.31 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-DwoKDeTv.js (new) 3.68 kB 🔴 +3.68 kB 🔴 +1.45 kB 🔴 +1.31 kB
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-CFOuz-F-.js (removed) 2.14 kB 🟢 -2.14 kB 🟢 -888 B 🟢 -762 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-D26cF9EB.js (new) 2.14 kB 🔴 +2.14 kB 🔴 +889 B 🔴 +777 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-BS4_gJsX.js (removed) 897 B 🟢 -897 B 🟢 -503 B 🟢 -444 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-xe0z0dWc.js (new) 897 B 🔴 +897 B 🔴 +502 B 🔴 +432 B
assets/UserAvatar.vue_vue_type_script_setup_true_lang-BJIauemk.js 1.34 kB 1.34 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetButton-CgdFl3qP.js 2.04 kB 2.04 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 8 added / 8 removed

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

Stores, services, APIs, and repositories

File Before After Δ Raw Δ Gzip Δ Brotli
assets/keybindingService-ClTdQUZc.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +1.83 kB 🔴 +1.57 kB
assets/keybindingService-CU8IV3AA.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -1.83 kB 🟢 -1.58 kB
assets/audioService-a7LPd3-B.js (new) 2.2 kB 🔴 +2.2 kB 🔴 +961 B 🔴 +826 B
assets/audioService-DyajYbVc.js (removed) 2.2 kB 🟢 -2.2 kB 🟢 -960 B 🟢 -821 B
assets/serverConfigStore-CNSmwya1.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-B04ffPBP.js (removed) 1.41 kB 🟢 -1.41 kB 🟢 -650 B 🟢 -549 B
assets/audioUtils-CgeRgIIe.js (new) 1.41 kB 🔴 +1.41 kB 🔴 +650 B 🔴 +545 B

Status: 1 added / 1 removed

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

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-chart-DOvov576.js 452 kB 452 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-other-BKKxyZwz.js 3.86 MB 3.86 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-DE5Oa-sb.js 1.96 MB 1.96 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-DYL0ZbEr.js 2.02 MB 2.02 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-CUNFo3Ub.js 232 kB 232 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-BlzIh1pE.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.47 MB (baseline 3.47 MB) • ⚪ 0 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/SubscriptionRequiredDialogContent-B7MMLLFY.js (new) 28 kB 🔴 +28 kB 🔴 +6.28 kB 🔴 +5.44 kB
assets/SubscriptionRequiredDialogContent-f-u_eOae.js (removed) 28 kB 🟢 -28 kB 🟢 -6.28 kB 🟢 -5.45 kB
assets/WidgetRecordAudio-CUDOMkBS.js (new) 20.4 kB 🔴 +20.4 kB 🔴 +5.23 kB 🔴 +4.63 kB
assets/WidgetRecordAudio-ehz9a96e.js (removed) 20.4 kB 🟢 -20.4 kB 🟢 -5.23 kB 🟢 -4.64 kB
assets/AudioPreviewPlayer-7NzlLje1.js (removed) 13.3 kB 🟢 -13.3 kB 🟢 -3.35 kB 🟢 -3 kB
assets/AudioPreviewPlayer-Di93i8ID.js (new) 13.3 kB 🔴 +13.3 kB 🔴 +3.35 kB 🔴 +3 kB
assets/ValueControlPopover-DYDLtnjh.js (removed) 5.49 kB 🟢 -5.49 kB 🟢 -1.7 kB 🟢 -1.51 kB
assets/ValueControlPopover-xYWRKnNs.js (new) 5.49 kB 🔴 +5.49 kB 🔴 +1.7 kB 🔴 +1.52 kB
assets/WidgetGalleria-B3QSewMd.js (new) 4.1 kB 🔴 +4.1 kB 🔴 +1.44 kB 🔴 +1.3 kB
assets/WidgetGalleria-D42m35eC.js (removed) 4.1 kB 🟢 -4.1 kB 🟢 -1.44 kB 🟢 -1.3 kB
assets/WidgetColorPicker-CXLdFVlu.js (new) 3.41 kB 🔴 +3.41 kB 🔴 +1.38 kB 🔴 +1.23 kB
assets/WidgetColorPicker-NAHswT_V.js (removed) 3.41 kB 🟢 -3.41 kB 🟢 -1.38 kB 🟢 -1.23 kB
assets/WidgetTextarea-CchFWhwn.js (removed) 3.08 kB 🟢 -3.08 kB 🟢 -1.21 kB 🟢 -1.08 kB
assets/WidgetTextarea-twr-QASA.js (new) 3.08 kB 🔴 +3.08 kB 🔴 +1.21 kB 🔴 +1.08 kB
assets/WidgetMarkdown-7LAciv9v.js (removed) 3.08 kB 🟢 -3.08 kB 🟢 -1.28 kB 🟢 -1.13 kB
assets/WidgetMarkdown-a25cjmF6.js (new) 3.08 kB 🔴 +3.08 kB 🔴 +1.28 kB 🔴 +1.13 kB
assets/WidgetAudioUI-DryQqs1N.js (removed) 2.89 kB 🟢 -2.89 kB 🟢 -1.16 kB 🟢 -1.06 kB
assets/WidgetAudioUI-iJeOgTpC.js (new) 2.89 kB 🔴 +2.89 kB 🔴 +1.17 kB 🔴 +1.06 kB
assets/WidgetInputText-BMUkuEfI.js (new) 1.99 kB 🔴 +1.99 kB 🔴 +918 B 🔴 +837 B
assets/WidgetInputText-GW3RIL__.js (removed) 1.99 kB 🟢 -1.99 kB 🟢 -915 B 🟢 -851 B
assets/WidgetToggleSwitch-BimIfs0c.js (new) 1.76 kB 🔴 +1.76 kB 🔴 +833 B 🔴 +736 B
assets/WidgetToggleSwitch-CuOmOnax.js (removed) 1.76 kB 🟢 -1.76 kB 🟢 -831 B 🟢 -729 B
assets/MediaImageBottom-BdQZdtem.js (new) 1.55 kB 🔴 +1.55 kB 🔴 +732 B 🔴 +640 B
assets/MediaImageBottom-Bhh6BqWQ.js (removed) 1.55 kB 🟢 -1.55 kB 🟢 -731 B 🟢 -641 B
assets/MediaAudioBottom-CUnWPD84.js (removed) 1.51 kB 🟢 -1.51 kB 🟢 -731 B 🟢 -647 B
assets/MediaAudioBottom-nHgOIeQW.js (new) 1.51 kB 🔴 +1.51 kB 🔴 +731 B 🔴 +646 B
assets/Media3DBottom-BC3zjRyo.js (removed) 1.5 kB 🟢 -1.5 kB 🟢 -729 B 🟢 -648 B
assets/Media3DBottom-CJtSlxnj.js (new) 1.5 kB 🔴 +1.5 kB 🔴 +731 B 🔴 +648 B
assets/MediaVideoBottom-B_MAeSXm.js (new) 1.5 kB 🔴 +1.5 kB 🔴 +728 B 🔴 +645 B
assets/MediaVideoBottom-CSFbGDLi.js (removed) 1.5 kB 🟢 -1.5 kB 🟢 -730 B 🟢 -646 B
assets/Media3DTop-CiyGJvhx.js (removed) 1.49 kB 🟢 -1.49 kB 🟢 -761 B 🟢 -653 B
assets/Media3DTop-CQ97W2rI.js (new) 1.49 kB 🔴 +1.49 kB 🔴 +765 B 🔴 +652 B
assets/WidgetSelect-CNyX0ezX.js (new) 733 B 🔴 +733 B 🔴 +360 B 🔴 +327 B
assets/WidgetSelect-CqAugn3Q.js (removed) 733 B 🟢 -733 B 🟢 -360 B 🟢 -324 B
assets/WidgetInputNumber-CBM8780Y.js (removed) 673 B 🟢 -673 B 🟢 -347 B 🟢 -298 B
assets/WidgetInputNumber-CmcfuYr0.js (new) 673 B 🔴 +673 B 🔴 +346 B 🔴 +289 B
assets/Load3D-D4Wmr86n.js (new) 424 B 🔴 +424 B 🔴 +266 B 🔴 +226 B
assets/Load3D-DrJig3m2.js (removed) 424 B 🟢 -424 B 🟢 -267 B 🟢 -224 B
assets/WidgetLegacy-BrsiM3Mh.js (new) 364 B 🔴 +364 B 🔴 +238 B 🔴 +196 B
assets/WidgetLegacy-RLzxkQvF.js (removed) 364 B 🟢 -364 B 🟢 -239 B 🟢 -233 B
assets/commands-bTEY9Mp6.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-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-D_DjHRtM.js 91.1 kB 91.1 kB ⚪ 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-Bu3Uau7e.js 1.46 kB 1.46 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageTop-DTAowaFC.js 1.75 kB 1.75 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoTop-BqwS3WNi.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-C5_TWvc7.js 252 kB 252 kB ⚪ 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/WidgetChart-6jZh920S.js 2.48 kB 2.48 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetImageCompare-DZEnujCN.js 2.21 kB 2.21 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widgetPropFilter-BIbGSUAt.js 1.28 kB 1.28 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 20 added / 20 removed

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

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/widgets/components/WidgetInputNumberInput.vue (1)

33-53: Refactor to use the shared composable.

This computed duplicates the step calculation logic from useNumberStepCalculation.ts. Consider using the composable to maintain DRY principles and reduce maintenance burden.

🔎 Proposed refactor using the composable

Import the composable at the top of the script:

 import { cn } from '@/utils/tailwindUtil'
+import { useNumberStepCalculation } from '@/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation'
 import {

Replace the stepValue computed with:

-// Calculate the step value based on precision or widget options
-const stepValue = computed(() => {
-  // Use step2 (correct input spec value) if available
-  if (props.widget.options?.step2 !== undefined) {
-    return Number(props.widget.options.step2)
-  }
-  // Use step / 10 to match litegraph behavior (step is 10x for drag, buttons use step/10)
-  if (props.widget.options?.step !== undefined) {
-    return Number(props.widget.options.step) / 10
-  }
-  // Otherwise, derive from precision
-  if (precision.value !== undefined) {
-    if (precision.value === 0) {
-      return 1
-    }
-    // For precision > 0, step = 1 / (10^precision)
-    // precision 1 → 0.1, precision 2 → 0.01, etc.
-    return Number((1 / Math.pow(10, precision.value)).toFixed(precision.value))
-  }
-  // Default to 'any' for unrestricted stepping
-  return 0
-})
+const stepValue = useNumberStepCalculation(
+  props.widget.options,
+  precision,
+  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 533295a and c7e3a4d.

📒 Files selected for processing (5)
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
🧰 Additional context used
📓 Path-based instructions (13)
src/**/*.vue

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

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

Files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
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/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
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/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
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/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
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/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
**/*.vue

📄 CodeRabbit inference engine (AGENTS.md)

**/*.vue: Use Vue 3.5+ with TypeScript in .vue files, exclusively using Composition API with <script setup lang="ts"> syntax
Use Tailwind 4 for styling in Vue components; avoid <style> blocks
Name Vue components using PascalCase (e.g., MenuHamburger.vue)
Use Vue 3.5 TypeScript-style default prop declaration with reactive props destructuring; do not use withDefaults or runtime props declaration
Prefer computed() over ref with watch when deriving values
Prefer useModel over separately defining prop and emit for two-way binding
Use vue-i18n in composition API for string literals; place new translation entries in src/locales/en/main.json
Use cn() utility function from @/utils/tailwindUtil for merging Tailwind class names; do not use :class="[]" syntax
Do not use the dark: Tailwind variant; use semantic values from the style.css theme instead (e.g., bg-node-component-surface)
Do not use !important or the ! important prefix for Tailwind classes; find and correct interfering !important classes instead
Avoid new usage of PrimeVue components; use VueUse, shadcn/vue, or Reka UI instead
Leverage VueUse functions for performance-enhancing styles in Vue components
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventions

Files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
**/*.{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/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
**/*.{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/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
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/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
**/**/use[A-Z]*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables using the pattern useXyz.ts

Files:

  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
🧠 Learnings (15)
📓 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-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 : Replace PrimeVue Steps component with Stepper without panels

Applied to files:

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

Applied to files:

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

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

Applied to files:

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

Applied to files:

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

Applied to files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
📚 Learning: 2025-12-11T03:55:51.755Z
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:51.755Z
Learning: In Vue components under src/renderer/extensions/vueNodes (e.g., ImagePreview.vue and LGraphNode.vue), implement image gallery keyboard navigation so that it responds to the node's focus state rather than requiring focus inside the image preview wrapper. Achieve this by wiring keyEvent handling at the node focus level and injecting or propagating key events (arrow keys) to the gallery when the node is focused/selected. This improves accessibility and aligns navigation with node-level focus behavior.

Applied to files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
📚 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/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
📚 Learning: 2025-12-18T02:07:38.870Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7598
File: src/components/sidebar/tabs/AssetsSidebarTab.vue:131-131
Timestamp: 2025-12-18T02:07:38.870Z
Learning: Tailwind CSS v4 safe utilities (e.g., items-center-safe, justify-*-safe, place-*-safe) are allowed in Vue components under src/ and in story files. Do not flag these specific safe variants as invalid when reviewing code in src/**/*.vue or related stories.

Applied to files:

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

Applied to files:

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

Applied to files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
📚 Learning: 2025-12-18T20:39:30.137Z
Learnt from: jtydhr88
Repo: Comfy-Org/ComfyUI_frontend PR: 7621
File: src/components/load3d/Load3DScene.vue:4-4
Timestamp: 2025-12-18T20:39:30.137Z
Learning: In src/components/load3d/Load3DScene.vue, the scoped `<style>` block with `!important` declarations for the canvas element is necessary because Three.js dynamically creates the canvas with inline styles, preventing direct application of Tailwind classes. This is a valid exception to the Tailwind-only styling guideline.

Applied to files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
📚 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/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.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). (5)
  • GitHub Check: deploy-and-comment
  • GitHub Check: lint-and-format
  • GitHub Check: test
  • GitHub Check: setup
  • GitHub Check: collect
🔇 Additional comments (8)
src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts (2)

5-8: LGTM: Clean interface extension.

The optional step property is properly typed and integrates well with the existing step2 and precision properties.


21-29: LGTM: Step calculation logic is correct.

The priority order (step2 → step/10 → precision-derived) makes sense, and the step/10 calculation correctly matches litegraph's behavior for increment/decrement buttons as documented in the PR objectives.

src/renderer/extensions/vueNodes/components/NodeWidgets.vue (1)

205-214: LGTM: Grid template rows logic is well-structured.

The name-based synchronization ensures alignment between processed widgets and node data widgets, and the integration of hasLayoutSize correctly supports dynamic widget height calculation. The row sizing logic (auto for expandable/layout-sized widgets, min-content for others) is appropriate.

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

50-50: LGTM: Clean interface extension.

The hasLayoutSize field is properly typed and integrates well with the widget sizing logic in NodeWidgets.vue.


172-181: LGTM: Callback signature and redraw logic correctly implement legacy compatibility.

The callback signature (value, undefined, node) correctly matches litegraph's convention, enabling extensions like Impact Pack to receive the node parameter. The triggerDraw call on all widgets ensures that legacy widgets with dependencies (e.g., mask preview) are updated when any widget value changes.


190-190: LGTM: hasLayoutSize detection is correct.

The function type check properly detects widgets with layout size computation capabilities, enabling dynamic height calculation in the rendering layer.

src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue (2)

20-20: LGTM: Dynamic height calculation implements legacy compatibility correctly.

The priority-based height derivation (computedHeight → computeLayoutSize → computeSize → default) provides a robust fallback chain. Setting node.canvasHeight enables extensions like Impact Pack to access the widget height, which addresses the PR objective of restoring Mask Rect Area node functionality.

Also applies to: 56-68


101-104: LGTM: Template binding correctly applies dynamic height.

The min-height style binding properly applies the reactive containerHeight value, ensuring the widget container respects the dynamically calculated size.

@jtydhr88 jtydhr88 force-pushed the widget-height-impactPack branch from c7e3a4d to 794056d Compare December 26, 2025 19:10
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/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue (1)

33-56: Code duplication: Consider using useNumberStepCalculation composable.

This step calculation logic duplicates the logic in src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts. While the duplication ensures consistency, using the shared composable would reduce maintenance burden.

🔎 Refactor to use shared composable
+import { useNumberStepCalculation } from '../composables/useNumberStepCalculation'
+
 const props = defineProps<{
   widget: SimplifiedWidget<number>
 }>()
 
-// Calculate the step value based on precision or widget options
-const stepValue = computed(() => {
-  // Use step2 (correct input spec value) if available
-  if (props.widget.options?.step2 !== undefined) {
-    return Number(props.widget.options.step2)
-  }
-  // Use step / 10 for custom large step values (> 10) to match litegraph behavior
-  // This is important for extensions like Impact Pack that use custom step values (e.g., 640)
-  // We skip default step values (1, 10) to avoid affecting normal widgets
-  const step = props.widget.options?.step
-  if (step !== undefined && step > 10) {
-    return Number(step) / 10
-  }
-  // Otherwise, derive from precision
-  if (precision.value !== undefined) {
-    if (precision.value === 0) {
-      return 1
-    }
-    // For precision > 0, step = 1 / (10^precision)
-    // precision 1 → 0.1, precision 2 → 0.01, etc.
-    return Number((1 / Math.pow(10, precision.value)).toFixed(precision.value))
-  }
-  // Default to 'any' for unrestricted stepping
-  return 0
-})
+const stepValue = useNumberStepCalculation(
+  props.widget.options,
+  precision,
+  false // returnUndefinedForDefault
+)
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7e3a4d and 794056d.

📒 Files selected for processing (5)
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
🧰 Additional context used
📓 Path-based instructions (13)
src/**/*.vue

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

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

Files:

  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
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/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
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/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
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/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
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/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
**/*.vue

📄 CodeRabbit inference engine (AGENTS.md)

**/*.vue: Use Vue 3.5+ with TypeScript in .vue files, exclusively using Composition API with <script setup lang="ts"> syntax
Use Tailwind 4 for styling in Vue components; avoid <style> blocks
Name Vue components using PascalCase (e.g., MenuHamburger.vue)
Use Vue 3.5 TypeScript-style default prop declaration with reactive props destructuring; do not use withDefaults or runtime props declaration
Prefer computed() over ref with watch when deriving values
Prefer useModel over separately defining prop and emit for two-way binding
Use vue-i18n in composition API for string literals; place new translation entries in src/locales/en/main.json
Use cn() utility function from @/utils/tailwindUtil for merging Tailwind class names; do not use :class="[]" syntax
Do not use the dark: Tailwind variant; use semantic values from the style.css theme instead (e.g., bg-node-component-surface)
Do not use !important or the ! important prefix for Tailwind classes; find and correct interfering !important classes instead
Avoid new usage of PrimeVue components; use VueUse, shadcn/vue, or Reka UI instead
Leverage VueUse functions for performance-enhancing styles in Vue components
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventions

Files:

  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
**/*.{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/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
**/*.{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/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
src/**/*.ts

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

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

Files:

  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.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/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
**/**/use[A-Z]*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables using the pattern useXyz.ts

Files:

  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

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

Applied to files:

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

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

Applied to files:

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

Applied to files:

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

Applied to files:

  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
📚 Learning: 2025-12-11T03:55:51.755Z
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:51.755Z
Learning: In Vue components under src/renderer/extensions/vueNodes (e.g., ImagePreview.vue and LGraphNode.vue), implement image gallery keyboard navigation so that it responds to the node's focus state rather than requiring focus inside the image preview wrapper. Achieve this by wiring keyEvent handling at the node focus level and injecting or propagating key events (arrow keys) to the gallery when the node is focused/selected. This improves accessibility and aligns navigation with node-level focus behavior.

Applied to files:

  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
📚 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/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
📚 Learning: 2025-12-18T02:07:38.870Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7598
File: src/components/sidebar/tabs/AssetsSidebarTab.vue:131-131
Timestamp: 2025-12-18T02:07:38.870Z
Learning: Tailwind CSS v4 safe utilities (e.g., items-center-safe, justify-*-safe, place-*-safe) are allowed in Vue components under src/ and in story files. Do not flag these specific safe variants as invalid when reviewing code in src/**/*.vue or related stories.

Applied to files:

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

Applied to files:

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

Applied to files:

  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
📚 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/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.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/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.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/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.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 : Replace PrimeVue Steps component with Stepper without panels

Applied to files:

  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
📚 Learning: 2025-12-18T20:39:30.137Z
Learnt from: jtydhr88
Repo: Comfy-Org/ComfyUI_frontend PR: 7621
File: src/components/load3d/Load3DScene.vue:4-4
Timestamp: 2025-12-18T20:39:30.137Z
Learning: In src/components/load3d/Load3DScene.vue, the scoped `<style>` block with `!important` declarations for the canvas element is necessary because Three.js dynamically creates the canvas with inline styles, preventing direct application of Tailwind classes. This is a valid exception to the Tailwind-only styling guideline.

Applied to files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
🧬 Code graph analysis (1)
src/composables/graph/useGraphNodeManager.ts (2)
src/lib/litegraph/src/widgets/BaseWidget.ts (3)
  • value (100-102)
  • value (104-106)
  • node (61-63)
src/scripts/domWidget.ts (2)
  • value (142-144)
  • value (146-149)
⏰ 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 (8)
src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue (3)

20-20: LGTM: Sensible default for container height.

The initial value of 20px matches the fallback in the draw() function and provides a reasonable minimum height before the first render.


101-104: LGTM: Dynamic height binding works correctly.

The template properly binds the container's min-height to the reactive containerHeight value, ensuring the wrapper resizes based on the widget's computed height.


56-68: No issues found. Type definitions guarantee the return types are correct.

The Size type is defined as [width: number, height: number] and computeLayoutSize is typed to return { minHeight: number, ... }. TypeScript enforces these contracts for all implementations, so the code correctly uses computeLayoutSize(node).minHeight and computeSize(width)[1] without needing defensive checks. The @ts-expect-error for node.canvasHeight is appropriately scoped to only the custom property assignment.

src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts (2)

4-8: LGTM: Backward-compatible API extension.

Adding the optional step property to NumberWidgetOptions is backward-compatible and aligns with the existing options structure.


19-44: Remove or correct the misleading claim about litegraph behavior.

The step/10 division is not to "match litegraph behavior." LiteGraph uses standard HTML <input type="number"> with no documented special-case for step > 10. The actual purpose is to undo a deprecated 10x multiplier stored by legacy implementations in useIntWidget and useFloatWidget (marked as @deprecated Use step2 instead. The 10x value is a legacy implementation.). When step2 is available, it's used directly; the step/10 fallback handles only older widgets still using the legacy 10x-multiplied step value. Update the comment to clarify this is a legacy compatibility workaround, not litegraph-specific behavior.

Likely an incorrect or invalid review comment.

src/composables/graph/useGraphNodeManager.ts (2)

43-57: LGTM: hasLayoutSize flag enables layout-aware rendering.

Adding hasLayoutSize to SafeWidgetData allows downstream components to adapt grid layouts for widgets with custom sizing requirements. This is backward-compatible and aligns with the PR objectives.


190-190: LGTM: Correct detection of layout-capable widgets.

The typeof check correctly identifies widgets that implement computeLayoutSize, enabling layout-aware rendering downstream.

src/renderer/extensions/vueNodes/components/NodeWidgets.vue (1)

205-214: LGTM: Layout sizing driven by widget capabilities.

The cross-check between processedWidgets and nodeData.widgets by name prevents rendering mismatches. Row sizing correctly combines two mechanisms: shouldExpand() for explicitly expandable types ('textarea', 'markdown', 'load3D') and hasLayoutSize for widgets implementing custom computeLayoutSize() functions. This dual approach ensures all widgets requiring dynamic height—whether hardcoded types or custom implementations—receive flexible sizing ('auto' instead of 'min-content').

@jtydhr88 jtydhr88 force-pushed the widget-height-impactPack branch from 794056d to 6671d57 Compare December 26, 2025 19:32
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

♻️ Duplicate comments (1)
src/composables/graph/useGraphNodeManager.ts (1)

179-181: Performance concern: blanket redraw on all widgets.

Calling triggerDraw() on all widgets whenever any widget value changes could impact performance on nodes with many widgets. Each widget change triggers a redraw of all sibling widgets, which may be unnecessary if widgets are independent.

Consider implementing targeted redraws:

  • Only trigger redraws for widgets that declare dependencies on other widgets
  • Skip triggering redraw on the originating widget
  • Use a dependency graph or explicit widget relationships to minimize unnecessary work
💡 Possible optimization approaches

Approach 1: Skip the originating widget

-        node.widgets?.forEach((w) => w.triggerDraw?.())
+        node.widgets?.forEach((w) => {
+          if (w !== widget) w.triggerDraw?.()
+        })

Approach 2: Opt-in dependency tracking

// Widgets could declare dependencies
interface IBaseWidget {
  dependsOn?: string[] // Names of other widgets
  // ...
}

// Only trigger redraws for dependent widgets
node.widgets?.forEach((w) => {
  if (w.dependsOn?.includes(widget.name)) {
    w.triggerDraw?.()
  }
})
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 794056d and 6671d57.

📒 Files selected for processing (5)
  • src/composables/graph/useGraphNodeManager.ts
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
🧰 Additional context used
📓 Path-based instructions (13)
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/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
**/**/use[A-Z]*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables using the pattern useXyz.ts

Files:

  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.ts
src/**/*.vue

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

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

Files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
**/*.vue

📄 CodeRabbit inference engine (AGENTS.md)

**/*.vue: Use Vue 3.5+ with TypeScript in .vue files, exclusively using Composition API with <script setup lang="ts"> syntax
Use Tailwind 4 for styling in Vue components; avoid <style> blocks
Name Vue components using PascalCase (e.g., MenuHamburger.vue)
Use Vue 3.5 TypeScript-style default prop declaration with reactive props destructuring; do not use withDefaults or runtime props declaration
Prefer computed() over ref with watch when deriving values
Prefer useModel over separately defining prop and emit for two-way binding
Use vue-i18n in composition API for string literals; place new translation entries in src/locales/en/main.json
Use cn() utility function from @/utils/tailwindUtil for merging Tailwind class names; do not use :class="[]" syntax
Do not use the dark: Tailwind variant; use semantic values from the style.css theme instead (e.g., bg-node-component-surface)
Do not use !important or the ! important prefix for Tailwind classes; find and correct interfering !important classes instead
Avoid new usage of PrimeVue components; use VueUse, shadcn/vue, or Reka UI instead
Leverage VueUse functions for performance-enhancing styles in Vue components
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventions

Files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
🧠 Learnings (15)
📚 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 : Replace PrimeVue Steps component with Stepper without panels

Applied to files:

  • src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
📚 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/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/composables/graph/useGraphNodeManager.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/widgets/composables/useNumberStepCalculation.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
  • src/composables/graph/useGraphNodeManager.ts
📚 Learning: 2025-12-09T03:49:52.828Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/platform/updates/components/WhatsNewPopup.vue:5-13
Timestamp: 2025-12-09T03:49:52.828Z
Learning: In Vue files across the ComfyUI_frontend repo, when a button is needed, prefer the repo's common button components from src/components/button/ (IconButton.vue, TextButton.vue, IconTextButton.vue) over plain HTML <button> elements. These components wrap PrimeVue with the project’s design system styling. Use only the common button components for consistency and theming, and import them from src/components/button/ as needed.

Applied to files:

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

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

Applied to files:

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

Applied to files:

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

Applied to files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
📚 Learning: 2025-12-11T03:55:51.755Z
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:51.755Z
Learning: In Vue components under src/renderer/extensions/vueNodes (e.g., ImagePreview.vue and LGraphNode.vue), implement image gallery keyboard navigation so that it responds to the node's focus state rather than requiring focus inside the image preview wrapper. Achieve this by wiring keyEvent handling at the node focus level and injecting or propagating key events (arrow keys) to the gallery when the node is focused/selected. This improves accessibility and aligns navigation with node-level focus behavior.

Applied to files:

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

Applied to files:

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

Applied to files:

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

Applied to files:

  • src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.vue
📚 Learning: 2025-12-18T20:39:30.137Z
Learnt from: jtydhr88
Repo: Comfy-Org/ComfyUI_frontend PR: 7621
File: src/components/load3d/Load3DScene.vue:4-4
Timestamp: 2025-12-18T20:39:30.137Z
Learning: In src/components/load3d/Load3DScene.vue, the scoped `<style>` block with `!important` declarations for the canvas element is necessary because Three.js dynamically creates the canvas with inline styles, preventing direct application of Tailwind classes. This is a valid exception to the Tailwind-only styling guideline.

Applied to files:

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

Applied to files:

  • src/composables/graph/useGraphNodeManager.ts
🧬 Code graph analysis (1)
src/composables/graph/useGraphNodeManager.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). (4)
  • GitHub Check: setup
  • GitHub Check: test
  • GitHub Check: lint-and-format
  • GitHub Check: collect
🔇 Additional comments (7)
src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue (1)

56-68: Well-structured height calculation with proper fallback chain.

The three-tier priority (computedHeightcomputeLayoutSizecomputeSize) ensures compatibility with various widget implementations. Setting node.canvasHeight for legacy extensions is essential for Impact Pack support.

src/renderer/extensions/vueNodes/widgets/composables/useNumberStepCalculation.ts (2)

40-43: Good variable rename for clarity.

Renaming step to calculatedStep avoids shadowing the outer step variable and improves code readability.


25-31: Add test coverage for custom step values (> 10) to ensure Impact Pack compatibility.

The step > 10 threshold is well-designed—it only affects widgets with custom step values that don't use the modern step2 field. Normal widgets default to step values that produce legacy values of 10 or 5, which don't trigger the threshold. However, there's no test case covering this behavior path. Add a test that verifies a custom step value (e.g., { step: 640 }) correctly divides by 10 to match litegraph behavior.

src/renderer/extensions/vueNodes/components/NodeWidgets.vue (1)

206-214: Proper widget synchronization and layout sizing.

The name-based synchronization between processedWidgets and nodeData.widgets ensures the grid layout matches the rendered widgets. Using w.hasLayoutSize to determine row sizing enables dynamic height calculation for legacy widgets like Impact Pack's Mask Rect Area.

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

176-178: Callback signature correctly fixed to match LiteGraph standard.

The callback now passes (value, app.canvas, node) which properly matches the LiteGraph signature and resolves the compatibility issue with extensions like Impact Pack that expect node as the 3rd parameter.


51-51: Proper exposure of layout capability.

Adding hasLayoutSize?: boolean to SafeWidgetData enables Vue components to determine whether widgets support dynamic layout sizing, which is essential for Impact Pack's Mask Rect Area nodes.


191-191: Correct capability detection.

The type check typeof widget.computeLayoutSize === 'function' correctly identifies widgets that support dynamic layout sizing.

Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +179 to +181
// Trigger redraw for all legacy widgets on this node (e.g., mask preview)
// This ensures widgets that depend on other widget values get updated
node.widgets?.forEach((w) => w.triggerDraw?.())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this line ever actually make a difference?

This callback is exclusively used on the vue side when @update:modelValue is emitted, but WidgetLegacy never emits (or defines a model) because all the values are tracked on the litegraph side.

.map((w) => (shouldExpand(w.type) ? 'auto' : 'min-content'))
if (!nodeData?.widgets) return ''
const processedNames = new Set(toValue(processedWidgets).map((w) => w.name))
return nodeData.widgets
Copy link
Contributor

Choose a reason for hiding this comment

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

This logic should be order dependent. You should be able to test it with a subgraph that contains multiple of the same type of node with the same widget promoted.

}
containerHeight.value = height
// Set node.canvasHeight for legacy widgets that use it (e.g., Impact Pack)
// @ts-expect-error canvasHeight is a custom property used by some extensions
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you augment the type instead of adding a suppression?

@jtydhr88 jtydhr88 marked this pull request as draft December 27, 2025 14:02
@jtydhr88
Copy link
Collaborator Author

FYI, as one contributor from impact-pack made fix ltdrdata/ComfyUI-Impact-Pack#1168, likely we may not need to fix on our side, I will follow it up and update for you guys.
Made my PR as draft for now

@andreszs
Copy link

andreszs commented Dec 28, 2025

FYI, as one contributor from impact-pack made fix ltdrdata/ComfyUI-Impact-Pack#1168, likely we may not need to fix on our side, I will follow it up and update for you guys. Made my PR as draft for now

image

Unfortunately my PR does not solve the issue with Nodes 2.0, the canvas does not show up. I really wanted to create the PR with Nodes 2.0 compatibility, but I didn't want to delay the PR any longer.

If this is merged with the old nodes, I'll ask GPT to refactor my PR to include Nodes 2.0 support from this PR sometime during next week, to have a fullly working version, compatible with Nodes 2.0 + INT inputs from primitive nodes.

@jtydhr88
Copy link
Collaborator Author

@andreszs, do you know when your PR ltdrdata/ComfyUI-Impact-Pack#1168 can be merged?

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.

Nodes 2.0 break Mask Rect Area node canvas

6 participants