-
Notifications
You must be signed in to change notification settings - Fork 407
Fix Node Event Handlers for Shift Click #6262
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
base: main
Are you sure you want to change the base?
Conversation
🎭 Playwright Test Results⏰ Completed at: 11/15/2025, 12:22:33 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 11/15/2025, 12:12:34 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
ea3fe09 to
24a0ce4
Compare
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 2.98 MB (baseline 2.98 MB) • ⚪ 0 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 804 kB (baseline 803 kB) • 🔴 +1.53 kBGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 8.03 kB (baseline 8.03 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 307 kB (baseline 307 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 210 kB (baseline 210 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed Data & Services — 12.6 kB (baseline 12.6 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 2 added / 2 removed Utilities & Hooks — 5.87 kB (baseline 5.87 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 5.32 MB (baseline 5.32 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.92 MB (baseline 3.92 MB) • ⚪ 0 BBundles that do not match a named category
Status: 15 added / 15 removed |
- Move node click deselection logic from useNodePointerInteractions to useNodeEventHandlers - Fix TypeScript issues by properly accessing nodeData.value - Remove unused isLGraphNode import and hasMultipleNodesSelected function - Simplify node selection logic in handleNodeSelect - Add handleNodeClickDeselect to centralize deselection handling
24a0ce4 to
ba35a30
Compare
73ab849 to
95b9b18
Compare
…threshold - Defer shift-click selection toggle until pointer up to enable shift+drag - Add 3px drag threshold to distinguish clicks from drags - Track node selection state from LGraphNode (not Vue reactive data) for accuracy - Add toggleNodeSelectionAfterPointerUp handler for deferred toggle logic - Refactor handleNodeSelect to skip selection changes when shift is held Behavior: - Shift+click unselected node: Adds to selection (if not dragging) - Shift+click selected node: Removes from selection (if not dragging) - Shift+drag selected/unselected nodes: Drags without changing selection - Regular click: Single select Fixes shift-click toggle not working due to immediate selection changes preventing drag detection, and fixes state sync issues between Vue reactive data and LGraphNode state.
…specs - Rewrite test descriptions to specify pointer down vs pointer up behavior - Replace negative assertions with positive behavior descriptions - Add new test coverage for shift key and drag scenarios Changes to useNodeEventHandlers.test.ts: - "defers selection changes" → "on pointer down with ctrl+click: brings node to front only, no selection changes" - Add shift key test for completeness - "selects/deselects node" → "on pointer up with multi-select: selects/deselects node that was unselected/selected at pointer down" - Clarify that regular clicks handled elsewhere (not by toggle handler) Changes to useNodePointerInteractions.test.ts: - Split single vague test into two specific scenarios - Add "on ctrl+click: calls toggleNodeSelectionAfterPointerUp on pointer up (not pointer down)" - Add "on ctrl+drag: does NOT call toggleNodeSelectionAfterPointerUp" Test count: 14 → 20 tests (6 new/improved) All tests now clearly specify WHEN (pointer down/up) and WHAT behavior occurs.
95b9b18 to
6b0f89b
Compare
Fixed an issue where pinned nodes could be dragged despite being pinned. The problem was that isPointerDown was set to true before checking if the node was pinned, allowing handlePointerMove to trigger drag detection. Changed the order of operations in handlePointerDown: 1. Track selection state 2. Call onNodeSelect (allows selecting pinned nodes) 3. Check if pinned and return early 4. Only then set up drag state (startPosition, isPointerDown, startDrag) This ensures pinned nodes remain selectable but cannot be dragged. Fixes browser_tests/tests/vueNodes/interactions/node/select.spec.ts:63
This pull request refactors the node selection and pointer interaction logic in the Vue node graph editor to improve multi-selection behavior, clarify event handling, and enhance test coverage. The main change is to defer multi-select toggle actions (such as ctrl+click for selection/deselection) from pointer down to pointer up, preventing premature selection state changes and making drag interactions more robust. The drag initiation logic is also refined to only start dragging after the pointer moves beyond a threshold, and new composable methods are introduced for granular node selection control.
Node selection and pointer event handling improvements:
useNodeEventHandlersIndividual: selection toggling is now deferred to pointer up, and pointer down only brings the node to front without changing selection state. The previoushasMultipleNodesSelectedfunction and related logic were removed for clarity. [1] [2] [3] [4]deselectNodeandtoggleNodeSelectionAfterPointerUptouseNodeEventHandlersIndividualfor more granular control over node selection, and exposed them in the returned API. [1] [2]Pointer interaction and drag behavior changes:
useNodePointerInteractionsto track pointer down/up state and only start dragging after the pointer moves beyond a pixel threshold. Multi-select toggling is now handled on pointer up, not pointer down, and selection state is read from the actual node manager for accuracy. [1] [2] [3] [4] [5] [6]Test suite enhancements:
These changes make node selection more predictable and user-friendly, and ensure drag and multi-select actions behave consistently in both the UI and the test suite.
fix #6128
Screen.Recording.2025-11-15.at.00.29.10.mov