diff --git a/assets/icons/maximize.svg b/assets/icons/maximize.svg
index f37f6a2087..b3504b5701 100644
--- a/assets/icons/maximize.svg
+++ b/assets/icons/maximize.svg
@@ -1,4 +1 @@
-
+
diff --git a/assets/icons/menu.svg b/assets/icons/menu.svg
index 060caeecbf..6598697ff8 100644
--- a/assets/icons/menu.svg
+++ b/assets/icons/menu.svg
@@ -1,3 +1 @@
-
+
diff --git a/assets/icons/minimize.svg b/assets/icons/minimize.svg
index ec78f152e1..0451233cc9 100644
--- a/assets/icons/minimize.svg
+++ b/assets/icons/minimize.svg
@@ -1,4 +1 @@
-
+
diff --git a/assets/icons/quote.svg b/assets/icons/quote.svg
index 50205479c3..b970db1430 100644
--- a/assets/icons/quote.svg
+++ b/assets/icons/quote.svg
@@ -1,8 +1 @@
-
+
diff --git a/assets/icons/snip.svg b/assets/icons/snip.svg
new file mode 100644
index 0000000000..03ae4ce039
--- /dev/null
+++ b/assets/icons/snip.svg
@@ -0,0 +1 @@
+
diff --git a/assets/icons/split_message.svg b/assets/icons/split_message.svg
deleted file mode 100644
index 54d9e81224..0000000000
--- a/assets/icons/split_message.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/crates/assistant2/src/assistant_panel.rs b/crates/assistant2/src/assistant_panel.rs
index 0cac69661a..17a020fb9c 100644
--- a/crates/assistant2/src/assistant_panel.rs
+++ b/crates/assistant2/src/assistant_panel.rs
@@ -54,7 +54,8 @@ use std::{
};
use theme::ThemeSettings;
use ui::{
- h_stack, prelude::*, v_stack, Button, ButtonLike, Icon, IconButton, IconElement, Label, Tooltip,
+ h_stack, prelude::*, v_stack, Button, ButtonLike, Icon, IconButton, IconElement, Label, TabBar,
+ Tooltip,
};
use util::{paths::CONVERSATIONS_DIR, post_inc, ResultExt, TryFutureExt};
use uuid::Uuid;
@@ -939,7 +940,7 @@ impl AssistantPanel {
this.set_active_editor_index(this.prev_active_editor_index, cx);
}
}))
- .tooltip(|cx| Tooltip::text("History", cx))
+ .tooltip(|cx| Tooltip::text("Conversation History", cx))
}
fn render_editor_tools(&self, cx: &mut ViewContext) -> Vec {
@@ -955,12 +956,13 @@ impl AssistantPanel {
}
fn render_split_button(cx: &mut ViewContext) -> impl IntoElement {
- IconButton::new("split_button", Icon::SplitMessage)
+ IconButton::new("split_button", Icon::Snip)
.on_click(cx.listener(|this, _event, cx| {
if let Some(active_editor) = this.active_editor() {
active_editor.update(cx, |editor, cx| editor.split(&Default::default(), cx));
}
}))
+ .icon_size(IconSize::Small)
.tooltip(|cx| Tooltip::for_action("Split Message", &Split, cx))
}
@@ -971,6 +973,7 @@ impl AssistantPanel {
active_editor.update(cx, |editor, cx| editor.assist(&Default::default(), cx));
}
}))
+ .icon_size(IconSize::Small)
.tooltip(|cx| Tooltip::for_action("Assist", &Assist, cx))
}
@@ -985,6 +988,7 @@ impl AssistantPanel {
});
}
}))
+ .icon_size(IconSize::Small)
.tooltip(|cx| Tooltip::for_action("Quote Seleciton", &QuoteSelection, cx))
}
@@ -993,15 +997,19 @@ impl AssistantPanel {
.on_click(cx.listener(|this, _event, cx| {
this.new_conversation(cx);
}))
+ .icon_size(IconSize::Small)
.tooltip(|cx| Tooltip::for_action("New Conversation", &NewConversation, cx))
}
fn render_zoom_button(&self, cx: &mut ViewContext) -> impl IntoElement {
let zoomed = self.zoomed;
- IconButton::new("zoom_button", Icon::MagnifyingGlass)
+ IconButton::new("zoom_button", Icon::Maximize)
.on_click(cx.listener(|this, _event, cx| {
this.toggle_zoom(&ToggleZoom, cx);
}))
+ .selected(zoomed)
+ .selected_icon(Icon::Minimize)
+ .icon_size(IconSize::Small)
.tooltip(move |cx| {
Tooltip::for_action(if zoomed { "Zoom Out" } else { "Zoom In" }, &ToggleZoom, cx)
})
@@ -1125,16 +1133,40 @@ impl Render for AssistantPanel {
.active_editor()
.map(|editor| Label::new(editor.read(cx).title(cx)));
- let mut header = h_stack()
- .child(Self::render_hamburger_button(cx))
- .children(title);
+ // let mut header = h_stack()
+ // .p_1()
+ // .border_b()
+ // .border_color(cx.theme().colors().border_variant)
+ // .bg(cx.theme().colors().toolbar_background)
+ // .child(div().flex_1());
- if self.focus_handle.contains_focused(cx) {
- header = header
- .children(self.render_editor_tools(cx))
- .child(Self::render_plus_button(cx))
- .child(self.render_zoom_button(cx));
- }
+ let header = TabBar::new("assistant_header")
+ .start_child(
+ h_stack()
+ .gap_1()
+ .child(Self::render_hamburger_button(cx))
+ .children(title),
+ )
+ .end_child(if self.focus_handle.contains_focused(cx) {
+ h_stack()
+ .gap_1()
+ .children(self.render_editor_tools(cx))
+ .child(Self::render_plus_button(cx))
+ .child(self.render_zoom_button(cx))
+ } else {
+ div()
+ });
+
+ // if self.focus_handle.contains_focused(cx) {
+ // header = header.child(
+ // div()
+ // .flex()
+ // .gap_1()
+ // .children(self.render_editor_tools(cx))
+ // .child(Self::render_plus_button(cx))
+ // .child(self.render_zoom_button(cx)),
+ // );
+ // }
v_stack()
.size_full()
diff --git a/crates/ui2/src/components/icon.rs b/crates/ui2/src/components/icon.rs
index 6216acac48..ca50cae7f8 100644
--- a/crates/ui2/src/components/icon.rs
+++ b/crates/ui2/src/components/icon.rs
@@ -75,6 +75,7 @@ pub enum Icon {
MagnifyingGlass,
MailOpen,
Maximize,
+ Minimize,
Menu,
MessageBubbles,
Mic,
@@ -88,7 +89,7 @@ pub enum Icon {
Screen,
SelectAll,
Split,
- SplitMessage,
+ Snip,
Terminal,
WholeWord,
XCircle,
@@ -156,6 +157,7 @@ impl Icon {
Icon::MagnifyingGlass => "icons/magnifying_glass.svg",
Icon::MailOpen => "icons/mail-open.svg",
Icon::Maximize => "icons/maximize.svg",
+ Icon::Minimize => "icons/minimize.svg",
Icon::Menu => "icons/menu.svg",
Icon::MessageBubbles => "icons/conversations.svg",
Icon::Mic => "icons/mic.svg",
@@ -169,7 +171,7 @@ impl Icon {
Icon::Screen => "icons/desktop.svg",
Icon::SelectAll => "icons/select-all.svg",
Icon::Split => "icons/split.svg",
- Icon::SplitMessage => "icons/split_message.svg",
+ Icon::Snip => "icons/snip.svg",
Icon::Terminal => "icons/terminal.svg",
Icon::WholeWord => "icons/word_search.svg",
Icon::XCircle => "icons/error.svg",