-
Notifications
You must be signed in to change notification settings - Fork 454
fix: the display is abnormal when clicking back on multiple selected nodes #1201
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
WalkthroughThis update simplifies the multi-selection logic across the canvas components. In the Vue container and related files, the conditional logic determining multi-selection has been removed in favor of a direct reference to the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant C as Container
participant MS as useMultiSelect
participant CC as CanvasContainer
U->>C: Click node (trigger selectNode)
C->>MS: Call setMultiSelection(selectState)
MS-->>C: Update multiSelectedStates
C->>CC: Update UI with multiState (direct reference)
Note over C,CC: Multi-selection logic simplified
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
ERR_PNPM_OPTIONAL_DEPS_REQUIRE_PROD_DEPS Optional dependencies cannot be installed without production dependencies 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (4)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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)
packages/canvas/container/src/composables/useMultiSelect.js (1)
86-88: Simplified return for invalid selection stateYou've changed from returning
falseto simply returningundefinedwhen there's no valid selection state. While both values are falsy, make sure there aren't any explicit checks for=== falsein the codebase that might be affected by this change.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/canvas/container/src/CanvasContainer.vue(3 hunks)packages/canvas/container/src/composables/useMultiSelect.js(1 hunks)packages/canvas/container/src/container.js(5 hunks)packages/canvas/container/src/keyboard.js(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/canvas/container/src/CanvasContainer.vue
- packages/canvas/container/src/container.js
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: push-check
🔇 Additional comments (5)
packages/canvas/container/src/composables/useMultiSelect.js (3)
94-96: Good addition of guard clause for body elementAdding this early return prevents the body element from being part of multi-selection, which helps maintain a cleaner selection state.
98-100: Prevent empty selectionGood addition to prevent an empty selection list. This helps fix the abnormal display issue mentioned in the PR by maintaining at least one selected node.
102-108: Improved parent-child relationship handlingThis new code properly filters out child nodes when a parent is selected, preventing parent and child nodes from being selected simultaneously. This is likely a key fix for the abnormal display issue when clicking back on multiple selected nodes.
packages/canvas/container/src/keyboard.js (2)
99-110: Enhanced clipboard cut operation for multiple selectionsThe cut operation now properly handles multiple selected nodes instead of a single schema. Adding the
clearMultiSelection()at the end ensures the selection state is reset after cutting, which prevents stale selection state issues.
143-144: Updated function call signatureCorrectly updated the call to match the new function signature that no longer requires a schema parameter.
…nodes (opentiny#1201) 1. 多选节点进行点击回退剩余一个元素时,框选效果异常 2. 快捷键剪切失效
…nodes (opentiny#1201) 1. 多选节点进行点击回退剩余一个元素时,框选效果异常 2. 快捷键剪切失效
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Summary by CodeRabbit