From c8dcc80a1f1a39ae49d03fb1a85210bf4c486d59 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 5 Jan 2024 11:17:29 -0500 Subject: [PATCH] Respect the setting to show/hide the assistant and chat panels (#3909) This PR makes it so we respect the setting to show/hide the assistant and chat panels. Resolves https://github.com/zed-industries/community/issues/2370. Release Notes: - Fixed an issue where the settings to show/hide certain panels were not respected. --- crates/assistant/src/assistant_panel.rs | 4 ++-- crates/collab_ui/src/chat_panel.rs | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index 371cc9007a..82ea9326e7 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -1286,8 +1286,8 @@ impl Panel for AssistantPanel { } } - fn icon(&self, _cx: &WindowContext) -> Option { - Some(Icon::Ai) + fn icon(&self, cx: &WindowContext) -> Option { + Some(Icon::Ai).filter(|_| AssistantSettings::get_global(cx).button) } fn icon_tooltip(&self, _cx: &WindowContext) -> Option<&'static str> { diff --git a/crates/collab_ui/src/chat_panel.rs b/crates/collab_ui/src/chat_panel.rs index 19acb17673..b142fcbe7f 100644 --- a/crates/collab_ui/src/chat_panel.rs +++ b/crates/collab_ui/src/chat_panel.rs @@ -607,8 +607,12 @@ impl Panel for ChatPanel { "ChatPanel" } - fn icon(&self, _cx: &WindowContext) -> Option { - Some(ui::Icon::MessageBubbles) + fn icon(&self, cx: &WindowContext) -> Option { + if !is_channels_feature_enabled(cx) { + return None; + } + + Some(ui::Icon::MessageBubbles).filter(|_| ChatPanelSettings::get_global(cx).button) } fn icon_tooltip(&self, _cx: &WindowContext) -> Option<&'static str> {