Repository navigation
feat(cli): TUI block visual grammar, context statusline, and activity strip #1053
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
The interactive TUI is hard to scan during agent work:
- Tool cards are label-heavy and often two lines, so long turns waste vertical space.
- Thinking chrome is mixed Chinese while structural labels elsewhere are English.
- Message roles add noisy
User/makarows. - The status line only shows opaque remaining context when present (
ctx 92k), not total window size or usage ratio — and remaining is often missing. - There is no bottom activity strip for the in-flight turn (Grok-style
Working…+ elapsed). Busy state today only affects the terminal title spinner.
Desired outcome
A locked, Grok-inspired but Maka-native transcript and chrome grammar that stays on the existing pi-tui terminal scrollback model (no alt-screen pager rewrite):
- Compact, single-line tool rows with status discs and English thinking chrome.
- Message chrome without speaker labels; spacing separates human-facing text from agent work.
- Status line shows
ctx used/window pct%when facts exist. - Activity strip above the editor shows per-turn progress:
Working… 12s.
Locked visual contracts
Tools (collapsed always 1 line)
● Name primary · duration · summary ›
Examples:
● Read package.json · 0s · 3 lines ›
● Bash $ npm test · 5s · (31 lines) ok ›
● Bash $ npm test · running 12s ›
● Edit src/cli.ts · 0s · +12 −3 ›
- Disc: muted
●= done (nodoneword); accent●= running; red●= error. - No diamond (
◆) — not Grok brand language. - Duration: seconds only. Prefer integer seconds on the activity strip; tool-row duration also in s (no millisecond unit).
- Live output and stop hints only when expanded (Ctrl+O). Collapse never adds a second live line (avoids height jitter).
- Expanded header uses the same
●grammar; body indented. - Expand affordance: dim trailing
›when expandable. Shortcuts taught in welcome/help only (not on every row).
Thinking
- English only:
Thinking…/Thinking ›(no思考, no per-row Ctrl+T teaching text). - No left glyph/prefix.
- Body only when expanded (Ctrl+T).
Messages
- User: ASCII
>prefix + body — noUserlabel. - Assistant: bare default text — no
makalabel. - Chosen for weak-terminal / native feel (no full-width user background block in v1).
Spacing
- Thinking + tools: 0 blank lines between them (agent-work stack).
- Vertical gap around user prompts and assistant prose (human-facing boundaries).
Statusline (session chrome)
Show context as used / window · percent, not remaining-only:
ctx 52k/200k 26%
- Window from model metadata / connection override.
- Used from latest usage: prefer
window - contextRemainingwhen remaining exists; else lasttoken_usageinput/total. - Omit the whole
ctxsegment until enough facts exist. - Keep cost/cache/model/mode/cwd as today unless they must yield width.
Activity strip (per-turn chrome)
Sits between transcript and editor (not inside the statusline).
While a turn is running:
Working… 12s
- English
Working…(ellipsis character fine). - Elapsed in integer seconds only (
12s, not12.4s, not1200ms). - No current-tool summary on this line (duplicates the tool stack above).
- Idle: reserve one blank row so chrome height does not jump.
- Cancel remains existing keys (Ctrl+C / Esc); no required
[stop]chrome in v1.
Explicit non-goals
- No
◆diamond, no alt-screen / in-app pager rewrite, no multi-theme system. - No CLI i18n in this epic (desktop locale is feat(desktop): make UI language selection coherent and complete #1052; CLI is a separate concern).
- No wholesale welcome / rewind Chinese → English cleanup required here (optional follow-up).
- Activity strip does not re-list the current tool.
Delivery seams
- Semantic color slots in
packages/clitui-ansi(foundation; minimal behavior change). - Tool + Thinking one-line grammar (compact + expanded headers).
- Message chrome + spacing (
>user, bare assistant, gap policy). - Statusline
ctx used/window pct%wiring + render tests. - Activity strip
Working… Ns(integer seconds) + idle reserved row + layout chrome height.
Each seam should be independently reviewable and revertable.
Implementation notes (non-binding)
- Primary surfaces:
packages/cli/src/tui-ansi.ts,pi-transcript*.ts,pi-tui-layout.ts,pi-tui-runner.ts. - Layout today is transcript → editor → statusline; insert activity above the editor and include it in
chromeRows. busy/turnRunningalready exist in the runner; title spinner can remain; activity strip is the in-viewport signal.- Prefer pure render helpers + unit tests for string contracts before broad runner tests.
Alternatives considered
- Port Grok’s diamond + fullscreen pager — rejected (brand + architecture).
- Remaining-only
ctx— rejected (no total/ratio). - Always two-line tools for live tails — rejected (settle height jitter); expand for detail.
- Activity line with tool summary / fractional seconds — rejected (duplicate + noise).
References
- Product direction shaped against Grok Build TUI (scan rhythm, activity strip, context used/window), adapted to Maka brand (logo blue) and pi-tui scrollback.
- Related: feat(desktop): make UI language selection coherent and complete #1052 (desktop locale; CLI out of scope there).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
feat(cli): add muted color slot and disc primitive for TUI grammar (#…
feat(cli): one-line disc grammar for tool cards and thinking chrome
feat(cli): one-line disc grammar for tool cards and thinking chrome (#…
feat(cli): quote-prefix user messages, bare assistant text, stacked s…
Astro-Han commentedon Jul 16, 2026
All five seams have landed on
main:mutedcolor slot +disc(tone)primitive>prefix for user messages, bare assistant text, stacked spacingctx used/window pct%Working… Ns+ idle reserved rowClosing as completed.
fix(cli): statusline density, color fallback, and activity-strip spac…