Skip to content

feat(tui): turn elapsed in FaceTicker + done-in sys line on turn end (#8541)#13105

Merged
OutThisLife merged 4 commits into
mainfrom
bb/tui-elapsed-lastmsg-8541
Apr 20, 2026
Merged

feat(tui): turn elapsed in FaceTicker + done-in sys line on turn end (#8541)#13105
OutThisLife merged 4 commits into
mainfrom
bb/tui-elapsed-lastmsg-8541

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Fixes #8541.

Summary

Adds a lightweight timer next to the existing session duration: {sinceLastMsg}/{sinceSession} (e.g. 12s/3m 45s). Renders in the status bar's existing │ 3m 45s slot, so no new chrome. When no user message has been submitted yet in this session, just the total renders (unchanged behavior).

How it wires

  • useMainApp holds lastUserAt: null | number, threaded into appStatus.
  • useSubmission.send stamps setLastUserAt(Date.now()) alongside setLastUserMsg.
  • useSessionLifecycle.resetSession / resetVisibleHistory null it; /branch slash nulls it on fork (/tools enable goes through resetVisibleHistory → free).
  • SessionDuration component extended to optionally render the leading segment.

Test plan

  • npm run type-check — clean
  • npx vitest run — 15/15 files, 98/98 tests pass
  • Manual: hermes --tui, send a message, wait; status bar shows 12s/42s etc; second submit resets the left counter; /new resets both; narrow terminals truncate cleanly (existing wrap="truncate-end" on the left cluster).

…8541)

StatusRule now renders `{sinceLastMsg}/{sinceSession}` (e.g. `12s/3m 45s`)
when a user has submitted in the current session; falls back to the total
alone otherwise. Wires `lastUserAt` through the state/session lifecycle:
- useSubmission stamps `setLastUserAt(Date.now())` on send
- useSessionLifecycle nulls it in reset/resetVisibleHistory
- /branch slash nulls it on fork
…edge

Status bar ticker was too hot in peripheral vision. The moment the elapsed
value matters is when the prompt returns — so surface it there. Dim
`fmtDuration` next to the GoodVibesHeart, idle-only (hidden while busy),
so quick turns and active streaming stay quiet.
@OutThisLife

Copy link
Copy Markdown
Collaborator Author

Moved the display: the {lastmsg}/{total} in the status bar was too noisy. New placement is a dim 12s at the prompt's right edge, next to the GoodVibesHeart. Rendered only when !busy && lastUserAt — gone during streaming, gone before the first submit. The moment the value matters is when the prompt returns, so it lives there.

  • StatusRule is unchanged (back to bare session total).
  • New IdleSinceLastMsg component in appChrome.tsx.
  • All the state plumbing (lastUserAt state in useMainApp, stamping in useSubmission, reset in useSessionLifecycle + /branch) is unchanged.

Latest commit: 9910681

Drops `lastUserAt` plumbing and the right-edge idle ticker. Matches the
claude-code / opencode convention: elapsed rides with the busy indicator
(spinner verb), nothing at idle.

- `turnStartedAt` driven by a useEffect on `ui.busy` — stamps on rising
  edge, clears on falling edge. Covers agent turns and !shell alike.
- FaceTicker renders ` · {fmtDuration}` while busy; 1 s clock for the
  counter, existing 2500 ms cycle for face/verb rotation.
- On busy → idle, if the block ran ≥ 1 s, emit a one-shot
  `done in {fmtDuration}` sys line (≡ claude-code's `thought for Ns`).
@OutThisLife OutThisLife changed the title feat(tui): show elapsed-since-last-user-message in status bar (#8541) feat(tui): turn elapsed in FaceTicker + done-in sys line on turn end (#8541) Apr 20, 2026
@OutThisLife

Copy link
Copy Markdown
Collaborator Author

Iteration: pivoted away from the persistent idle-edge counter. Neither ~/claude-code nor opencode expose one (both fold elapsed into the busy indicator and drop it at idle). This PR now matches that convention.

  • Busy: FaceTicker renders · {fmtDuration} next to the kawaii face+verb. 1 s clock for the counter, existing 2500 ms for face/verb rotation. Reads e.g. >﹏< reasoning… · 14s.
  • Turn end: on busy → idle, if the block ran ≥ 1 s, emit a one-shot done in Xs sys line in the transcript (≡ claude-code's thought for Ns, generalized). Covers agent turns and !shell alike.
  • Idle: nothing.

Implementation: turnStartedAt is one useState driven by a useEffect on ui.busy — stamps on rising edge, clears + emits on falling edge. Dropped the earlier lastUserAt plumbing (setLastUserAt through useSubmission / useSessionLifecycle / slash session ctx) and the IdleSinceLastMsg component. Net −50 / +43.

Latest: 2de1aad

The transcript line was noisy. Keep the one thing the issue really needs:
live elapsed next to the busy verb.
@OutThisLife OutThisLife merged commit ab37132 into main Apr 20, 2026
@OutThisLife OutThisLife deleted the bb/tui-elapsed-lastmsg-8541 branch April 20, 2026 16:40
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
…d-lastmsg-8541

feat(tui): turn elapsed in FaceTicker + done-in sys line on turn end (NousResearch#8541)
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
…d-lastmsg-8541

feat(tui): turn elapsed in FaceTicker + done-in sys line on turn end (NousResearch#8541)
Luminet2023 pushed a commit to Luminet2023/hermes-agent that referenced this pull request May 1, 2026
…d-lastmsg-8541

feat(tui): turn elapsed in FaceTicker + done-in sys line on turn end (NousResearch#8541)
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…d-lastmsg-8541

feat(tui): turn elapsed in FaceTicker + done-in sys line on turn end (NousResearch#8541)
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…d-lastmsg-8541

feat(tui): turn elapsed in FaceTicker + done-in sys line on turn end (NousResearch#8541)
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…d-lastmsg-8541

feat(tui): turn elapsed in FaceTicker + done-in sys line on turn end (NousResearch#8541)
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.

Feature: show elapsed time since last user message in CLI prompt

1 participant