Skip to content

Agent: Fold a turn's steps under one line that times the work - #1587

Open
matthewrball wants to merge 21 commits into
masterfrom
ux/turn-timer
Open

matthewrball wants to merge 21 commits into
masterfrom
ux/turn-timer

Conversation

@matthewrball

@matthewrball matthewrball commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does

  • While Maple works, one line says what it is doing and for how long: "Maple is thinking 4s", then "Maple is working", then "Maple is writing". It replaces the three waiting dots.
  • The running time counts whole seconds. The words carry the only shine; the blocks around the M's outline shrink and grow one at a time instead.
  • Thinking rows and tool calls fold under that line. Click the line to show them; they open as the same cards as today.
  • When Maple asks a question or needs permission, the line reads "Waiting for you" and the time stops.
  • When the turn ends, the line reads "Worked for 11s".
  • "Show tool call details" in Settings keeps every turn open.

Thinking, light

Thinking, dark

Steps shown under the line, light

Steps shown under the line, dark

These are headless renders of the real view with fixture rows. Screenshots of a signed-in run of the whole stack are in #1590.

Notes

  • The mark's pulse laps the whole outline without a rest, and the finished time counts whole seconds the same way the running time does, so "6s" never ends as "Worked for 7s".
  • Part 1 of 4, stacked on Agent: rework the motion layer on springs, with timing in one place #1575. Next: steps as a thread (Agent: Draw a turn's steps as a thread #1588), permission details (Agent: Show on a step that it waits for permission, and what you said #1589), files changed (Agent: List the files a turn changed under its reply #1590).
  • The line waits in the slot the dots used, then the turn's first step draws it in the same place, so nothing moves when the first step arrives.
  • The mark and the words repaint on the shared 15 fps loop while a run is on screen, like a tool spinner. With reduced motion, or in a window that is not active, they rest and the time counts whole seconds.
  • The shine paints the line's single layout glyph by glyph, each in its own tint, so letters keep their kerning and stay put as the band passes. A text run per colour shaped each letter on its own and nudged it by up to 5 px. Agent: a running task's title shimmers instead of showing a coral ring #1521 carries the same morph_text.rs, so the two merge cleanly in either order.
  • A turn is timed by the window that watched it run from start to end. A turn read from history, or a run that went on while another task was on screen, shows "Worked" without a time. Storing the time with the turn is host work; say if you want it.
  • A reply with no steps gets no line once its text starts, as the dots left at the first token today. Keeping the line under a streaming reply would shift the transcript when it closes; say if you want it anyway.
  • Application Vim treats a folded turn as one row: l shows its steps, h folds them.
  • New strings are in English, Spanish, German and Korean.
  • Tests: folding and opening from the line, the line keeping its place when the first step arrives, the time leaving out the wait for an answer, a queued message ending the turn before it, grouping rows into turns, Vim navigation over a folded turn.
  • Checked on macOS with Rust 1.98: just ci-lint and cargo test -p maple-agent-app --locked pass on each of the four branches, and just ci-extra at the top of the stack (Agent: List the files a turn changed under its reply #1590). Partial verification: just ci-test was not run to the end here; on this Mac it fails 65 store and external-agent tests in crates/maple-agent, which this stack does not touch.

AnthonyRonning and others added 12 commits November 11, 2026 12:12
Moves gpui and gpui_platform from Zed cc053a4a (Aug 7) to c7bea343
(Nov 4), about 230 upstream commits to the gpui crates. The element,
style, list and accessibility APIs Maple builds on are unchanged; the
changes here are what the new revision requires.

- Keystrokes name their host: parse_with_os, unparse(os) and display(os),
  through a new keymap::host_os(). Keystroke::parse now rejects the
  secondary- alias the shortcut catalog uses.
- KeyBinding::load takes the app instead of a keyboard mapper, so
  build_binding and shortcuts::prepare take cx. On Windows, bindings now
  pass through the platform keyboard mapper.
- window.blur(cx); on_scroll_wheel and ScrollWheelEvent became on_scroll
  and ScrollEvent; expect_restart reports arguments too.
- gpui's stack growth under deep element trees is now the opt-in
  `stacker` feature; keep it on. uuid's v7 feature is now ours to enable.
- gpui reports hover when content moves under a still pointer and drops
  it on a key press. A menu row keeps its highlight across a key press,
  and the sidebar test asserts hover is never stale instead of always
  clear.
- gpui wraps text by the Unicode line breaking rules. Markdown tables
  measure unbreakable runs with the same icu_segmenter call instead of a
  copy of the old word-character table.

Lockfile: 45 new registry versions, each published at least seven days
ago (crates.io created_at, checked Nov 11), pinned to the versions in
Zed's own lockfile where the two differed. New git sources, all chosen by
Zed's workspace: gfx-rs/wgpu cddb2f5d (wgpu 30), zed-industries/oo7
731c1215 (was crates.io 0.6.0) and zed-industries/scap b5c86ec5.
taffy moves from 0.12.2 to 0.15.0.

Co-Authored-By: Claude <noreply@anthropic.com>
The pin no longer has to match gpui-libghostty; that experiment was
dropped.

Co-Authored-By: Claude <noreply@anthropic.com>
The newer gpui can paint how long each frame took to build and paint
over the window. Turn its profiler on, as Zed does, and show that overlay
in the main window when MAPLE_FRAME_STATS is set; `full` adds percentiles
over the last 1000 frames. The performance check gains a step that uses
it, so "smooth" can be a number.

One new registry dependency, hdrhistogram 7.5.4, the version in Zed's
lockfile, published well over seven days ago.

Co-Authored-By: Claude <noreply@anthropic.com>
Matt's motion work from #1515, squashed at a587cda and carried onto the
newer gpui with no change in behaviour. His branch stays as it is.

It adds short, interruptible motion across the app: messages arrive
instead of appearing, the composer travels between the empty state and
the thread, hover and controls ease, menus open from their trigger,
dialogs rise in and Settings sections fade. The rules and tokens are in
docs/motion.md, and ui/motion.rs implements them.

Changes from his head:
- Two merge conflicts with the gpui bump, resolved to his side (the
  cards above the composer, the send preview).
- gpui's rename of on_scroll_wheel to on_scroll in the code he added.
- Four test fixtures gained the session summary's thinking_level field,
  which master added after his branch.

Co-Authored-By: Claude <noreply@anthropic.com>
Every reversible transition (hover, switches, chevrons, the composer, the
sidebar, unfolding, text fields growing) now runs on a spring from gpui's
integrator instead of restarting an easing curve. A spring keeps the speed
it has when its target changes, so turning back mid-way has no corner in
it. Springs are critically damped: they do not overshoot from rest.

Timing lives in one place. Each token in ui/motion.rs (HOVER, REVEAL,
TOGGLE, ENTER, PANEL) is one constant holding the duration and curve its
one-shot entrances run and the time its spring takes to settle, and
DAMPING_RATIO sets how every spring is damped. Editing a token retunes
every animation of that kind. Call sites pass a token; none names a curve.

- Tween keeps its interface and becomes a spring. The sidebar and the
  composer retarget the Tween they have instead of starting a new one,
  which is what lets them keep their speed. Tween::pixels stops a length
  within a quarter pixel.
- MAPLE_MOTION=eased runs reversible values on their token's duration and
  curve, as before, to compare the two in one build.
- swap_in fades its content instead of painting a cover over it. gpui now
  repaints a cached view when the opacity it inherits changes, so the
  cover and the rule against fading above a cached view are gone.
- The two tests that asserted the old curve's exact shape now pin the
  eased style; new tests cover a spring leaving from rest, not
  overshooting, settling within its token, and keeping its position and
  speed through a reversal.

Co-Authored-By: Claude <noreply@anthropic.com>
`.hover_bg(color)` replaces `hover_background(element, rest, hover)`. It
reads the resting background from the control itself, so a call site no
longer restates that colour beside the `.bg(..)` that set it, and the two
cannot drift. The 36 call sites shrink from a five-to-nine-line `.map`
block to one line each.

The nine hover backgrounds that still changed in a single frame (the
Settings catalog cards and tiles, the usage chart's bars and range pills,
the theme pills, the ACP example tabs, the effort reset button and two
transcript controls) now ease like the rest.

`motion::reveal(element, visible)` fades a control in place; the sidebar's
chevron used a hover with two transparent colours to get that.

No colour or timing changes. The danger button sets its own fill now
instead of relying on the hover to paint it.

Co-Authored-By: Claude <noreply@anthropic.com>
The composer's expand transition works out its start and end heights
from three numbers the layout also uses: the share of the column the
expanded composer takes, the expand button's size, and the empty state's
padding. Each was written twice, once in the layout and once in the
arithmetic, so changing the layout would have left the transition
landing a few pixels off with nothing to catch it. They are now named
constants in chat/composer.rs that both sides read.

Also:
- The last motion test that slept on real time
  (cached_child_hover_animates_reverses_and_goes_idle) now advances the
  pinned clock, and the per-element test clock it needed is gone.
- docs/motion.md and CLAUDE.md name the effort slider as the one control
  with physics of its own, tuned beside it and deliberately outside the
  tokens.

Co-Authored-By: Claude <noreply@anthropic.com>
Recording a multi-line send against a real backend and stepping through
the frames showed two jumps, and the composer's move between a new task
and a conversation read as lag.

- The sent message's row never took over from its bubble. The hand-off
  was keyed by the id the event names, but the transcript files a row
  under its view key, and a real host's rows have one. The row entered
  as a new row, faint and growing from nothing, on the frame its bubble
  vanished, so the thread dropped and climbed back. The hand-off now
  uses the view key. The tests passed because their rows carry no
  identity; a new test sends one that does.
- Sending from a composer several rows tall dropped the thread first.
  The composer emptied at once while the bubble's slot opened from
  nothing. The slot now opens from the height the composer gave up, so
  the newest row holds still on the send frame and then only moves up.
  Clearing the field now also resets its eased height on purpose.
- The composer changes place at once between a new task and a
  conversation. Where the user types is not something to animate.

Co-Authored-By: Claude <noreply@anthropic.com>
A long turn filled the transcript with thinking rows and tool cards, and
the only sign of progress before the first of them was three dots.

One line per turn now says what Maple is doing and for how long, in the
slot the dots used and then on the turn's first step, where it stays.
The steps fold under it until it is clicked; "Show tool call details"
keeps them open. A question stops the time, and a finished turn keeps
how long it worked.

The waiting row in the empty state went with the dots: that screen only
shows while nothing is awaited, so it never drew.
A run can take up a queued message and go on to a second turn, and a
window paged back in history ends on a turn the run never touched. The
time went to whichever turn was last on screen when the run ended.

The clock now remembers the turn it is timing by its first step. A
message from the user ends that turn and starts the time again, and a
paged-back window shows no turn as running. The time on the line is
also text a screen reader can reach.
A run goes on while another task is on screen, and its rows are not
taken in there. Back on the task, the clock could still point at an
earlier turn and charge it for the later ones. A window that lacks the
run's newest rows could also show an older turn as the one running.

A run whose rows the view missed drops its clock, so its turns read
"Worked" with no time. A window without the live rows shows no turn
as running.
Dropping the clock also forgot which run it was, so a late send
acknowledgement started a fresh clock midway and showed a partial
time. The run now stays known and only its clock goes.
A view paged back in history does not take in new rows. A queued
message that began the run's next turn went unseen there, and the
earlier turn was charged for both when the run ended.
@matthewrball
matthewrball marked this pull request as ready for review November 12, 2026 15:14
@AnthonyRonning
AnthonyRonning force-pushed the codex-gpuibump-motion-core branch 3 times, most recently from 26e0997 to 50b6ff5 Compare November 14, 2026 16:19
Base automatically changed from codex-gpuibump-motion-core to master November 14, 2026 16:19
@marksftw

Copy link
Copy Markdown
Collaborator

Specific feedback because this is an interaction that will be seen a lot. These are my thoughts after using it for a while.

I think maybe there is too much shimmer happening. Either the M or the text can shimmer. Doing both feels a bit much. Maybe the M doesn't shimmer but does a different kind of subtle animation. Like the bricks that make up the actual letter M could individually shrink and grow, one at a time, as they draw the M. It would be each block that is on the left, top, and right perimeter. I'm also not sold on this shape being part of the thinking animation, but it could work. I attached an example video of how another app does it a combined logo and text animation.

When the timer is running as the task thinks, don't count with milliseconds. It's too much movement. I think it should count seconds, not sub-seconds. For the final "Worked" state, if it is less than 1 minute, it's okay to show milliseconds, but it's busy if it's counting them live during the running state.

thinking-animation-example.mov

Master gained the Korean catalog (#1605) after this branch was cut.
The mark and the words both shone, and the running time counted tenths: too much movement on a line that shows for the whole turn. The words keep the shine, the mark's blocks pulse one at a time along the M, and the running time counts whole seconds.
…in step

The pulse began and ended a block short, so the first and last blocks never reached full size and snapped when the pass restarted. The finished time rounded while the running time counted down whole seconds, so "6s" could end as "Worked for 7s".
@matthewrball

matthewrball commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator Author

@marksftw thanks, this was useful. Updated, and it's on current master again:

  • One shimmer. Only the words shine now. The M doesn't.
  • The M moves instead. Its blocks shrink and grow one at a time all the way around the outline: up the left side, through the notch, down the right side and back along the bottom. The inner blocks hold still.
  • Whole seconds. The running time counts "6s", "7s", with no tenths. The final "Worked for 11s" is unchanged.

The turn line while Maple works, dark: the M's blocks pulse one at a time around its outline, the words shine, the time counts whole seconds

The same line in light

Recorded from a debug build at real speed. The clip loops every 10 seconds or so, so the time jumps back at the loop point.

I left the mark as the M for now. If the pulse still isn't right, or you'd rather try a different shape there, I'm happy to do another round.

#1588, #1589 and #1590 carry the same change. The screenshots in the description are from before it, so the timer in them still shows tenths.

Edited: the pulse first stopped at the bottom corners and rested between passes. It now goes all the way around without a rest, and the clips above show that.

The pulse ran up the left, through the notch and down the right, then rested, so the bottom row never moved. It now goes around the whole outline, one block at a time, without a rest.
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.
matthewrball added a commit that referenced this pull request Nov 18, 2026
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.
@marksftw

Copy link
Copy Markdown
Collaborator

For the "M" animation, I don't like having the progress run along the bottom. skip the bottom perimeter. when it's done in the bottom right, it should pause a beat or two and then begin on the bottom left. it's drawing a letter M.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants