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

@ -75,10 +75,11 @@ const displayInfo = JSON.parse(
encoding: "utf8",
}),
);
const mainDisplayResolution =
displayInfo?.SPDisplaysDataType[0]?.spdisplays_ndrvs
?.find((entry) => entry.spdisplays_main === "spdisplays_yes")
?._spdisplays_resolution?.match(RESOLUTION_REGEX);
const mainDisplayResolution = displayInfo?.SPDisplaysDataType?.flatMap(
(display) => display?.spdisplays_ndrvs,
)
?.find((entry) => entry?.spdisplays_main === "spdisplays_yes")
?._spdisplays_resolution?.match(RESOLUTION_REGEX);
if (!mainDisplayResolution) {
throw new Error("Could not parse screen resolution");
}