Skip to content

feat(tui): code panel with heavy gutter, wrap marks, label and padding rows (U3) - #100

Merged
lg2m merged 1 commit into
feat/eng-848-u2-inline-stylingfrom
feat/eng-849-u3-code-panel
Sep 21, 2026
Merged

lg2m merged 1 commit into
feat/eng-848-u2-inline-stylingfrom
feat/eng-849-u3-code-panel

Conversation

@lg2m

@lg2m lg2m commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

U3: code panel with heavy gutter, wrap marks, label and padding rows

Spec: docs/plans/tui-redesign.md#s4-code-panel Linear: ENG-849 (parent ENG-843)

Stacked on #102 (U2). Review the top commit only until #102 merges.

What changed (crates/qq-tui/src/view/markdown.rs)

  • Gutter ┃ in border on surface (was │ in dimmed accent), then one padding cell, content, and surface padding to the content width.
  • Wrapped continuation rows show ↪ in the gutter cell.
  • Top padding row carries the language label right-aligned in muted (rust), blank when untagged. Bottom padding row always present. Both rows keep the gutter so the rail is continuous.
  • diff fences: add/remove tints now win over the surface inside the panel. Previously surface(diff_line_style(..)) overwrote the diff background, so the tint was lost inside panels; two existing test expectations updated to the spec'd behavior.
  • Streaming: the label row appears when the fence opens and the bottom row is present while streaming, so a panel does not jump when the fence closes. Streaming and completed rows are identical for the same source prefix.
  • Style::dim builder removed: the old gutter was its only caller and -D warnings flagged it. The DIM bit and write_line handling remain; re-adding is four lines.

Before / after (markdown-gallery-120x40)

before                              after
   │ rust                              ┃                        rust
   │ fn main() {                       ┃  fn main() {
   │     let x = 1;                    ┃      let x = 1;
   │ }                                 ┃  }
                                       ┃

How verified

  • cargo test -p qq-tui --all-features 274 lib + 5 golden; fmt; clippy -D warnings.
  • New: code_panels_carry_a_labelled_top_row_and_a_blank_bottom_row, wrapped_code_rows_show_the_wrap_mark_in_the_gutter, diff_tints_win_over_the_surface_inside_the_panel, streaming_and_completed_panels_render_the_same_rows (open fence at 3 widths + a just-opened fence). The 16-source settled-prefix corpus passes unchanged.
  • Goldens moved: the five markdown-gallery-* only; every hunk is gutter glyph, padding cell, label position, or the new bottom row (80×24 and 120×40 also scroll one row because the panel is one row taller). tools-expanded-* unchanged (tool output panels are U7).

Measurements (target/qq-perf/tui-U3-2026-09-20/after*.txt, pinned core)

Gate U2 After (worst of 2) Budget
steady_state_frame 21.5 µs 21.8 ±5 %
streaming_focused 33.9 34.4 ±5 %
streaming_run_on_32kb 433.6 449.7 ±5 %
golden_path 39.0 39.3 ±5 %
keystroke 26.6 26.9 ±5 %

Docs

  • docs/design/transcript.md § Code Blocks rewritten to the shipped panel. Ledger receipt.

Compatibility

  • PROTOCOL / DESCRIPTOR / schema: unchanged.

…g rows (U3)

Slice U3 of docs/plans/tui-redesign.md (ENG-849), stacked on U2.

Fenced code panels now carry a `┃ ` rail in `border` on the surface, one
padding cell, and surface padding to the content width; rows a source line
wrapped onto show `↪` in the rail. The top padding row right-aligns the
language label in `muted` (blank when untagged) and a blank bottom padding
row is always present, so a streaming panel has the same rows as the
finished one. Diff add/remove tints keep their own background inside the
panel; only untinted spans take the surface. `Style::dim` is removed (the
old gutter was its only caller).

Verified: fmt, clippy -D warnings (all targets/features), 274 lib + 5 golden
tests; the five markdown-gallery goldens regenerated and inspected (gutter,
label, padding rows only). Bench on a pinned core within 5 % of U2 on every
gated scene (steady 21.8, focused 34.4, run-on 443.4, golden path 39.3,
keystroke 26.6 µs).
@lg2m
lg2m force-pushed the feat/eng-849-u3-code-panel branch from ab2a187 to 346691b Compare September 21, 2026 07:20
@lg2m
lg2m added this pull request to stack #105 September 21, 2026 19:40
@lg2m
lg2m merged commit 7e49c5b into main Sep 21, 2026
8 checks passed
@lg2m
lg2m deleted the feat/eng-849-u3-code-panel branch September 21, 2026 19:41
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