remoting: Allow Add/Remove remote folder (#14532)

Release Notes:

- remoting (alpha only): Allow add/remove folders to projects

---------

Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Conrad Irwin 2024-07-16 12:01:59 -06:00 committed by GitHub
parent be1387fee6
commit 62ab6e1a11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 612 additions and 239 deletions

View file

@ -460,9 +460,8 @@ impl ProjectPanel {
let is_foldable = auto_fold_dirs && self.is_foldable(entry, worktree);
let is_unfoldable = auto_fold_dirs && self.is_unfoldable(entry, worktree);
let worktree_id = worktree.id();
let is_local = project.is_local();
let is_read_only = project.is_read_only();
let is_remote = project.is_remote();
let is_remote = project.is_remote() && project.dev_server_project_id().is_none();
let context_menu = ContextMenu::build(cx, |menu, cx| {
menu.context(self.focus_handle.clone()).when_else(
@ -526,14 +525,12 @@ impl ProjectPanel {
menu.action("Trash", Box::new(Trash { skip_prompt: false }))
.action("Delete", Box::new(Delete { skip_prompt: false }))
})
.when(is_local & is_root, |menu| {
.when(!is_remote & is_root, |menu| {
menu.separator()
.when(!is_remote, |menu| {
menu.action(
"Add Folder to Project…",
Box::new(workspace::AddFolderToProject),
)
})
.action(
"Add Folder to Project…",
Box::new(workspace::AddFolderToProject),
)
.entry(
"Remove from Project",
None,
@ -544,7 +541,7 @@ impl ProjectPanel {
}),
)
})
.when(is_local & is_root, |menu| {
.when(is_root, |menu| {
menu.separator()
.action("Collapse All", Box::new(CollapseAllEntries))
})