From 80cc1f174ffe99b2dec76939bbd184bfcbf6e496 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 10 Jan 2025 14:44:57 -0500 Subject: [PATCH] assistant2: Hide the status bar icon when disabled via the settings (#22981) This PR makes it so the status bar icon for Assistant2 is hidden when it is disabled via the settings. Release Notes: - N/A --- crates/assistant2/src/assistant_panel.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/assistant2/src/assistant_panel.rs b/crates/assistant2/src/assistant_panel.rs index 2d1d7adb29339c65c0c5d8c79d976f0342927edf..894064842a88c4d3ccd52ec04c0152930ba5a010 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 { + fn icon(&self, cx: &WindowContext) -> Option { + let settings = AssistantSettings::get_global(cx); + if !settings.enabled || !settings.button { + return None; + } + Some(IconName::ZedAssistant2) }