-
Notifications
You must be signed in to change notification settings - Fork 448
[refactor] Simplify Vue node resize to bottom-right corner only #7063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove multi-corner resize handles in favor of bottom-right only. This simplifies the resize logic and eliminates edge cases where corner resizing caused position drift issues. - Remove resizeMath.ts and its test (no longer needed) - Simplify useNodeResize to only handle bottom-right resize - Remove position tracking from resize callback - Remove unused moveNodeTo from LGraphNode
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the 📝 WalkthroughWalkthroughThe pull request simplifies node resize functionality by removing support for multi-directional corner resizing and consolidating to a single bottom-right handle. The session-based resize computation system is replaced with a simpler event-driven model that tracks only the initial size and computes deltas directly from pointer movement. Changes
Possibly related PRs
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 11/30/2025, 10:15:48 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results❌ Some tests failed ⏰ Completed at: 11/30/2025, 10:25:13 PM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.18 MB (baseline 3.18 MB) • ⚪ 0 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 947 kB (baseline 950 kB) • 🟢 -3.27 kBGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 139 kB (baseline 139 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 2 added / 2 removed Utilities & Hooks — 2.94 kB (baseline 2.94 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.84 MB (baseline 3.84 MB) • ⚪ 0 BBundles that do not match a named category
Status: 17 added / 17 removed |
There was a problem hiding this 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
🧹 Nitpick comments (1)
src/renderer/extensions/vueNodes/components/LGraphNode.vue (1)
316-325: Consider adding minimum height enforcement.The width is clamped to
MIN_NODE_WIDTH(225), but height has no minimum. While CSS and content naturally provide some floor, explicitly clamping height would prevent edge cases where users resize to unexpectedly small heights.const { startResize } = useNodeResize((result, element) => { if (isCollapsed.value) return // Clamp width to minimum to avoid conflicts with CSS min-width const clampedWidth = Math.max(result.size.width, MIN_NODE_WIDTH) + const clampedHeight = Math.max(result.size.height, MIN_NODE_HEIGHT) // Apply size directly to DOM element - ResizeObserver will pick this up element.style.setProperty('--node-width', `${clampedWidth}px`) - element.style.setProperty('--node-height', `${result.size.height}px`) + element.style.setProperty('--node-height', `${clampedHeight}px`) })You would also need to define
MIN_NODE_HEIGHT(e.g.,const MIN_NODE_HEIGHT = 50).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/renderer/extensions/vueNodes/components/LGraphNode.vue(3 hunks)src/renderer/extensions/vueNodes/interactions/resize/resizeMath.ts(0 hunks)src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts(3 hunks)tests-ui/tests/renderer/extensions/vueNodes/interactions/resize/resizeMath.test.ts(0 hunks)
💤 Files with no reviewable changes (2)
- tests-ui/tests/renderer/extensions/vueNodes/interactions/resize/resizeMath.test.ts
- src/renderer/extensions/vueNodes/interactions/resize/resizeMath.ts
🧰 Additional context used
📓 Path-based instructions (16)
**/*.vue
📄 CodeRabbit inference engine (.cursorrules)
**/*.vue: Use setup() function for component logic in Vue 3 Composition API
Utilize ref and reactive for reactive state in Vue 3
Implement computed properties with computed() function
Use watch and watchEffect for side effects in Vue 3
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection in Vue 3
Use Vue 3.5 style of default prop declaration with defineProps()
Organize Vue components in <script> <style> order
Use Tailwind CSS for styling Vue components
Implement responsive design with Tailwind CSS
Do not use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage). Use replacements: Select, Popover, DatePicker, ToggleSwitch, Drawer, AutoComplete, Tabs, Stepper, Message respectively
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components in Vue 3
Follow Vue 3 style guide and naming conventions
Never use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage)Never use
:class="[]"to merge class names - always useimport { cn } from '@/utils/tailwindUtil'for class merging in Vue templates
**/*.vue: Use TypeScript with Vue 3 Single File Components (.vuefiles)
Name Vue components in PascalCase (e.g.,MenuHamburger.vue)Files:
src/renderer/extensions/vueNodes/components/LGraphNode.vue**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.jsonFiles:
src/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts**/*.{ts,tsx,js,vue}
📄 CodeRabbit inference engine (.cursorrules)
Implement proper error handling in components and services
**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in.prettierrc
Organize imports by sorting and grouping by plugin, and runpnpm formatbefore committingFiles:
src/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/renderer/extensions/vueNodes/interactions/resize/useNodeResize.tssrc/**/*.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 conventionsFiles:
src/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/**/*.{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.jsonFiles:
src/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
Use camelCase for variable and setting names in TypeScript/Vue files
Files:
src/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts**/*.{vue,html}
📄 CodeRabbit inference engine (CLAUDE.md)
Never use
dark:ordark-theme:Tailwind variants - instead use semantic values fromstyle.csstheme, e.g.bg-node-component-surfaceFiles:
src/renderer/extensions/vueNodes/components/LGraphNode.vue**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,vue}: Useconst settingStore = useSettingStore()andsettingStore.get('Comfy.SomeSetting')to retrieve settings in TypeScript/Vue files
Useawait settingStore.set('Comfy.SomeSetting', newValue)to update settings in TypeScript/Vue files
Check server capabilities usingapi.serverSupportsFeature('feature_name')before using enhanced features
Useapi.getServerFeature('config_name', defaultValue)to retrieve server feature configurationEnforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates
Files:
src/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/renderer/extensions/vueNodes/interactions/resize/useNodeResize.tssrc/**/*.{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 codebaseFiles:
src/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/renderer/extensions/vueNodes/interactions/resize/useNodeResize.tssrc/**/{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/LGraphNode.vuesrc/**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Follow Vue 3 composition API style guide
Files:
src/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/renderer/extensions/vueNodes/interactions/resize/useNodeResize.tssrc/**/{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.jsonFiles:
src/renderer/extensions/vueNodes/components/LGraphNode.vue**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursorrules)
Use es-toolkit for utility functions
Files:
src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
Use TypeScript for type safety
**/*.{ts,tsx}: Never useanytype - use proper TypeScript types
Never useas anytype assertions - fix the underlying type issueFiles:
src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.tssrc/**/*.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safetyFiles:
src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.ts: Define dynamic setting defaults using runtime context with functions in settings configuration
UsedefaultsByInstallVersionproperty for gradual feature rollout based on version in settings configurationFiles:
src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts🧠 Learnings (2)
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: .cursorrules:0-0 Timestamp: 2025-11-24T19:46:52.279Z Learning: Applies to **/*.{vue,ts,tsx} : Leverage VueUse functions for performance-enhancing utilitiesApplied to files:
src/renderer/extensions/vueNodes/components/LGraphNode.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} : The `size` and `pos` properties of `Rectangle` share the same array buffer (`subarray`); they may be used to set the rectangle's size and positionApplied to files:
src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts🧬 Code graph analysis (1)
src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts (2)
src/renderer/extensions/vueNodes/composables/useNodeSnap.ts (1)
useNodeSnap(12-73)src/renderer/extensions/vueNodes/composables/useShiftKeySync.ts (1)
useShiftKeySync(25-107)⏰ 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). (2)
- GitHub Check: test
- GitHub Check: setup
🔇 Additional comments (4)
src/renderer/extensions/vueNodes/interactions/resize/useNodeResize.ts (1)
1-116: LGTM! Clean simplification of the resize logic.The refactored composable correctly:
- Tracks initial size and pointer position at resize start
- Computes deltas directly from pointer movement with proper scale adjustment
- Integrates snapping via
shouldSnapandapplySnapToSize- Properly cleans up event listeners and state on pointer up
- Maintains pointer capture for reliable event handling
The removal of the session-based mechanism in favor of direct delta computation is a good simplification.
src/renderer/extensions/vueNodes/components/LGraphNode.vue (3)
262-265: LGTM! Clean removal of unused destructured value.Removing
moveNodeTofrom the destructuring aligns with the simplified resize model that no longer adjusts position during resize operations.
327-330: LGTM! Simplified resize handler.The handler correctly:
- Prevents resize on pinned nodes
- Delegates to
startResizewith just the event (no handle direction needed)
120-127: The i18n keyg.resizeFromBottomRightis already present insrc/locales/en/main.json(line 68) and properly localized across all language files. No translation additions are needed.
|
Updating Playwright Expectations |
|
@christian-byrne Backport to Please manually cherry-pick commit Conflicting files
|
|
@christian-byrne Backport to Please manually cherry-pick commit Conflicting files
|
|
@christian-byrne Backport to Please manually cherry-pick commit Conflicting files
|
Temporarily simplifies the resize logic to only work on bottom right corner and eliminates edge cases where corner resizing caused position drift issues. - Remove multi-corner resize handles in favor of bottom-right only - Delete resizeMath.ts and its tests (no longer needed) - Simplify useNodeResize to only handle bottom-right resize - Remove position tracking from resize callback --------- Co-authored-by: github-actions <[email protected]>
Temporarily simplifies the resize logic to only work on bottom right corner and eliminates edge cases where corner resizing caused position drift issues. - Remove multi-corner resize handles in favor of bottom-right only - Delete resizeMath.ts and its tests (no longer needed) - Simplify useNodeResize to only handle bottom-right resize - Remove position tracking from resize callback --------- Co-authored-by: github-actions <[email protected]>
Temporarily simplifies the resize logic to only work on bottom right corner and eliminates edge cases where corner resizing caused position drift issues. - Remove multi-corner resize handles in favor of bottom-right only - Delete resizeMath.ts and its tests (no longer needed) - Simplify useNodeResize to only handle bottom-right resize - Remove position tracking from resize callback --------- Co-authored-by: github-actions <[email protected]>
…only (#7063) (#7066) ## Summary - Backport of #7063 to core/1.32 - Simplifies Vue node resize to bottom-right corner only Cherry-picked from d76c59c ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7066-refactor-Backport-Simplify-Vue-node-resize-to-bottom-right-corner-only-7063-2bc6d73d365081fabcdde1c3876c5857) by [Unito](https://www.unito.io) Co-authored-by: github-actions <[email protected]>
…only (#7063) (#7067) ## Summary - Backport of #7063 to core/1.33 - Simplifies Vue node resize to bottom-right corner only Cherry-picked from d76c59c ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7067-backport-core-1-33-Simplify-Vue-node-resize-to-bottom-right-corner-only-7063-2bc6d73d36508189b25acf94c8639569) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <[email protected]>
… only (#7063) (#7068) ## Summary - Backport of #7063 to cloud/1.33 - Simplifies Vue node resize to bottom-right corner only Cherry-picked from d76c59c ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7068-backport-cloud-1-33-Simplify-Vue-node-resize-to-bottom-right-corner-only-7063-2bc6d73d36508149bd85c3ae534387b6) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <[email protected]>
Summary
Temporarily simplifies the resize logic to only work on bottom right corner and eliminates edge cases where corner resizing caused position drift issues.