-
Notifications
You must be signed in to change notification settings - Fork 78
fix(FR-1645): correct folder selection count after partial deletion #4613
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
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 4.61% | 530/11490 |
| 🔴 | Branches | 3.74% | 302/8081 |
| 🔴 | Functions | 2.88% | 102/3545 |
| 🔴 | Lines | 4.56% | 512/11234 |
Test suite run success
121 tests passing in 14 suites.
Report generated by 🧪jest coverage report action from d6e3e35
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.
Pull Request Overview
This PR fixes a bug where the selected folder count would become incorrect after partial deletion operations. The fix ensures that deleted, restored, or removed folders are properly removed from the selection state.
- Renamed the callback prop from
onRequestChangetoonRemoveRowfor clearer semantic meaning - Fixed selection state management by passing the folder ID to remove from the selected list
- Improved variable naming from
currentVFoldertodeletingVFolderfor better clarity
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| react/src/pages/VFolderNodeListPage.tsx | Updated callback prop name and simplified the filter logic for removing folders from selection |
| react/src/components/VFolderNodes.tsx | Renamed callback prop and variable, passed folder IDs to callback for proper selection state management |
| react/src/components/ImportNotebook.tsx | Removed extraneous blank line |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a957b73 to
9dead93
Compare
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.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9dead93 to
e4ea492
Compare
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 49.62% | 132/266 |
| 🔴 | Branches | 29.96% | 80/267 |
| 🔴 | Functions | 33.33% | 20/60 |
| 🔴 | Lines | 51.95% | 120/231 |
Test suite run success
55 tests passing in 3 suites.
Report generated by 🧪jest coverage report action from d6e3e35
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.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nowgnuesLee
left a comment
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.
LGTM
agatha197
left a comment
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.
LGTM
Merge activity
|
…4613) Resolves #4578 ([FR-1645](https://lablup.atlassian.net/browse/FR-1645)) ## 🐛 Problem Users experienced incorrect selected folder counts in multiple scenarios: 1. After partially deleting folders (moving to trash or permanent deletion) 2. After leaving a shared folder invitation 3. After restoring folders from trash This led to confusion when users tried to select all items again, as the count would not match the actual selection state. ## 💡 Solution This PR fixes the folder selection count mismatch by properly managing the selection state when folders are removed from the current view. ### Key Changes #### 1. Improved Callback Naming and Semantics - Renamed `onRequestChange` prop to `onRemoveRow` for better semantic clarity - The new name clearly indicates that the callback is triggered when a row is removed from the current list #### 2. Fixed Selection State Management - **Delete to Trash**: Properly removes deleted folders from selection - **Permanent Delete**: Correctly updates selection when folders are permanently deleted - **Restore from Trash**: Updates selection state when folders are restored - **Leave Shared Folder**: Now correctly removes the folder from selection when user leaves a shared folder invitation #### 3. Enhanced Code Readability - Renamed `currentVFolder` state to `deletingVFolder` for clearer intent - Added descriptive comment for the `onRemoveRow` prop #### 4. Improved User Notifications - Success messages now properly display after each operation - Consistent notification handling across all folder operations ## 📝 Changes in Detail ### VFolderNodes.tsx - Renamed callback prop from `onRequestChange` to `onRemoveRow` - Updated all mutation success handlers to use the new callback with correct parameters - Fixed SharedFolderPermissionInfoModal's `onLeaveFolder` to properly trigger row removal - Improved variable naming for better code clarity ### VFolderNodeListPage.tsx - Updated to use the new `onRemoveRow` prop - Simplified the folder removal logic for better readability - Ensures selection list is properly updated when folders are removed ## ✅ Testing Checklist - [ ] Select multiple folders and delete them (move to trash) - verify count updates correctly - [ ] Permanently delete folders from trash - verify selection count remains accurate - [ ] Restore folders from trash - verify selection state updates properly - [ ] Select a shared folder and leave the invitation - verify the folder is removed from selection - [ ] Select all folders, then partially delete some - verify "Select All" works correctly afterward - [ ] Verify success notifications appear for all operations ## 🎯 Impact This fix ensures a consistent and predictable user experience when managing folder selections, eliminating the confusion caused by mismatched selection counts after various folder operations. [FR-1645]: https://lablup.atlassian.net/browse/FR-1645?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
e4ea492 to
d6e3e35
Compare

Resolves #4578 (FR-1645)
🐛 Problem
Users experienced incorrect selected folder counts in multiple scenarios:
This led to confusion when users tried to select all items again, as the count would not match the actual selection state.
💡 Solution
This PR fixes the folder selection count mismatch by properly managing the selection state when folders are removed from the current view.
Key Changes
1. Improved Callback Naming and Semantics
onRequestChangeprop toonRemoveRowfor better semantic clarity2. Fixed Selection State Management
3. Enhanced Code Readability
currentVFolderstate todeletingVFolderfor clearer intentonRemoveRowprop4. Improved User Notifications
📝 Changes in Detail
VFolderNodes.tsx
onRequestChangetoonRemoveRowonLeaveFolderto properly trigger row removalVFolderNodeListPage.tsx
onRemoveRowprop✅ Testing Checklist
🎯 Impact
This fix ensures a consistent and predictable user experience when managing folder selections, eliminating the confusion caused by mismatched selection counts after various folder operations.