Add title to assistant panel and move + to right

This commit is contained in:
Nathan Sobo 2023-06-21 09:54:49 -06:00
parent a011ced698
commit d78fbbc63e
3 changed files with 19 additions and 2 deletions

View file

@ -418,13 +418,25 @@ impl View for AssistantPanel {
.aligned()
.into_any()
} else {
let title = self.active_conversation_editor().map(|editor| {
Label::new(editor.read(cx).title(cx), style.title.text.clone())
.contained()
.with_style(style.title.container)
.aligned()
});
Flex::column()
.with_child(
Flex::row()
.with_child(
Self::render_hamburger_button(&style.hamburger_button).aligned(),
)
.with_child(Self::render_plus_button(&style.plus_button).aligned())
.with_children(title)
.with_child(
Self::render_plus_button(&style.plus_button)
.aligned()
.flex_float(),
)
.contained()
.with_style(theme.workspace.tab_bar.container)
.expanded()

View file

@ -996,6 +996,7 @@ pub struct AssistantStyle {
pub container: ContainerStyle,
pub hamburger_button: IconStyle,
pub plus_button: IconStyle,
pub title: ContainedText,
pub message_header: ContainerStyle,
pub sent_at: ContainedText,
pub user_sender: Interactive<ContainedText>,

View file

@ -37,9 +37,13 @@ export default function assistant(colorScheme: ColorScheme) {
},
},
container: {
margin: { left: 8 },
margin: { right: 8 },
}
},
title: {
margin: { left: 8 },
...text(layer, "sans", "default", { size: "sm" })
},
savedConversation: {
background: background(layer, "on"),
hover: {