Repository navigation
feat(tui): tool detail, live tails, errors and diffs render in the code panel (U7) - #115
Merged
Merged
Conversation
…de panel (U7) Slice U7 of docs/plans/tui-redesign.md (ENG-856), stacked on U6. WIP checkpoint: code, tests, and goldens complete (305 lib + 6 golden green); design doc and ledger receipt still to write.
…gin as indent (U7) Slice U7 of docs/plans/tui-redesign.md (ENG-856), stacked on U6. Review pass over the panel cut: PanelStyles reads the palette once per panel rather than per row; tool panels put their three-cell margin in Line::indent instead of inserting a span into every row (panel_rows_at); the rail glyph and padding cell are one span. wrap::indent_lines dropped a row's own indent when prefixing, which the inspector surfaced; fixed with a regression test. Tests that indexed the rail as spans[1] now use spans[0]. Design doc: transcript.md gains § Tool Detail and amends § Diffs and § Streamed Tool Output. Ledger row and receipt. Known: tool_calls_32_expanded is +48 % (52.6 -> 78.2 us best-of-3 on a pinned core). Panel rows cost about twice a plain row and 32 expanded panels rebuild every frame. The next step is caching laid-out panel rows for settled calls beside tool_rows; recorded in the receipt.
lg2m
marked this pull request as ready for review
September 22, 2026 02:02
tool_calls_32_expanded read 77.6 us against a 53.9 us parent: a panel row costs about twice a plain row and every expanded call rebuilt its panel each frame, while completed message bodies were already cached. ToolRow now carries the laid-out panel for one width, invalidated with the row's ToolRowKey (arguments, result, diff, state) or when the width changes. The timing line is still built per frame since it carries the live clock. Best-of-3 on a pinned core: 54.3 us, parity with the parent. Regression test covers reuse across frames, re-layout on a new width, and returning to the first width.
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.
U7: tool detail, live tails, errors and diffs render in the code panel
Spec: docs/plans/tui-redesign.md#s7-tool-rows-and-detail (detail bullets) Linear: ENG-856 (parent ENG-843)
Stacked on #111 (U6). Review the top three commits only until #111 merges.
What changed
┃rail inborderonsurface, padding cell, character-wrapped content with↪on continuation rows, blank surface rows above and below. Output is visibly output.markdown::panel_rows/panel_rows_atserve fenced code and tool detail; tool panels sit at the content column with their margin carried inLine::indent(no per-row span).mutedabove the panel. Error text keeps theerrorforeground on the surface. Diff+/-rows keep line numbers and add/remove backgrounds inside the panel (a span's own background wins over the surface). Live output panels have their padding rows from the first frame so nothing jumps on completion. No label (the summary row already names the tool).TOOL_PANEL_PADDING_ROWS(2). Approval block untouched.PanelStylesreads the theme once per panel instead of once per row;wrap::indent_linesdropped a row's ownindentwhen prefixing (latent, surfaced by the inspector) — fixed with a regression test.Before / after (
tools-expanded-120x40)Goldens
tools-expanded-*(all five): gutter/tint columns and +2 rows per expanded call; 80×24 and 120×40 are tail-anchored so earlier rows scroll off.approval-*and every other family.How verified
cargo test -p qq-tui --all-features306 lib + 6 golden; fmt; clippy-D warnings.↪on wrapped rows; budget = N + 2 against the constants;indent_lineskeeps a row's margin. The L3 same-content (inline vs inspector) golden test passes.Measurements (
target/qq-perf/tui-U7-2026-09-21/after-cached.txt, core 5; host shared with another lane's training job, load 4–10)Why the third commit exists. The uncached panels measured +44 % on the expanded scene, reproducible across 8 paired runs: a panel row costs ~2× a plain row (extra span, per-span surface merge, fill), and 32 expanded calls rebuilt every panel each frame while completed message bodies were already cached.
ToolRownow carries the laid-out panel for one width (RefCell<Option<(width, Vec<Line>)>>), invalidated with the row'sToolRowKey(arguments, result, diff, state) or on a width change; the timing line is still built per frame since it carries the live clock. Test: reuse across frames, re-layout at a new width, back to the first width. Content budgets were not trimmed.compact_80x24andwide_160x48read high in the final run (28.9 / 46.1) at load 10.8; earlier runs in the same session had them at 19.7 / 38.9. Rerun on a quiet host before merging if you want a clean receipt for those two.Docs
docs/design/transcript.mdnew § Tool Detail; § Diffs and § Streamed Tool Output amended. Ledger receipt records the open gate.Compatibility