diff --git a/crates/ui/src/components/label/spinner_label.rs b/crates/ui/src/components/label/spinner_label.rs index de88e9bb7ab04a3d595183513c2b00da70e172aa..33eeeae125106cd8c8d2db64605b7017121c0394 100644 --- a/crates/ui/src/components/label/spinner_label.rs +++ b/crates/ui/src/components/label/spinner_label.rs @@ -77,7 +77,7 @@ impl SpinnerLabel { let duration = variant.duration(); SpinnerLabel { - base: Label::new(frames[0]), + base: Label::new(frames[0]).color(Color::Muted), variant, frames, duration, @@ -164,7 +164,7 @@ impl RenderOnce for SpinnerLabel { let frames = self.frames.clone(); let duration = self.duration; - self.base.color(Color::Muted).with_animation( + self.base.with_animation( self.variant.animation_id(), Animation::new(duration).repeat(), move |mut label, delta| { diff --git a/crates/ui/src/components/thread_item.rs b/crates/ui/src/components/thread_item.rs index dcf159f502e2d3c67576f9c6eefaff10585992eb..a4f6a8a53348d78563900c2a53b30e95588c2aac 100644 --- a/crates/ui/src/components/thread_item.rs +++ b/crates/ui/src/components/thread_item.rs @@ -1,4 +1,6 @@ -use crate::{Chip, DiffStat, Indicator, SpinnerLabel, prelude::*}; +use crate::{ + Chip, DecoratedIcon, DiffStat, IconDecoration, IconDecorationKind, SpinnerLabel, prelude::*, +}; use gpui::{ClickEvent, SharedString}; #[derive(IntoElement, RegisterComponent)] @@ -85,16 +87,29 @@ impl ThreadItem { impl RenderOnce for ThreadItem { fn render(self, _: &mut Window, cx: &mut App) -> impl IntoElement { let icon_container = || h_flex().size_4().justify_center(); + let agent_icon = Icon::new(self.icon) + .color(Color::Muted) + .size(IconSize::Small); + let icon = if self.generation_done { - icon_container().child(Indicator::dot().color(Color::Accent)) - } else if self.running { - icon_container().child(SpinnerLabel::new().color(Color::Accent)) - } else { - icon_container().child( - Icon::new(self.icon) - .color(Color::Muted) - .size(IconSize::Small), + DecoratedIcon::new( + agent_icon, + Some( + IconDecoration::new( + IconDecorationKind::Dot, + cx.theme().colors().surface_background, + cx, + ) + .color(cx.theme().colors().text_accent) + .position(gpui::Point { + x: px(-2.), + y: px(-2.), + }), + ), ) + .into_any_element() + } else { + agent_icon.into_any_element() }; let has_no_changes = self.added.is_none() && self.removed.is_none(); @@ -112,7 +127,10 @@ impl RenderOnce for ThreadItem { .w_full() .gap_1p5() .child(icon) - .child(Label::new(self.title).truncate()), + .child(Label::new(self.title).truncate()) + .when(self.running, |this| { + this.child(icon_container().child(SpinnerLabel::new().color(Color::Accent))) + }), ) .child( h_flex()