Skip to content

feat(tui): show elapsed time while a turn is still running - #184

Merged
BunsDev merged 1 commit into
mainfrom
feat/live-turn-elapsed
Sep 16, 2026
Merged

BunsDev merged 1 commit into
mainfrom
feat/live-turn-elapsed

Conversation

@BunsDev

@BunsDev BunsDev commented Sep 16, 2026

Copy link
Copy Markdown
Member

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?

⠋ Generating… · 12s

The number already existed

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. The duration was shown exactly when it had stopped mattering.

format_elapsed_ms becomes pub(crate), matching format_duration_secs directly 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 coven draws 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_spans doing 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_row through a TestBackend:

  • a running turn reports its elapsed time, and the existing status label survives
  • no separator is drawn when no turn is timed
  • the idle branch's completed-turn summary (Worked for 2m 5s · done) is untouched — the live counter must not displace a different branch

Verification

cd src-rust
cargo fmt --all -- --check                               # clean
cargo clippy --workspace --all-targets -- -D warnings    # clean
cargo test --workspace                                   # 32 suites, 0 failures

Manual TUI check per AGENTS.md, tmux 80x24 — app starts clean, welcome box intact, and the strings scripts/tui-tests/cases/02_startup.sh pins (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.

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>
@vercel

vercel Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 16, 2026 1:10pm UTC

Request Review

@BunsDev
BunsDev merged commit 31cecba into main Sep 16, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — d7619b65 Deployed Sep 16, 2026 by vercel[bot]
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.

1 participant