Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions app/src/ui_components/icon_with_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ pub(crate) enum IconWithStatusVariant {
/// BR (more overhang) and negative values pull it inward toward the circle's center.
///
/// When `is_ambient` is set on an agent variant, the status badge is replaced by a
/// white cloud containing the status icon.
/// cloud (filled with `status_container_background`) containing the status icon.
pub(crate) fn render_icon_with_status(
variant: IconWithStatusVariant,
total_size: f32,
overlay_extra_overhang_ratio: f32,
theme: &WarpTheme,
badge_ring_background: WarpThemeFill,
status_container_background: WarpThemeFill,
) -> Box<dyn Element> {
let sub_text = theme.sub_text_color(theme.background());

Expand Down Expand Up @@ -174,7 +174,7 @@ pub(crate) fn render_icon_with_status(
total_size,
overlay_extra_overhang_ratio,
theme,
badge_ring_background,
status_container_background,
)
}
IconWithStatusVariant::CLIAgent {
Expand All @@ -201,7 +201,7 @@ pub(crate) fn render_icon_with_status(
total_size,
overlay_extra_overhang_ratio,
theme,
badge_ring_background,
status_container_background,
)
}
}
Expand Down Expand Up @@ -263,7 +263,7 @@ fn attach_status_overlay(
total_size: f32,
overlay_extra_overhang_ratio: f32,
theme: &WarpTheme,
badge_ring_background: WarpThemeFill,
status_container_background: WarpThemeFill,
) -> Box<dyn Element> {
if is_ambient {
render_with_cloud_status_badge(
Expand All @@ -272,6 +272,7 @@ fn attach_status_overlay(
total_size,
overlay_extra_overhang_ratio,
theme,
status_container_background,
)
} else {
render_with_optional_status_badge(
Expand All @@ -280,24 +281,25 @@ fn attach_status_overlay(
total_size,
overlay_extra_overhang_ratio,
theme,
badge_ring_background,
status_container_background,
)
}
}

/// Overlays a white cloud (with the conversation status icon centered inside, if any) at
/// Overlays a cloud (with the conversation status icon centered inside, if any) at
/// the bottom-right of the base circle. Used for agents running in ambient/cloud mode.
fn render_with_cloud_status_badge(
circle: Box<dyn Element>,
status: Option<&ConversationStatus>,
total_size: f32,
overlay_extra_overhang_ratio: f32,
theme: &WarpTheme,
status_container_background: WarpThemeFill,
) -> Box<dyn Element> {
let cloud_diameter = cloud_icon_size(total_size);
let cloud = ConstrainedBox::new(
WarpIcon::CloudFilled
.to_warpui_icon(WarpThemeFill::Solid(ColorU::white()))
.to_warpui_icon(status_container_background)
.finish(),
)
.with_width(cloud_diameter)
Expand Down Expand Up @@ -361,7 +363,7 @@ fn render_with_optional_status_badge(
total_size: f32,
overlay_extra_overhang_ratio: f32,
theme: &WarpTheme,
badge_ring_background: WarpThemeFill,
status_container_background: WarpThemeFill,
) -> Box<dyn Element> {
let Some(status) = status else {
// No status badge: still occupy the full `total_size` footprint so the agent
Expand All @@ -386,7 +388,7 @@ fn render_with_optional_status_badge(
// Cutout ring that visually separates the badge from the circle.
let badge_with_ring = Container::new(badge)
.with_uniform_padding(pad)
.with_background(badge_ring_background)
.with_background(status_container_background)
.with_corner_radius(CornerRadius::with_all(Radius::Percentage(50.)))
.finish();

Expand Down
Loading