From a827fd21e84adff9fff3a11e0d3b4213f5c23d23 Mon Sep 17 00:00:00 2001 From: Matthew Ball <13823657+matthewrball@users.noreply.github.com> Date: Tue, 17 Nov 2026 04:50:52 -0800 Subject: [PATCH 1/5] Agent: a running task's title shimmers instead of showing a coral ring A running task showed a coral ring with a breathing dot beside its title, and a task waiting on a question showed a coral dot. The two differed only by shape, and the ring read as a radio button. A running task now shows what the transcript shows while Maple thinks: a brighter band sweeps across its title, and the words rest a step dimmer under it, in the row's secondary ink when selected and muted ink otherwise. Coral is left to the task that needs you. The indicator box stays, empty, on a running row, so the title's width holds as the task moves on to its next state. The band is morph_text's shine, carried here as the "Maple is thinking" line's change adds it (#1587), so the two merge cleanly in either order. It runs on the shared loop clock like the ring did, and holds still under reduced motion and in a background window. --- apps/maple-agent/app/src/ui/chat/sidebar.rs | 125 +++++++++--------- .../app/src/ui/chat/sidebar_computers.rs | 6 +- apps/maple-agent/app/src/ui/morph_text.rs | 87 +++++++++--- 3 files changed, 138 insertions(+), 80 deletions(-) diff --git a/apps/maple-agent/app/src/ui/chat/sidebar.rs b/apps/maple-agent/app/src/ui/chat/sidebar.rs index 1a2919305..5ec75903d 100644 --- a/apps/maple-agent/app/src/ui/chat/sidebar.rs +++ b/apps/maple-agent/app/src/ui/chat/sidebar.rs @@ -95,6 +95,7 @@ use crate::backend::AgentBackend; use crate::settings::{SidebarGroup, SidebarItemKey, SidebarOrder, SidebarSort, SidebarView}; use crate::ui::i18n::{MessageCache, UiText, tr, tr_args}; use crate::ui::icons::{icon, wordmark}; +use crate::ui::morph_text::morph_text; use crate::ui::motion; use crate::ui::popup::{Menu, MenuItem, Placement, Popup}; use crate::ui::text_input::TextInput; @@ -4312,9 +4313,16 @@ impl Sidebar { .flex_col() .map(|column| match rename_field { Some(field) => column.child(field), - None => { - column.child(row_line(row.title.clone(), hover_group, row_bg, hover_bg)) - } + None => column.child(row_line( + task_title( + &row.title, + activity == Some(SessionActivity::Running), + is_selected, + ), + hover_group, + row_bg, + hover_bg, + )), }) .when(self.show_task_metadata(is_pinned, archived), |column| { column.child( @@ -4493,7 +4501,7 @@ fn one_line(text: &str) -> SharedString { /// Fade a line into its row background; renames and drags omit the hover group. fn row_line( - text: SharedString, + text: impl IntoElement, hover_group: Option<&SharedString>, row_bg: u32, hover_bg: u32, @@ -4529,23 +4537,39 @@ fn row_fade_background(color: u32) -> gpui::Background { ) } -/// One breath of the running ring's dot. -const RUNNING_BREATH: Duration = Duration::from_millis(1600); - -/// A coral dot while a question waits, a ring with a breathing dot while -/// the task runs, an alert once a run failed unseen, and a green dot once -/// one completed unseen. The two dots differ by color; the ring and the -/// alert differ by shape. The ring runs on the shared low-rate clock, so -/// any number of running rows cost one repaint per interval; `spinner_id` -/// is prebuilt so render allocates nothing. Every state sits centered in -/// one box the size of the largest, so the center stays put as states -/// change, and one state cross-fades into the next over -/// [`motion::TOGGLE`]. The box is keyed by `spinner_id`, which names the -/// task, so an indicator that first appears (a list that loads, a row that -/// scrolls in) shows its state at once. +/// One pass of a running task's shine across its title: the pace of the +/// transcript's "Maple is thinking" line, so the two read as one signal. +const TITLE_SHINE: Duration = Duration::from_millis(1900); + +/// A task's title. While the task runs, a brighter band sweeps across the +/// words, the transcript's thinking shine, and the words rest a step +/// dimmer under it as the thinking line's do: secondary ink on a selected +/// row, muted otherwise, as the row's metadata. The band holds still when +/// loops do, under reduced motion and in a background window. +fn task_title(title: &SharedString, running: bool, selected: bool) -> AnyElement { + if !running { + return title.clone().into_any_element(); + } + morph_text("task-title", title.clone()) + .color(gpui::rgb(if selected { + theme::text_secondary() + } else { + theme::text_muted() + })) + .shine(TITLE_SHINE, gpui::rgb(theme::text_heading())) + .into_any_element() +} + +/// A coral dot while a question waits, an alert once a run failed unseen, +/// and a green dot once one completed unseen. A running task shows nothing +/// here: its title shines instead (see [`task_title`]). Every state sits +/// centered in one box the size of the largest, which a running row keeps +/// empty, so the title's width stays put as states change, and one state +/// cross-fades into the next over [`motion::TOGGLE`]. The box is keyed by +/// `spinner_id`, which names the task, so an indicator that first appears +/// (a list that loads, a row that scrolls in) shows its state at once. fn activity_indicator(spinner_id: &SharedString, activity: SessionActivity) -> AnyElement { - let layer = |name: &'static str, state: SessionActivity| { - let spinner_id = spinner_id.clone(); + let layer = |name: &'static str, state: SessionActivity, glyph: fn() -> AnyElement| { motion::animated( name, if activity == state { 1. } else { 0. }, @@ -4554,13 +4578,6 @@ fn activity_indicator(spinner_id: &SharedString, activity: SessionActivity) -> A if shown <= 0. { return div().into_any_element(); } - let dot = |color: u32| { - div() - .size(px(8.)) - .rounded_full() - .bg(gpui::rgb(color)) - .into_any_element() - }; div() .absolute() .inset_0() @@ -4568,55 +4585,35 @@ fn activity_indicator(spinner_id: &SharedString, activity: SessionActivity) -> A .items_center() .justify_center() .opacity(shown) - .child(match state { - SessionActivity::NeedsYou => dot(theme::accent()), - SessionActivity::Running => running_ring(spinner_id.clone()), - SessionActivity::Failed => { - icon("circle-alert", px(13.), theme::status_error()).into_any_element() - } - SessionActivity::CompletedUnread => dot(theme::status_success()), - }) + .child(glyph()) .into_any_element() }, ) }; + fn dot(color: u32) -> AnyElement { + div() + .size(px(8.)) + .rounded_full() + .bg(gpui::rgb(color)) + .into_any_element() + } div() .id(spinner_id.clone()) .relative() .size(px(13.)) .flex_none() - .child(layer("needs-you", SessionActivity::NeedsYou)) - .child(layer("running", SessionActivity::Running)) - .child(layer("failed", SessionActivity::Failed)) - .child(layer("completed", SessionActivity::CompletedUnread)) + .child(layer("needs-you", SessionActivity::NeedsYou, || { + dot(theme::accent()) + })) + .child(layer("failed", SessionActivity::Failed, || { + icon("circle-alert", px(13.), theme::status_error()).into_any_element() + })) + .child(layer("completed", SessionActivity::CompletedUnread, || { + dot(theme::status_success()) + })) .into_any_element() } -/// The running state: a coral ring whose center dot fades in and out. A -/// fade reads as smooth at the shared clock's low frame rate, where a -/// turning arc steps visibly. -fn running_ring(id: SharedString) -> AnyElement { - motion::ticker(id, RUNNING_BREATH, |phase| { - div() - .size(px(12.)) - .flex() - .items_center() - .justify_center() - .rounded_full() - .border_1() - .border_color(gpui::rgb(theme::accent())) - .child( - div() - .size(px(6.)) - .rounded_full() - .bg(gpui::rgb(theme::accent())) - .opacity(motion::pulse(phase, 0., 0.3, 1.)), - ) - .into_any_element() - }) - .into_any_element() -} - /// The strip over a row's end that holds its hover buttons, with the /// row's hover color behind them so they cover the title. fn hover_actions(group: &SharedString, hover_bg: u32) -> Div { diff --git a/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs b/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs index 16d31669d..aa4df2fa6 100644 --- a/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs +++ b/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs @@ -2492,7 +2492,11 @@ impl Sidebar { .map(|column| match rename_field { Some(field) => column.child(field), None => column.child(row_line( - task.title.clone(), + task_title( + &task.title, + task.activity == Some(SessionActivity::Running), + selected, + ), hover_group, row_bg, hover_bg, diff --git a/apps/maple-agent/app/src/ui/morph_text.rs b/apps/maple-agent/app/src/ui/morph_text.rs index dc7b43ff5..bbbf65377 100644 --- a/apps/maple-agent/app/src/ui/morph_text.rs +++ b/apps/maple-agent/app/src/ui/morph_text.rs @@ -7,6 +7,9 @@ //! One shaping per change and one tiny shaped run per letter per frame, //! only while a morph runs; at rest it paints a single line and asks for no //! frames. Reduced motion swaps the text at once. +//! +//! Text that reports work in progress can also carry a shine: a band of a +//! second colour that crosses the words on the shared loop clock. use std::time::{Duration, Instant}; @@ -25,6 +28,7 @@ pub struct MorphText { text: SharedString, color: Option, instant: bool, + shine: Option<(Duration, Hsla)>, } /// Morphing text in the surrounding text style; `id` keeps its state @@ -35,6 +39,7 @@ pub fn morph_text(id: impl Into, text: impl Into) -> Mo text: text.into(), color: None, instant: false, + shine: None, } } @@ -53,6 +58,23 @@ impl MorphText { self.instant = instant; self } + + /// Sweep a band of `color` across the words once every `cycle`. It + /// holds still when loops do: under reduced motion, and in a window + /// that is not active. + pub fn shine(mut self, cycle: Duration, color: impl Into) -> Self { + self.shine = Some((cycle, color.into())); + self + } +} + +/// How much of the shine a letter `at` of the way along the line takes +/// when the band is `phase` of the way through its pass. +fn shine_level(at: f32, phase: f32) -> f32 { + // The band enters and leaves past the ends of the line. + const REACH: f32 = 0.3; + let head = -REACH + phase * (1. + 2. * REACH); + crate::ui::motion::smoothstep((1. - (at - head).abs() / REACH).max(0.)) } /// One letter and where it sits from the line's start. @@ -295,32 +317,50 @@ impl Element for MorphText { let font_size = style.font_size.to_pixels(rem); let line_height = style.line_height_in_pixels(rem); let fallback = style.color; + // Where the band is this frame, while loops run. + let shine = self + .shine + .filter(|_| !crate::ui::motion::loops_paused(window, cx)) + .map(|(cycle, color)| (crate::ui::motion::phase(cycle), color)); let animating = window.with_element_state::(id, |state, window| { let state = state.unwrap_or_default(); let progress = state.progress(Instant::now()); let eased = progress.map(ease); let color = state.visual_color(eased, fallback); + // A letter `x` along the line takes the shine where the band is. + let tint = |x: Pixels| match shine { + Some((phase, shine)) if state.width > px(0.) => { + mix(color, shine, shine_level(x / state.width, phase)) + } + _ => color, + }; + let draw = |window: &mut Window, + cx: &mut App, + text: &SharedString, + runs: &[gpui::TextRun], + x, + y| { + window + .text_system() + .shape_line(text.clone(), font_size, runs, None) + .paint( + point(bounds.left() + x, bounds.top() + y), + line_height, + TextAlign::Left, + None, + window, + cx, + ) + .ok(); + }; let paint = |window: &mut Window, cx: &mut App, text: &SharedString, x, y, alpha: f32| { if alpha <= 0. { return; } let mut run = style.to_run(text.len()); - run.color = color.opacity(alpha); - let shaped = - window - .text_system() - .shape_line(text.clone(), font_size, &[run], None); - shaped - .paint( - point(bounds.left() + x, bounds.top() + y), - line_height, - TextAlign::Left, - None, - window, - cx, - ) - .ok(); + run.color = tint(x).opacity(alpha); + draw(window, cx, text, &[run], x, y); }; match (progress, &state.morph) { (Some(t), Some(morph)) if t < 1. => { @@ -349,6 +389,21 @@ impl Element for MorphText { } (true, state) } + _ if shine.is_some() => { + // One line with a run per letter, so the shine does + // not disturb the spacing of the words. + let runs: Vec<_> = state + .letters + .iter() + .map(|letter| { + let mut run = style.to_run(letter.text.len()); + run.color = tint(letter.x); + run + }) + .collect(); + draw(window, cx, &state.text, &runs, px(0.), px(0.)); + (false, state) + } _ => { paint(window, cx, &state.text, px(0.), px(0.), 1.); (false, state) @@ -357,6 +412,8 @@ impl Element for MorphText { }); if animating { window.request_animation_frame(); + } else if shine.is_some() { + crate::ui::motion::schedule_loop_frame(window, cx); } } } From 44084ca1feeb4419ed771dbc889d4914a4ba6634 Mon Sep 17 00:00:00 2001 From: Matthew Ball <13823657+matthewrball@users.noreply.github.com> Date: Tue, 17 Nov 2026 04:51:52 -0800 Subject: [PATCH 2/5] Agent: the sidebar's task rows read cleanly in light mode A row's buttons eased to the selected-row colour on hover and pressed to the hairline colour. On a selected row under the pointer the hover chip came out lighter than the row, a press flashed near white, and on a hovered row a press matched the row and showed nothing. Hover and press now ease to the shared hover overlay and a new, stronger overlay_press over whatever the row is, so they read one and two steps past it in either theme. The pin and overflow buttons use the same pair, and an open overflow button holds its press fill under the pointer. With a task's menu open, the pointer leaves the row for the menu, so the row eased back to rest while the action strip kept its fill. The row now holds its hover fill while its menu is open, as a project header does, and the strip keeps covering the title behind the open button. --- apps/maple-agent/app/src/ui/chat/sidebar.rs | 40 ++++++++++++++----- .../app/src/ui/chat/sidebar_computers.rs | 10 ++++- apps/maple-agent/app/src/ui/theme.rs | 11 +++++ 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/apps/maple-agent/app/src/ui/chat/sidebar.rs b/apps/maple-agent/app/src/ui/chat/sidebar.rs index 5ec75903d..24c8d79fc 100644 --- a/apps/maple-agent/app/src/ui/chat/sidebar.rs +++ b/apps/maple-agent/app/src/ui/chat/sidebar.rs @@ -4001,6 +4001,7 @@ impl Sidebar { &root.row_group, "square-pen", tr("chat-new-task"), + false, ) .aria_label(root.new_task_label.clone()) .tooltip(widgets::tooltip(root.new_task_label.clone(), None)) @@ -4165,10 +4166,15 @@ impl Sidebar { cx: &mut Context, ) -> Div { let (pinned, rung) = state; + // The menu opens below the row and takes the pointer's hover with + // it; the strip keeps its fill so the open button still covers the + // title, as a project header's does. + let open = self.popup.is_open(&target.popup_key()); let rename = target.clone(); let advance = target.clone(); let step = rung.step(); hover_actions(&row.group, hover_bg) + .when(open, |strip| strip.bg(gpui::rgb(hover_bg))) .pl_0() .when(pinned, |overlay| overlay.right(px(26.))) .when(!pinned, |overlay| overlay.right_0().rounded_r(ROW_RADIUS)) @@ -4180,6 +4186,7 @@ impl Sidebar { .bottom_0() .right_full() .w(ROW_FADE) + .when(open, |fade| fade.bg(row_fade_background(hover_bg))) .group_hover(row.group.clone(), |style| { style.bg(row_fade_background(hover_bg)) }), @@ -4262,7 +4269,12 @@ impl Sidebar { } else { theme::bg_sidebar_row_hover() }; - let row_bg = if is_selected { + // An open menu holds the row in its hover fill, as a project + // header's does, so the action strip over it never shows as a patch. + let menu_open = self.popup.is_open(&SidebarPopup::Task(row.id.clone())); + let row_bg = if menu_open { + hover_bg + } else if is_selected { theme::bg_sidebar_row_selected() } else { theme::bg_sidebar() @@ -4298,6 +4310,7 @@ impl Sidebar { // no hover actions over it, so the edit is plain to see. .hover_bg(gpui::rgb(hover_bg)) .when(renaming || self.dragging, |row| row.highlighted(false)) + .when(menu_open, |row| row.highlighted(true)) .when(!renaming && !self.dragging, |row| { row.hover(|style| style.cursor_pointer()) }) @@ -4350,8 +4363,9 @@ impl Sidebar { .items_center() .justify_center() .rounded(theme::RADIUS_SM) - .hover_bg(gpui::rgb(theme::bg_sidebar_row_selected())) + .hover_bg(theme::overlay_hover()) .hover(|style| style.cursor_pointer()) + .active(|style| style.bg(theme::overlay_press())) .tooltip(widgets::tooltip(tr("chat-unpin"), None)) .on_click(cx.listener(move |this, _event, _window, cx| { cx.stop_propagation(); @@ -4637,7 +4651,7 @@ pub(super) fn row_action( on_click: impl Fn(&gpui::ClickEvent, &mut Window, &mut gpui::App) + 'static, ) -> crate::ui::motion::HoverBackground { let label = label.into(); - row_button(id, group, icon_name, label.clone()) + row_button(id, group, icon_name, label.clone(), false) .tooltip(widgets::tooltip(label, None)) .on_click(on_click) } @@ -4651,11 +4665,7 @@ fn row_menu_button( open: bool, ) -> crate::ui::motion::HoverBackground { let label = label.into(); - row_button(id, group, "ellipsis", label).when(open, |button| { - button - .opacity(1.) - .bg(gpui::rgb(theme::bg_sidebar_row_selected())) - }) + row_button(id, group, "ellipsis", label, open).when(open, |button| button.opacity(1.)) } /// An icon button of the Projects header. It stays pressed, without its @@ -4689,11 +4699,16 @@ fn header_button( } /// The small icon button a sidebar row shows while it is hovered. +/// `pressed` holds it in its press fill, under the pointer too, while its +/// menu is open. Its fills are overlays, not solid colours: the row +/// beneath may be resting, hovered, selected or both, and a hover and a +/// press must read past each of them. fn row_button( id: SharedString, group: &SharedString, icon_name: &'static str, label: impl Into, + pressed: bool, ) -> crate::ui::motion::HoverBackground { let label = label.into(); div() @@ -4709,9 +4724,14 @@ fn row_button( .rounded(theme::RADIUS_SM) .opacity(0.) .group_hover(group.clone(), |style| style.opacity(1.)) - .hover_bg(gpui::rgb(theme::bg_sidebar_row_selected())) + .when(pressed, |button| button.bg(theme::overlay_press())) + .hover_bg(if pressed { + theme::overlay_press() + } else { + theme::overlay_hover() + }) .hover(|style| style.cursor_pointer()) - .active(|style| style.bg(gpui::rgb(theme::border()))) + .active(|style| style.bg(theme::overlay_press())) .child(icon(icon_name, px(14.), theme::text_secondary())) } diff --git a/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs b/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs index aa4df2fa6..1e829b18e 100644 --- a/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs +++ b/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs @@ -2446,7 +2446,13 @@ impl Sidebar { let rename_field = self.other_task_rename_field(&task.target, cx); let renaming = rename_field.is_some(); let pin_target = TaskTarget::Other(task.target.clone()); - let row_bg = if selected { + // An open menu holds the row in its hover fill. + let menu_open = self + .popup + .is_open(&SidebarPopup::OtherTask(task.target.clone())); + let row_bg = if menu_open { + hover_bg + } else if selected { theme::bg_sidebar_row_hover() } else { theme::bg_sidebar() @@ -2477,6 +2483,7 @@ impl Sidebar { }) .hover_bg(gpui::rgb(hover_bg)) .when(dragging || renaming, |row| row.highlighted(false)) + .when(menu_open, |row| row.highlighted(true)) .when(!(dragging || renaming), |row| { row.hover(|style| style.cursor_pointer()) }) @@ -2520,6 +2527,7 @@ impl Sidebar { &task.row.group, "pin", tr("chat-unpin-task"), + false, ) .opacity(1.) .tooltip(widgets::tooltip(tr("chat-unpin"), None)) diff --git a/apps/maple-agent/app/src/ui/theme.rs b/apps/maple-agent/app/src/ui/theme.rs index 322254b83..29b9a010e 100644 --- a/apps/maple-agent/app/src/ui/theme.rs +++ b/apps/maple-agent/app/src/ui/theme.rs @@ -300,6 +300,17 @@ pub fn overlay_hover() -> gpui::Hsla { } } +/// Translucent fill for a pressed control over any surface: one step past +/// [`overlay_hover`], so a press always reads darker (lighter on dark) +/// than the hover and the row beneath, whatever that row's own state. +pub fn overlay_press() -> gpui::Hsla { + if is_light() { + gpui::hsla(0., 0., 0., 0.11) + } else { + gpui::hsla(0., 0., 1., 0.14) + } +} + /// Alternate-row tint in markdown tables: a whisper of the hover overlay, /// so a long table reads row by row without stripes competing with the /// text. From 186afeb2dc317977887636665b36cf3a95930843 Mon Sep 17 00:00:00 2001 From: Matthew Ball <13823657+matthewrball@users.noreply.github.com> Date: Tue, 17 Nov 2026 04:59:34 -0800 Subject: [PATCH 3/5] Agent: tell a task's status by shape and to screen readers A task waiting on the user and a task that finished unseen both showed an 8 px dot, told apart only by colour. The waiting mark is now a small coral dot in a soft coral halo with a solid edge; the finished mark stays a plain green dot, so the two differ by shape too. The coral is accent_ink, the ink the transcript's line rests in while Maple waits on you, which holds about 3:1 on a selected light row where the brighter coral faded. The indicator and the title's shine had no accessible name, so screen readers heard only a row's title and project. A task row's description now leads with its status (Running, Waiting for your answer, Last run failed, Finished, not opened yet), then its project details, on this computer's rows and a paired computer's alike. The description is cached per status and details, so the shine's repaints allocate nothing for it. English, Spanish, German and Korean. --- apps/maple-agent/app/locales/de/app.ftl | 5 + apps/maple-agent/app/locales/en/app.ftl | 6 + apps/maple-agent/app/locales/es/app.ftl | 5 + apps/maple-agent/app/locales/ko/app.ftl | 5 + apps/maple-agent/app/src/ui/chat/sidebar.rs | 103 ++++++++++++++---- .../app/src/ui/chat/sidebar_computers.rs | 4 + .../app/translation-revisions/de.txt | 5 + .../app/translation-revisions/es.txt | 5 + .../app/translation-revisions/ko.txt | 5 + 9 files changed, 124 insertions(+), 19 deletions(-) diff --git a/apps/maple-agent/app/locales/de/app.ftl b/apps/maple-agent/app/locales/de/app.ftl index 3d38f3e8b..fc7f2049f 100644 --- a/apps/maple-agent/app/locales/de/app.ftl +++ b/apps/maple-agent/app/locales/de/app.ftl @@ -1652,6 +1652,11 @@ chat-connecting = Verbindung wird hergestellt… chat-offline = Offline chat-project-options = Projektoptionen chat-task-options = Aufgabenoptionen +chat-task-running = Läuft +chat-task-needs-you = Wartet auf deine Antwort +chat-task-failed = Letzter Lauf fehlgeschlagen +chat-task-finished-unseen = Fertig, noch nicht geöffnet +chat-task-status-details = { $status }. { $details } chat-more = Mehr chat-rename = Umbenennen chat-unpin = Anheftung lösen diff --git a/apps/maple-agent/app/locales/en/app.ftl b/apps/maple-agent/app/locales/en/app.ftl index 5cdced0e0..84e7d79af 100644 --- a/apps/maple-agent/app/locales/en/app.ftl +++ b/apps/maple-agent/app/locales/en/app.ftl @@ -1652,6 +1652,12 @@ chat-connecting = Connecting… chat-offline = Offline chat-project-options = Project options chat-task-options = Task options +chat-task-running = Running +chat-task-needs-you = Waiting for your answer +chat-task-failed = Last run failed +chat-task-finished-unseen = Finished, not opened yet +# $status is one of the task status labels above; $details is the task's project and computer names, not translated. +chat-task-status-details = { $status }. { $details } chat-more = More chat-rename = Rename chat-unpin = Unpin diff --git a/apps/maple-agent/app/locales/es/app.ftl b/apps/maple-agent/app/locales/es/app.ftl index d1ed75bfe..b7069016e 100644 --- a/apps/maple-agent/app/locales/es/app.ftl +++ b/apps/maple-agent/app/locales/es/app.ftl @@ -1537,6 +1537,11 @@ chat-connecting = Conectando… chat-offline = Sin conexión chat-project-options = Opciones de proyecto chat-task-options = Opciones de tarea +chat-task-running = En curso +chat-task-needs-you = Esperando tu respuesta +chat-task-failed = La última ejecución falló +chat-task-finished-unseen = Terminó, aún sin abrir +chat-task-status-details = { $status }. { $details } chat-more = Más chat-rename = Cambiar nombre chat-unpin = Desfijar diff --git a/apps/maple-agent/app/locales/ko/app.ftl b/apps/maple-agent/app/locales/ko/app.ftl index bffa581fe..27e9dc52b 100644 --- a/apps/maple-agent/app/locales/ko/app.ftl +++ b/apps/maple-agent/app/locales/ko/app.ftl @@ -1598,6 +1598,11 @@ chat-connecting = 연결하는 중… chat-offline = 오프라인 chat-project-options = 프로젝트 옵션 chat-task-options = 작업 옵션 +chat-task-running = 실행 중 +chat-task-needs-you = 답변을 기다리는 중 +chat-task-failed = 마지막 실행 실패 +chat-task-finished-unseen = 완료됨, 아직 열지 않음 +chat-task-status-details = { $status }. { $details } chat-more = 더 보기 chat-rename = 이름 변경 chat-unpin = 고정 해제 diff --git a/apps/maple-agent/app/src/ui/chat/sidebar.rs b/apps/maple-agent/app/src/ui/chat/sidebar.rs index 24c8d79fc..18250eac9 100644 --- a/apps/maple-agent/app/src/ui/chat/sidebar.rs +++ b/apps/maple-agent/app/src/ui/chat/sidebar.rs @@ -4290,7 +4290,10 @@ impl Sidebar { .role(gpui::Role::ListBoxOption) .accessibility_id(row.id.to_string()) .aria_label(row.title.clone()) - .aria_description(row.metadata.clone()) + .when_some( + self.activity_description(activity, &row.metadata), + |row, text| row.aria_description(text), + ) .aria_selected(is_selected) .when(application_selected, |row| row.aria_active_descendant()) .group(row.group.clone()) @@ -4574,14 +4577,25 @@ fn task_title(title: &SharedString, running: bool, selected: bool) -> AnyElement .into_any_element() } -/// A coral dot while a question waits, an alert once a run failed unseen, -/// and a green dot once one completed unseen. A running task shows nothing -/// here: its title shines instead (see [`task_title`]). Every state sits -/// centered in one box the size of the largest, which a running row keeps -/// empty, so the title's width stays put as states change, and one state -/// cross-fades into the next over [`motion::TOGGLE`]. The box is keyed by -/// `spinner_id`, which names the task, so an indicator that first appears -/// (a list that loads, a row that scrolls in) shows its state at once. +/// One breath of the waiting mark's halo: slower than the title's shine, +/// so a task that needs you reads as calm rather than urgent. The fade runs +/// on the shared low-rate clock, where a fade reads smooth. +const NEEDS_YOU_BREATH: Duration = Duration::from_millis(2400); + +/// A coral dot in an edged coral halo while a question waits, an alert +/// once a run failed unseen, and a plain green dot once one completed +/// unseen. The halo's edge keeps the waiting and finished marks apart by +/// shape, not by colour alone, on every row fill, and the halo breathes +/// (see [`NEEDS_YOU_BREATH`]) so a waiting task draws the eye. The coral is +/// the ink the transcript's line rests in while Maple waits on you. A +/// running task shows nothing here: its title shines instead (see +/// [`task_title`]). +/// Every state sits centered in one box the size of the largest, which a +/// running row keeps empty, so the title's width stays put as states +/// change, and one state cross-fades into the next over +/// [`motion::TOGGLE`]. The box is keyed by `spinner_id`, which names the +/// task, so an indicator that first appears (a list that loads, a row that +/// scrolls in) shows its state at once. fn activity_indicator(spinner_id: &SharedString, activity: SessionActivity) -> AnyElement { let layer = |name: &'static str, state: SessionActivity, glyph: fn() -> AnyElement| { motion::animated( @@ -4604,30 +4618,81 @@ fn activity_indicator(spinner_id: &SharedString, activity: SessionActivity) -> A }, ) }; - fn dot(color: u32) -> AnyElement { - div() - .size(px(8.)) - .rounded_full() - .bg(gpui::rgb(color)) - .into_any_element() + fn needs_you() -> AnyElement { + motion::ticker("needs-you-breath", NEEDS_YOU_BREATH, |phase| { + let coral = gpui::rgb(theme::accent_ink()); + // Centred on the resting look, so a paused loop's rest frame + // (phase 0, the wave's midpoint) is the halo as it stands still. + let fill = motion::pulse(phase, 0., 0.16, 0.40); + let edge = motion::pulse(phase, 0., 0.5, 0.9); + div() + .size(px(13.)) + .rounded_full() + .bg(coral.alpha(fill)) + .border_1() + .border_color(coral.alpha(edge)) + .flex() + .items_center() + .justify_center() + .child(div().size(px(5.)).rounded_full().bg(coral)) + .into_any_element() + }) + .into_any_element() } div() .id(spinner_id.clone()) .relative() .size(px(13.)) .flex_none() - .child(layer("needs-you", SessionActivity::NeedsYou, || { - dot(theme::accent()) - })) + .child(layer("needs-you", SessionActivity::NeedsYou, needs_you)) .child(layer("failed", SessionActivity::Failed, || { icon("circle-alert", px(13.), theme::status_error()).into_any_element() })) .child(layer("completed", SessionActivity::CompletedUnread, || { - dot(theme::status_success()) + div() + .size(px(8.)) + .rounded_full() + .bg(gpui::rgb(theme::status_success())) + .into_any_element() })) .into_any_element() } +impl Sidebar { + /// A task row's accessibility description: its status, which the + /// indicator and the title's shine only show, ahead of its project + /// details. Nothing when there is neither. Rows render on every shine + /// frame, so a cache hit borrows the details and allocates nothing. + pub(super) fn activity_description( + &self, + activity: Option, + details: &SharedString, + ) -> Option { + let Some(activity) = activity else { + return (!details.is_empty()).then(|| details.clone()); + }; + let key = match activity { + SessionActivity::Running => "chat-task-running", + SessionActivity::NeedsYou => "chat-task-needs-you", + SessionActivity::Failed => "chat-task-failed", + SessionActivity::CompletedUnread => "chat-task-finished-unseen", + }; + if details.is_empty() { + return Some(tr(key)); + } + Some(self.messages.computed(key, details, || { + let status = tr(key); + tr_args( + "chat-task-status-details", + [ + ("status", status.as_ref().into()), + ("details", details.as_ref().into()), + ], + ) + })) + } +} + /// The strip over a row's end that holds its hover buttons, with the /// row's hover color behind them so they cover the title. fn hover_actions(group: &SharedString, hover_bg: u32) -> Div { diff --git a/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs b/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs index 1e829b18e..2b3cf2833 100644 --- a/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs +++ b/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs @@ -2465,6 +2465,10 @@ impl Sidebar { .group(task.id.clone()) .role(gpui::Role::ListBoxOption) .aria_label(task.title.clone()) + .when_some( + self.activity_description(task.activity, &task.metadata), + |row, text| row.aria_description(text), + ) .aria_selected(false) .mx_2() .my(px(1.)) diff --git a/apps/maple-agent/app/translation-revisions/de.txt b/apps/maple-agent/app/translation-revisions/de.txt index fbc2d9b84..0f5431112 100644 --- a/apps/maple-agent/app/translation-revisions/de.txt +++ b/apps/maple-agent/app/translation-revisions/de.txt @@ -369,7 +369,12 @@ chat-subscribe-history-failed efcbfea0fd223b98 chat-task 18e7eadd2d1ee4dd chat-task-cancelled 3b640b3cda8db4fe chat-task-creating 73485b54c5bfed5b +chat-task-failed 30dcf87a991d6938 +chat-task-finished-unseen 5a6b5ec6b84a1cc0 +chat-task-needs-you f4d20e20814b295d chat-task-options 77f2f2d494397278 +chat-task-running 1652a6ab704d99c1 +chat-task-status-details 6cd6bbbd0091eb32 chat-tasks 2e8ded459c3711e1 chat-thinking 7218df9687f2fbed chat-thinking-choose-model 44c32f022b0e6942 diff --git a/apps/maple-agent/app/translation-revisions/es.txt b/apps/maple-agent/app/translation-revisions/es.txt index fbc2d9b84..0f5431112 100644 --- a/apps/maple-agent/app/translation-revisions/es.txt +++ b/apps/maple-agent/app/translation-revisions/es.txt @@ -369,7 +369,12 @@ chat-subscribe-history-failed efcbfea0fd223b98 chat-task 18e7eadd2d1ee4dd chat-task-cancelled 3b640b3cda8db4fe chat-task-creating 73485b54c5bfed5b +chat-task-failed 30dcf87a991d6938 +chat-task-finished-unseen 5a6b5ec6b84a1cc0 +chat-task-needs-you f4d20e20814b295d chat-task-options 77f2f2d494397278 +chat-task-running 1652a6ab704d99c1 +chat-task-status-details 6cd6bbbd0091eb32 chat-tasks 2e8ded459c3711e1 chat-thinking 7218df9687f2fbed chat-thinking-choose-model 44c32f022b0e6942 diff --git a/apps/maple-agent/app/translation-revisions/ko.txt b/apps/maple-agent/app/translation-revisions/ko.txt index fbc2d9b84..0f5431112 100644 --- a/apps/maple-agent/app/translation-revisions/ko.txt +++ b/apps/maple-agent/app/translation-revisions/ko.txt @@ -369,7 +369,12 @@ chat-subscribe-history-failed efcbfea0fd223b98 chat-task 18e7eadd2d1ee4dd chat-task-cancelled 3b640b3cda8db4fe chat-task-creating 73485b54c5bfed5b +chat-task-failed 30dcf87a991d6938 +chat-task-finished-unseen 5a6b5ec6b84a1cc0 +chat-task-needs-you f4d20e20814b295d chat-task-options 77f2f2d494397278 +chat-task-running 1652a6ab704d99c1 +chat-task-status-details 6cd6bbbd0091eb32 chat-tasks 2e8ded459c3711e1 chat-thinking 7218df9687f2fbed chat-thinking-choose-model 44c32f022b0e6942 From 188628576c30621998439465daab946e1b7b7f5a Mon Sep 17 00:00:00 2001 From: Matthew Ball <13823657+matthewrball@users.noreply.github.com> Date: Tue, 17 Nov 2026 05:17:50 -0800 Subject: [PATCH 4/5] Agent: keep a shining line's letters in place as the band passes The shine coloured its line with a text run per letter. gpui shapes a line anew wherever the colour changes, so each letter inside the band was shaped alone and lost its kerning against its neighbours, while letters outside it, all one colour, kept theirs. As the band crossed, letters moved by up to five pixels and back. The shine now paints the resting line's single layout glyph by glyph, each in its own tint, so the words stay where they rest and only their colour moves. --- apps/maple-agent/app/src/ui/morph_text.rs | 44 ++++++++++++++++------- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/apps/maple-agent/app/src/ui/morph_text.rs b/apps/maple-agent/app/src/ui/morph_text.rs index bbbf65377..90b9a06f5 100644 --- a/apps/maple-agent/app/src/ui/morph_text.rs +++ b/apps/maple-agent/app/src/ui/morph_text.rs @@ -390,18 +390,38 @@ impl Element for MorphText { (true, state) } _ if shine.is_some() => { - // One line with a run per letter, so the shine does - // not disturb the spacing of the words. - let runs: Vec<_> = state - .letters - .iter() - .map(|letter| { - let mut run = style.to_run(letter.text.len()); - run.color = tint(letter.x); - run - }) - .collect(); - draw(window, cx, &state.text, &runs, px(0.), px(0.)); + // The resting line's one layout, each glyph painted in + // its own tint. A text run per colour would split the + // shaping wherever the colour changes, so letters lose + // their kerning, and shift, as the band passes. + let layout = window.text_system().layout_line( + &state.text, + font_size, + &[style.to_run(state.text.len())], + None, + ); + let padding_top = (line_height - layout.ascent - layout.descent) / 2.; + let baseline = point(bounds.left(), bounds.top() + padding_top + layout.ascent); + for run in &layout.runs { + for glyph in &run.glyphs { + let origin = baseline + glyph.position; + if glyph.is_emoji { + window + .paint_emoji(origin, run.font_id, glyph.id, font_size) + .ok(); + } else { + window + .paint_glyph( + origin, + run.font_id, + glyph.id, + font_size, + tint(glyph.position.x), + ) + .ok(); + } + } + } (false, state) } _ => { From 9fad336b16c49fdb330a75ed7a496e5b818efa67 Mon Sep 17 00:00:00 2001 From: Matthew Ball <13823657+matthewrball@users.noreply.github.com> Date: Tue, 17 Nov 2026 20:52:58 -0800 Subject: [PATCH 5/5] Agent: make a running task's shine readable at a glance A running task's title shone too softly to catch: the band was heading ink, close to the words it crossed, and on a selected row the words rested in secondary ink, nearly the band's colour, so a selected running row looked idle. The band is now activity_shine, the brightest ink each theme has (white on dark, black on light), over words that rest in muted ink on every row, selected or not, and it passes every 1.2 s instead of 1.9 s. The band against the words goes from 1.5:1 to 2.7:1 on a selected dark row; the band against a selected row's fill reaches 11:1 dark and 14:1 light. The resting words of a selected running row sit below 4.5:1 (4.2:1 dark, 3.5:1 light); the band crosses them every 1.2 s, and the task itself is open beside the sidebar. --- apps/maple-agent/app/src/ui/chat/sidebar.rs | 36 ++++++++----------- .../app/src/ui/chat/sidebar_computers.rs | 1 - apps/maple-agent/app/src/ui/theme.rs | 3 ++ apps/maple-agent/docs/brand.md | 1 + 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/apps/maple-agent/app/src/ui/chat/sidebar.rs b/apps/maple-agent/app/src/ui/chat/sidebar.rs index 18250eac9..a56d82a82 100644 --- a/apps/maple-agent/app/src/ui/chat/sidebar.rs +++ b/apps/maple-agent/app/src/ui/chat/sidebar.rs @@ -4330,11 +4330,7 @@ impl Sidebar { .map(|column| match rename_field { Some(field) => column.child(field), None => column.child(row_line( - task_title( - &row.title, - activity == Some(SessionActivity::Running), - is_selected, - ), + task_title(&row.title, activity == Some(SessionActivity::Running)), hover_group, row_bg, hover_bg, @@ -4554,26 +4550,24 @@ fn row_fade_background(color: u32) -> gpui::Background { ) } -/// One pass of a running task's shine across its title: the pace of the -/// transcript's "Maple is thinking" line, so the two read as one signal. -const TITLE_SHINE: Duration = Duration::from_millis(1900); - -/// A task's title. While the task runs, a brighter band sweeps across the -/// words, the transcript's thinking shine, and the words rest a step -/// dimmer under it as the thinking line's do: secondary ink on a selected -/// row, muted otherwise, as the row's metadata. The band holds still when -/// loops do, under reduced motion and in a background window. -fn task_title(title: &SharedString, running: bool, selected: bool) -> AnyElement { +/// One pass of a running task's shine across its title. Quicker than the +/// transcript's "Maple is thinking" line: the sidebar is read at a glance, +/// and a running row must show itself within a moment of looking. +const TITLE_SHINE: Duration = Duration::from_millis(1200); + +/// A task's title. While the task runs, the transcript's thinking shine +/// sweeps across the words in the brightest ink the theme has, over words +/// that rest in muted ink on every row. A selected row keeps the same +/// muted rest: in secondary ink, the selected row's band and words were +/// nearly one colour. The band holds still when loops do, under reduced +/// motion and in a background window. +fn task_title(title: &SharedString, running: bool) -> AnyElement { if !running { return title.clone().into_any_element(); } morph_text("task-title", title.clone()) - .color(gpui::rgb(if selected { - theme::text_secondary() - } else { - theme::text_muted() - })) - .shine(TITLE_SHINE, gpui::rgb(theme::text_heading())) + .color(gpui::rgb(theme::text_muted())) + .shine(TITLE_SHINE, gpui::rgb(theme::activity_shine())) .into_any_element() } diff --git a/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs b/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs index 2b3cf2833..d5f32ef3a 100644 --- a/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs +++ b/apps/maple-agent/app/src/ui/chat/sidebar_computers.rs @@ -2506,7 +2506,6 @@ impl Sidebar { task_title( &task.title, task.activity == Some(SessionActivity::Running), - selected, ), hover_group, row_bg, diff --git a/apps/maple-agent/app/src/ui/theme.rs b/apps/maple-agent/app/src/ui/theme.rs index 29b9a010e..8a10aebb9 100644 --- a/apps/maple-agent/app/src/ui/theme.rs +++ b/apps/maple-agent/app/src/ui/theme.rs @@ -217,6 +217,9 @@ tokens! { accent_ink: 0xff9771, 0xd04926; status_running: 0xbabccb, 0xa3a3a3; + /// The band that shines across a running task's title: the brightest + /// ink each theme has, so a running row reads at a glance on any fill. + activity_shine: 0xffffff, 0x000000; status_success: 0x8fa35a, 0x7b8f4a; status_error: 0xe07052, 0xd05e41; /// Wavy underline under a misspelled word in the composer. diff --git a/apps/maple-agent/docs/brand.md b/apps/maple-agent/docs/brand.md index bf3602174..0c848d379 100644 --- a/apps/maple-agent/docs/brand.md +++ b/apps/maple-agent/docs/brand.md @@ -185,6 +185,7 @@ the dark background. | `on_accent` | `#f7f7f9` | same | on primary (stays bright so coral stays readable) | | `accent_container`, `permission_fill` | `#ffe8e0` Maple 100 | `#3a2118` / `#2a1a14` | primary container | | `accent_ink` | `#d04926` Maple 800 | `#ff9771` Maple 500 | coral icon on a primary container, 3:1 or better | +| `activity_shine` | `#000000` | `#ffffff` | the band that shines across a running task's title, over `text_muted` | | `bg_composer_tray` | `#f7f7f9` Pebble 50 | `#222228` | panel docked inside the composer | | `bg_default_button`, `text_on_default_button` | `#171717` / `#f7f7f9` | `#e8e8ed` / `#18181c` | `default_button`: the inverted pill, held to 7:1 at rest, hover and press | | `link` | `#9e7469` Bark 500 | `#c29a8d` Bark 300 | tertiary |