project_panel: Fix file missing or duplicated when copying/moving multiple items using drag-n-drop#45567
Conversation
646be21 to
6642def
Compare
smitbarmase
left a comment
There was a problem hiding this comment.
Wouldn't it still throw already exists error on clicking replace in prompt? Since we don't currently handle replacing at worktree_store level:
zed/crates/project/src/worktree_store.rs
Line 377 in dd2cfc7
I think we should handle this prompt logic at worktree store level instead then.
|
Thanks for working on this. Edit: I ended up making disjoint changes in your branch. Let me know if you are okay with moving replacement prompt changes to separate PR so that we can get this merge. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a drag-and-drop bug in the project panel where dragging both a parent folder and its child would incorrectly move them separately instead of moving only the parent with its contents intact.
Key changes:
- Modified drag-and-drop logic to filter selections and prioritize parent directories, preventing redundant child entries
- Added conflict detection to prompt users when moving files/folders would cause name collisions
- Removed premature entry resolution in drag initiation to ensure proper parent-child relationship filtering
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/project_panel/src/project_panel.rs | Core logic changes: added conflict detection, moved entry resolution to drag handler, refactored disjoint_entries to be reusable |
| crates/project_panel/src/project_panel_tests.rs | Added comprehensive test coverage for the fix and removed premature resolve_entry calls in existing tests |
| crates/project_panel/Cargo.toml | Added log dependency for error reporting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sounds good to me. I’m happy to move the replacement prompt changes into a separate PR. Thanks for making the disjoint changes directly, that works for me. |
smitbarmase
left a comment
There was a problem hiding this comment.
Thanks, I removed the replace dialog logic. Looking forward to that PR with suggested changes. Merging this!
Thanks! I’ll follow up with the PR once I get a bit of time. Things have been busy since the holidays ended. |
…tiple items using drag-n-drop (#45567) Closes #45555 Refer #20859 for more. Release Notes: - Fixed a project panel drag-and-drop issue where selecting both a folder and its children could result in files being silently lost in some cases. --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
…tiple items using drag-n-drop (zed-industries#45567) Closes zed-industries#45555 Refer zed-industries#20859 for more. Release Notes: - Fixed a project panel drag-and-drop issue where selecting both a folder and its children could result in files being silently lost in some cases. --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
…tiple items using drag-n-drop (zed-industries#45567) Closes zed-industries#45555 Refer zed-industries#20859 for more. Release Notes: - Fixed a project panel drag-and-drop issue where selecting both a folder and its children could result in files being silently lost in some cases. --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
…tiple items using drag-n-drop (zed-industries#45567) Closes zed-industries#45555 Refer zed-industries#20859 for more. Release Notes: - Fixed a project panel drag-and-drop issue where selecting both a folder and its children could result in files being silently lost in some cases. --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Closes #45555
Refer #20859 for more.
Release Notes: