Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

assistant2: Hide the status bar icon when disabled via the settings (#22981)

Marshall Bowers80cc1f174ffe
diff --git a/crates/assistant2/src/assistant_panel.rs b/crates/assistant2/src/assistant_panel.rs
index 2d1d7adb293..894064842a8 100644
--- a/crates/assistant2/src/assistant_panel.rs
+++ b/crates/assistant2/src/assistant_panel.rs
@@ -279,7 +279,12 @@ impl Panel for AssistantPanel {
Some(proto::PanelId::AssistantPanel)
}
- fn icon(&self, _cx: &WindowContext) -> Option<IconName> {
+ fn icon(&self, cx: &WindowContext) -> Option<IconName> {
+ let settings = AssistantSettings::get_global(cx);
+ if !settings.enabled || !settings.button {
+ return None;
+ }
+
Some(IconName::ZedAssistant2)
}