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.
This commit is contained in:
Marshall Bowers 2024-01-19 11:00:22 -05:00 committed by GitHub
parent e55e895e19
commit 14863e9a28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1172,23 +1172,25 @@ impl Render for AssistantPanel {
.px_2() .px_2()
.child(Label::new(editor.read(cx).title(cx)).into_element()) .child(Label::new(editor.read(cx).title(cx)).into_element())
})) }))
.end_child(if self.focus_handle.contains_focused(cx) { .when(self.focus_handle.contains_focused(cx), |this| {
h_flex() this.end_child(
.gap_2() h_flex()
.child(h_flex().gap_1().children(self.render_editor_tools(cx))) .gap_2()
.child( .when(self.active_editor().is_some(), |this| {
ui::Divider::vertical() this.child(h_flex().gap_1().children(self.render_editor_tools(cx)))
.inset() .child(
.color(ui::DividerColor::Border), ui::Divider::vertical()
) .inset()
.child( .color(ui::DividerColor::Border),
h_flex() )
.gap_1() })
.child(Self::render_plus_button(cx)) .child(
.child(self.render_zoom_button(cx)), h_flex()
) .gap_1()
} else { .child(Self::render_plus_button(cx))
div() .child(self.render_zoom_button(cx)),
),
)
}); });
let contents = if self.active_editor().is_some() { let contents = if self.active_editor().is_some() {