From 685bf307e8bc27c9a7e759d037ac8fd149ddeb80 Mon Sep 17 00:00:00 2001 From: dino Date: Fri, 3 Jul 2026 14:15:54 +0100 Subject: [PATCH] chore(zed): add missing panels to view menu * Add both "Agent Panel" and "Git Panel" entries to the menu items for the "View" app menu. * Update the action used for the "Terminal Panel" menu item from `terminal_panel::ToggleFocus` to `terminal_panel::Toggle` to ensure we display a shortcut for this menu item. * Another valid option would be to update the default keymap to use `terminal_panel::ToggleFocus` instead but that would probably break existing user's expectations that the default shortcut toggles the terminal panel, instead of toggling its focus. * Introduce `zed_actions::git_panel` to be able to extract its `ToggleFocus` action, following the existing pattern. --- crates/git_ui/src/git_panel.rs | 6 +++--- crates/zed/src/zed/app_menus.rs | 10 +++++----- crates/zed_actions/src/lib.rs | 12 ++++++++++++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 0ace54e100e5d3..72a95416f9e1b2 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -89,7 +89,9 @@ use workspace::{ dock::{DockPosition, Panel, PanelEvent}, notifications::{DetachAndPromptErr, NotificationId, NotifyTaskExt}, }; -use zed_actions::{DecreaseBufferFontSize, IncreaseBufferFontSize, ResetBufferFontSize}; +use zed_actions::{ + DecreaseBufferFontSize, IncreaseBufferFontSize, ResetBufferFontSize, git_panel::ToggleFocus, +}; const GIT_PANEL_KEY: &str = "GitPanel"; const UPDATE_DEBOUNCE: Duration = Duration::from_millis(50); @@ -103,8 +105,6 @@ actions!( Close, /// Toggles the git panel. Toggle, - /// Toggles focus on the git panel. - ToggleFocus, /// Opens the git panel menu. OpenMenu, /// Focuses on the commit message editor. diff --git a/crates/zed/src/zed/app_menus.rs b/crates/zed/src/zed/app_menus.rs index 29a06747f9e4bb..bb1f3ee7aa1c1a 100644 --- a/crates/zed/src/zed/app_menus.rs +++ b/crates/zed/src/zed/app_menus.rs @@ -2,11 +2,9 @@ use collab_ui::collab_panel; use gpui::{App, Menu, MenuItem, OsAction}; use release_channel::ReleaseChannel; use terminal_view::terminal_panel; -use zed_actions::{debug_panel, dev}; +use zed_actions::{Quit, assistant, debug_panel, dev, git_panel, project_panel}; pub fn app_menus(cx: &mut App) -> Vec { - use zed_actions::Quit; - let mut view_items = vec![ MenuItem::action( "Zoom In", @@ -40,11 +38,13 @@ pub fn app_menus(cx: &mut App) -> Vec { ], }), MenuItem::separator(), - MenuItem::action("Project Panel", zed_actions::project_panel::ToggleFocus), + MenuItem::action("Project Panel", project_panel::ToggleFocus), MenuItem::action("Outline Panel", outline_panel::ToggleFocus), MenuItem::action("Collab Panel", collab_panel::ToggleFocus), - MenuItem::action("Terminal Panel", terminal_panel::ToggleFocus), + MenuItem::action("Terminal Panel", terminal_panel::Toggle), MenuItem::action("Debugger Panel", debug_panel::ToggleFocus), + MenuItem::action("Agent Panel", assistant::ToggleFocus), + MenuItem::action("Git Panel", git_panel::ToggleFocus), MenuItem::separator(), MenuItem::action("Diagnostics", diagnostics::Deploy), MenuItem::separator(), diff --git a/crates/zed_actions/src/lib.rs b/crates/zed_actions/src/lib.rs index a11eca78e0b5d5..4e48b694beb8d8 100644 --- a/crates/zed_actions/src/lib.rs +++ b/crates/zed_actions/src/lib.rs @@ -930,3 +930,15 @@ pub mod notebook { ] ); } + +pub mod git_panel { + use gpui::actions; + + actions!( + git_panel, + [ + /// Toggles focus on the git panel. + ToggleFocus, + ] + ); +}