Enable manual worktree organization (#11504)

Release Notes:

- Preserve order of worktrees in project
([#10883](https://github.com/zed-industries/zed/issues/10883)).
- Enable drag-and-drop reordering for project worktrees

Note: worktree order is not synced during collaboration but guests can
reorder their own project panels.

![Reordering
worktrees](https://github.com/zed-industries/zed/assets/1347854/1c63d83c-5d4e-4b55-b840-bfbf32521b2a)

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
Elliot Thomas 2024-05-24 10:15:48 +01:00 committed by GitHub
parent 1e5389a2be
commit b9697fb487
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 479 additions and 54 deletions

View file

@ -231,7 +231,7 @@ impl PickerDelegate for RecentProjectsDelegate {
.enumerate()
.map(|(id, (_, location))| {
let combined_string = match location {
SerializedWorkspaceLocation::Local(paths) => paths
SerializedWorkspaceLocation::Local(paths, _) => paths
.paths()
.iter()
.map(|path| path.compact().to_string_lossy().into_owned())
@ -291,7 +291,7 @@ impl PickerDelegate for RecentProjectsDelegate {
Task::ready(Ok(()))
} else {
match candidate_workspace_location {
SerializedWorkspaceLocation::Local(paths) => {
SerializedWorkspaceLocation::Local(paths, _) => {
let paths = paths.paths().as_ref().clone();
if replace_current_window {
cx.spawn(move |workspace, mut cx| async move {
@ -413,7 +413,7 @@ impl PickerDelegate for RecentProjectsDelegate {
let mut path_start_offset = 0;
let paths = match location {
SerializedWorkspaceLocation::Local(paths) => paths.paths(),
SerializedWorkspaceLocation::Local(paths, _) => paths.paths(),
SerializedWorkspaceLocation::DevServer(dev_server_project) => {
Arc::new(vec![PathBuf::from(format!(
"{}:{}",