feat(tui): show elapsed time while a turn is still running - #184
Merged
Merged
Conversation
The status row already says a turn is alive, twice: a spinner and a
shimmer sweep over the label. Neither answers the question someone
waiting actually has, which is whether this has been running four
seconds or four minutes.
That number already exists. `turn_start` is set at the top of every
turn and `format_elapsed_ms` renders it, but it was only read after the
turn finished, for the "Worked for 2m 5s · done" line. So the duration
was shown exactly when it had stopped mattering.
The streaming branch now appends it live, muted, beside the label:
⠋ Generating… · 12s
`format_elapsed_ms` becomes `pub(crate)`, matching `format_duration_secs`
directly below it, so the renderer can share the same formatting rather
than growing a second one that rounds differently.
Deliberately not ported from the sibling implementation: that one draws
a ramped progress sweep, because its status bar had only a spinner. This
status row already has a shimmer doing that job, and a second travelling
effect beside it would be noise. Only the part that adds information is
carried over.
Three tests: a running turn reports its elapsed time without displacing
the existing label, no separator is drawn when no turn is timed, and the
completed-turn summary in the idle branch is untouched.
Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The status row already says a turn is alive, twice — a spinner and a shimmer sweep over the label. Neither answers the question someone waiting actually has: has this been running four seconds, or four minutes?
The number already existed
turn_startis set at the top of every turn andformat_elapsed_msrenders it — but it was only read after the turn finished, for the✓ Worked for 2m 5s · doneline. The duration was shown exactly when it had stopped mattering.format_elapsed_msbecomespub(crate), matchingformat_duration_secsdirectly below it, so the renderer shares the same formatting instead of growing a second one that rounds differently.What I deliberately did not port
The sibling implementation in
covendraws a ramped progress sweep alongside its elapsed counter. That made sense there because its status bar had only a spinner.This status row already has
shimmer_spansdoing exactly that job. A second travelling effect beside it would be noise, not information. So only the half that adds information is carried across.Tests
Three, against
render_status_rowthrough aTestBackend:Worked for 2m 5s · done) is untouched — the live counter must not displace a different branchVerification
Manual TUI check per AGENTS.md, tmux 80x24 — app starts clean, welcome box intact, and the strings
scripts/tui-tests/cases/02_startup.shpins (Coven v,Tips for getting started,What's new,❯) all still render.One limit worth stating: the status row only appears during a real model turn, so I could not observe the live counter in tmux without spending a turn. The three unit tests render that row directly and are the actual coverage for it.