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.
This commit is contained in:
Marshall Bowers 2024-01-05 11:17:29 -05:00 committed by GitHub
parent bf11a04410
commit c8dcc80a1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -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> {

View File

@ -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> {