From 14863e9a286685732c06995dc6f2e85d69270d85 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 19 Jan 2024 11:00:22 -0500 Subject: [PATCH] Fix assistant panel header when viewing conversation history (#4160) This PR fixes the assistant panel header when in the conversation history view to hide the irrelevant tools and/or the slots where they would go. Release Notes: - Improved the assistant panel header when viewing conversation history. --- crates/assistant/src/assistant_panel.rs | 36 +++++++++++++------------ 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index f2988b907c07cddba5c1646178762e8b28a508a5..1f57e52032b1e4e76f7297f577d4db82cf970eb3 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -1172,23 +1172,25 @@ impl Render for AssistantPanel { .px_2() .child(Label::new(editor.read(cx).title(cx)).into_element()) })) - .end_child(if self.focus_handle.contains_focused(cx) { - h_flex() - .gap_2() - .child(h_flex().gap_1().children(self.render_editor_tools(cx))) - .child( - ui::Divider::vertical() - .inset() - .color(ui::DividerColor::Border), - ) - .child( - h_flex() - .gap_1() - .child(Self::render_plus_button(cx)) - .child(self.render_zoom_button(cx)), - ) - } else { - div() + .when(self.focus_handle.contains_focused(cx), |this| { + this.end_child( + h_flex() + .gap_2() + .when(self.active_editor().is_some(), |this| { + this.child(h_flex().gap_1().children(self.render_editor_tools(cx))) + .child( + ui::Divider::vertical() + .inset() + .color(ui::DividerColor::Border), + ) + }) + .child( + h_flex() + .gap_1() + .child(Self::render_plus_button(cx)) + .child(self.render_zoom_button(cx)), + ), + ) }); let contents = if self.active_editor().is_some() {