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.

Respect the setting to show/hide the assistant and chat panels (#3909)

Marshall Bowersc8dcc80a1f1a
diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs
index 371cc9007a8..82ea9326e7d 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<Icon> {
- Some(Icon::Ai)
+ fn icon(&self, cx: &WindowContext) -> Option<Icon> {
+ 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 19acb17673c..b142fcbe7f9 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<ui::Icon> {
- Some(ui::Icon::MessageBubbles)
+ fn icon(&self, cx: &WindowContext) -> Option<ui::Icon> {
+ 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> {