Skip to content

Commit 4917e94

Browse files
ConradIrwinnoaccOS
authored andcommitted
Tidy up some broken menu items (zed-industries#18306)
Release Notes: - ssh-remoting: Don't show "reveal in finder" in menu
1 parent 0b18ec7 commit 4917e94

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

crates/outline_panel/src/outline_panel.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3906,9 +3906,11 @@ impl Render for OutlinePanel {
39063906
.on_action(cx.listener(Self::toggle_active_editor_pin))
39073907
.on_action(cx.listener(Self::unfold_directory))
39083908
.on_action(cx.listener(Self::fold_directory))
3909-
.when(project.is_local_or_ssh(), |el| {
3909+
.when(project.is_local(), |el| {
39103910
el.on_action(cx.listener(Self::reveal_in_finder))
3911-
.on_action(cx.listener(Self::open_in_terminal))
3911+
})
3912+
.when(project.is_local_or_ssh(), |el| {
3913+
el.on_action(cx.listener(Self::open_in_terminal))
39123914
})
39133915
.on_mouse_down(
39143916
MouseButton::Right,

crates/project_panel/src/project_panel.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ impl ProjectPanel {
484484
let worktree_id = worktree.id();
485485
let is_read_only = project.is_read_only();
486486
let is_remote = project.is_via_collab() && project.dev_server_project_id().is_none();
487+
let is_local = project.is_local();
487488

488489
let context_menu = ContextMenu::build(cx, |menu, cx| {
489490
menu.context(self.focus_handle.clone()).map(|menu| {
@@ -495,13 +496,15 @@ impl ProjectPanel {
495496
menu.action("New File", Box::new(NewFile))
496497
.action("New Folder", Box::new(NewDirectory))
497498
.separator()
498-
.when(cfg!(target_os = "macos"), |menu| {
499+
.when(is_local && cfg!(target_os = "macos"), |menu| {
499500
menu.action("Reveal in Finder", Box::new(RevealInFileManager))
500501
})
501-
.when(cfg!(not(target_os = "macos")), |menu| {
502+
.when(is_local && cfg!(not(target_os = "macos")), |menu| {
502503
menu.action("Reveal in File Manager", Box::new(RevealInFileManager))
503504
})
504-
.action("Open in Default App", Box::new(OpenWithSystem))
505+
.when(is_local, |menu| {
506+
menu.action("Open in Default App", Box::new(OpenWithSystem))
507+
})
505508
.action("Open in Terminal", Box::new(OpenInTerminal))
506509
.when(is_dir, |menu| {
507510
menu.separator()

0 commit comments

Comments
 (0)