diff --git a/crates/assistant2/src/active_thread.rs b/crates/assistant2/src/active_thread.rs index 27c29e3fa8..8e66ea4046 100644 --- a/crates/assistant2/src/active_thread.rs +++ b/crates/assistant2/src/active_thread.rs @@ -376,11 +376,23 @@ impl ActiveThread { } ThreadEvent::DoneStreaming => { if !self.thread().read(cx).is_generating() { - self.show_notification("Your changes have been applied.", window, cx); + self.show_notification( + "Your changes have been applied.", + IconName::Check, + Color::Success, + window, + cx, + ); } } ThreadEvent::ToolConfirmationNeeded => { - self.show_notification("There's a tool confirmation needed.", window, cx); + self.show_notification( + "There's a tool confirmation needed.", + IconName::Info, + Color::Muted, + window, + cx, + ); } ThreadEvent::StreamedAssistantText(message_id, text) => { if let Some(rendered_message) = self.rendered_messages_by_id.get_mut(&message_id) { @@ -511,6 +523,8 @@ impl ActiveThread { fn show_notification( &mut self, caption: impl Into, + icon: IconName, + icon_color: Color, window: &mut Window, cx: &mut Context<'_, ActiveThread>, ) { @@ -525,7 +539,7 @@ impl ActiveThread { if let Some(screen_window) = cx .open_window(options, |_, cx| { - cx.new(|_| ToolReadyPopUp::new(caption.clone())) + cx.new(|_| ToolReadyPopUp::new(caption.clone(), icon, icon_color)) }) .log_err() { diff --git a/crates/assistant2/src/ui/tool_ready_pop_up.rs b/crates/assistant2/src/ui/tool_ready_pop_up.rs index 4a43e29113..4fc0b3b2c1 100644 --- a/crates/assistant2/src/ui/tool_ready_pop_up.rs +++ b/crates/assistant2/src/ui/tool_ready_pop_up.rs @@ -9,12 +9,16 @@ use ui::{prelude::*, Render}; pub struct ToolReadyPopUp { caption: SharedString, + icon: IconName, + icon_color: Color, } impl ToolReadyPopUp { - pub fn new(caption: impl Into) -> Self { + pub fn new(caption: impl Into, icon: IconName, icon_color: Color) -> Self { Self { caption: caption.into(), + icon, + icon_color, } } @@ -82,9 +86,9 @@ impl Render for ToolReadyPopUp { .gap_2() .child( h_flex().h(line_height).justify_center().child( - Icon::new(IconName::Info) - .size(IconSize::Small) - .color(Color::Muted), + Icon::new(self.icon) + .color(self.icon_color) + .size(IconSize::Small), ), ) .child(