# project_panel: Restore worktree drag-and-drop reordering \(\#55755\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/8230cb16d1cffc1e6be044f2292d9f3189bf53a3)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 8230cb16d1cffc1e6be044f2292d9f3189bf53a3

Requested commit: 8230cb16d1cffc1e6be044f2292d9f3189bf53a3

Commit: 8230cb16d1cffc1e6be044f2292d9f3189bf53a3

Tree: 5de9e814b039e279d819b5ea99cb95eb9dce01a5

Author: Elliot Thomas

Committer: GitHub

## Message

```
project_panel: Restore worktree drag-and-drop reordering (#55755)

Reordering worktree roots by drag-and-drop had silently broken: a
worktree-root filter added to `disjoint_entries` for delete-safety
stripped roots before the drop handler could see them, so root-to-root
drops never reached the existing `move_worktree` reorder path.

This PR is the minimal regression fix:

- Move the worktree-root filter out of `disjoint_entries` and into
`disjoint_effective_entries` (used by cut/copy/delete), so drag-and-drop
keeps seeing roots and single-root reorder works again via the existing
`move_worktree` path.
- Filter worktree roots out of `drag_onto`'s copy branch, so holding the
copy modifier over a drag that contains a root no longer returns `None`
from `create_paste_path` and silently cancels the whole copy.
- Add `test_drag_worktree_root_reorders_worktrees` exercising the
drag-onto reorder flow end to end.

The larger feature work (multi-root group reordering, blank-area "send
to end", copy-mode drag feedback, and syncing worktree order to
collaborators) has been split into a separate follow-up PR so this fix
can land quickly. Note that worktree order was intentionally not synced
during collaboration, so that change is discussed separately.

Closes #46699

Release Notes:

- Fixed drag and drop to reorder worktrees

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
```

## Parents

- [7828463fcb6917a344d26edf46b271442bdbc375](https://git.cafe/gitcafe/zed/commit/7828463fcb6917a344d26edf46b271442bdbc375?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/8230cb16d1cffc1e6be044f2292d9f3189bf53a3?format=markdown)
