Skip to content

feat(tui): rail column model, brand QQ header, right-aligned tool metrics, padding rows (U6) - #111

Merged
lg2m merged 3 commits into
feat/eng-851-u5-ink-defaultfrom
feat/eng-855-u6-turn-geometry
Sep 22, 2026
Merged

lg2m merged 3 commits into
feat/eng-851-u5-ink-defaultfrom
feat/eng-855-u6-turn-geometry

Conversation

@lg2m

@lg2m lg2m commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

U6: rail column model, brand QQ header, right-aligned tool metrics, padding rows

Spec: docs/plans/tui-redesign.md S1, S2, S7 (summary rows); decisions D2, D8, D9 Linear: ENG-855 (parent ENG-843)

Stacked on #110 (U5). Review the top two commits only until #110 merges.

What changed

  • Column model (view/tools.rs tool_summary_line, tool_fold_line): glyph in the rail (cell 1), verb at column 3 — the prose column — subject fills the middle, metric / state / duration right-aligned to the content width at every width. Narrow rows degrade duration → metric → subject elision (min 6 cells). The cursor ▶ takes cell 0 so a selected row keeps its columns. Width is measured once per row from the parts; the only new allocation is the padding string.
  • Turn headers (view/transcript.rs): QQ is brand bold (the one warm mark per turn); YOU stays accent bold on the ▌ rail, which every prompt row carries. complete is never shown (now pinned by a test).
  • Top padding: VirtualBody::pad_top() inserts one blank row before the first transcript row; it scrolls away and does not disturb tail anchoring.
  • Composer padding (view/layout.rs): one blank row under the composer at ≥ 20 terminal rows (COMPOSER_PADDING_MIN_HEIGHT, composer_padding_rows, fixed_chrome_rows(height)); Compact composer cap stays 4 at 80×24.
  • Third commit: gate the PanePref re-export to test/bench builds; it was an unused-import warning in a plain cargo build on main.

Before / after (golden-path-80x24)

before                                                                   after
   ● Read   crates/qq-client/src/sse.rs            412 lines  0.0s         ● Read   crates/qq-client/src/sse.rs                 412 lines  0.0s
   ● Run    cargo test -p qq-client reconnect      exit 101  0.0s          ● Run    cargo test -p qq-client reconnect            exit 101  0.0s

Goldens — all 40 moved, every hunk inspected

Family Hunk categories
golden-path, approval, tools-folded top padding, composer padding, verb column shift, right-aligned metric
tools-expanded above; 80×24 / 120×40 lose one detail row to the padding (tail-anchored); inspector rows shift the verb column too
markdown-gallery, steering, reasoning, sessions top padding + composer padding only

How verified

  • cargo test --workspace 1689 passed; qq-tui 289 → 298 lib, 6 golden. fmt, clippy -D warnings, plain cargo build --workspace warning-free.
  • New tests: multi-row prompt rail; QQ brand / YOU accent / complete never shown; verb column == prose column with glyph at 1; metric right-aligned at 60 and 100 (+ running duration at 72); narrow degradation at 40/28/20; selected row keeps columns; top padding present, absent when scrolled, scrolls back; streaming tail stays anchored with padding; composer padding at 24 vs 19 with Compact cap still 4.
  • One test slice adjusted in goldens.rs (rows[1..len-3], matching the sibling test that already used len-3); no lib expectation changed.

Measurements (target/qq-perf/tui-U6-2026-09-21/, core 2)

Gate Before After Budget
steady_state_frame 21.9 µs 21.8 ±5 %
streaming_focused 34.0 34.2 ±5 %
streaming_run_on_32kb 450.2 439.3 ±5 %
golden_path 38.8 39.4 ±5 %
keystroke 26.6 26.4 ±5 %
tool_calls_32 rows / folded / expanded 23.3 / 12.6 / 52.0 24.1 / 12.5 / 53.2 ±5 %
compact_80x24 19.7 19.5 ±5 %

The first cut read run_on at +7–12 % over three interleaved A/B pairs; a no-pad_top binary showed the insert itself was free and the delta was codegen perturbation of body(). #[inline(never)] on pad_top brought it to baseline (same pattern as the U4 receipt).

Docs

  • docs/design/transcript.md new §§ Turn Headers, Column Model, Tool Rows; § Spacing amended. docs/design/layout.md § Geometry: padding rule and chrome math. Ledger receipt.

Compatibility

  • PROTOCOL / DESCRIPTOR / schema: unchanged.

…rics, padding rows (U6)

Slice U6 of docs/plans/tui-redesign.md (ENG-855).

Tool glyphs move into the rail (cells 1-2) so verbs start at column 3 with
prose; the fold row's `▸` and the cursor's `▶` follow (the cursor takes the
margin cell so a selected row no longer shifts). Metric, state, and duration
are right-aligned to the content width at every width; a row too narrow for
a six-cell subject drops the duration, then the metric, before eliding the
subject. `QQ` renders in `brand` bold. One blank top padding row is a body
row (`VirtualBody::pad_top`, `#[inline(never)]` after it read +7 % on
`streaming_run_on_32kb` inlined); one composer padding row at >= 20 rows
(`layout::composer_padding_rows`), with `fixed_chrome_rows(height)` feeding
the composer cap so Compact keeps 4 rows at 80x24.

Tests: 9 new (289 -> 298 lib). No lib expectation changed. One golden-test
slice adjusted: `expanded_tool_detail_reads_the_same_inline_and_in_the_inspector`
took body rows as `rows[1..len-2]`; the composer padding row makes the chrome
three rows, so it is `len-3` (the sibling test already used `len-3`).

Goldens: all 40 moved. Every family gains the top and composer padding rows;
golden-path, approval, and tools-* also show the verb column shift and
right-aligned metrics (tools-expanded-80/120 lose one detail row to the
padding). markdown-gallery, steering, reasoning, sessions: padding rows only.

Bench (core 2, quiet host, before -> after): steady 21.9 -> 21.8 us,
run_on_32kb 450.2 -> 439.3, golden_path 38.8 -> 39.4, keystroke 26.6 -> 26.4,
tool_calls_32 rows/folded/expanded 23.3/12.6/52.0 -> 24.1/12.5/53.2,
compact 19.7 -> 19.5. All within 5 %.
Only tests and bench_support name PanePref through view::; a plain
library build warned about the unused import.
@lg2m
lg2m added this pull request to stack #112 September 21, 2026 22:24
@lg2m
lg2m merged commit f34073d into main Sep 22, 2026
4 checks passed
@lg2m
lg2m deleted the feat/eng-855-u6-turn-geometry branch September 22, 2026 02:28
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