Skip to content

feat(tui): one blank row between blocks, numbered lists, hanging indents, quote rails (U1) - #95

Merged
lg2m merged 2 commits into
feat/eng-846-l2-pane-statefrom
feat/eng-847-u1-markdown-rhythm
Sep 21, 2026
Merged

lg2m merged 2 commits into
feat/eng-846-l2-pane-statefrom
feat/eng-847-u1-markdown-rhythm

Conversation

@lg2m

@lg2m lg2m commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

U1: one blank row between blocks, numbered lists, hanging indents, quote rails

Spec: docs/plans/tui-redesign.md#s3-markdown-blocks-markdownrs Linear: ENG-847 (parent ENG-843)

Stacked on #94 (L2). Review the top commit only until #94 merges.

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

  • Exactly one blank row between blocks: paragraph, heading, list, quote, code panel, table, rule, footnote definition. List items and table rows stay tight. No leading/trailing gap (turn spacing owns that).
  • Ordered lists keep their numbers, right-aligned to the widest the list reaches ( 9. / 10.); a one-pass item count per list sizes the column before items arrive.
  • Bullets • / nested ◦ in accent; tasks ☐ / ☑ in place of the bullet.
  • Hanging indents: wrapped list rows align under the item text. Each laid-out line carries a Hang { width, rail }; the body wraps at width − hang and the prefix repeats.
  • Quotes carry ▎ in muted on every row; body muted italic; nested quotes stack rails.
  • Rules are ─ across the content width in border (was 12 literal dashes).
  • Headings differ: H1 text bold + ─ underline of title width; H2 accent bold; H3–H6 text bold.
  • Prose rows no longer end in the whitespace a word-wrap broke on.
  • Streaming invariant kept: a source ending at a block boundary keeps its trailing gap so settled_prefix_end concatenation equals the whole layout; the existing 11-source streaming corpus passes unchanged.
  • Not in scope (later slices): inline code / link colors (U2), code panel padding and label (U3).

Before / after (markdown-gallery-80x24, excerpt)

before                                      after
   Level three heading                         Level three heading
   - First numbered item
   - Second numbered item that is delib...     1. First numbered item
   row at this width                           2. Second numbered item that is deliber...
   - Third numbered item                          row at this width
     - nested bullet under three               3. Third numbered item
   - A bullet item that is also delibera...      ◦ nested bullet under three
   physical row here
   - Short bullet                              • A bullet item that is also deliberat...
   - [ ] open task                               physical row here
   - [x] done task                             • Short bullet
   > A quote long enough to wrap onto a...     ☐ open task
   rail repeats.                               ☑ done task

                                               ▎ A quote long enough to wrap onto a ...
                                               ▎ repeats.

How verified

  • cargo test --workspace green (qq-tui 265 lib + 5 goldens). Two unrelated qq-core session tests panicked once in the full run and pass in isolation and in a clean -p qq-core run (674/674); not touched by this PR.
  • fmt / clippy -D warnings
  • 7 new tests in markdown/tests.rs: ordered_lists_keep_their_numbers_right_aligned, wrapped_list_items_hang_under_their_text, task_items_use_box_glyphs_without_a_bullet, quotes_carry_the_rail_on_every_wrapped_row, rules_span_the_content_width_in_the_border_style, heading_levels_differ_and_h1_is_underlined, exactly_one_blank_row_separates_every_block_in_the_gallery (also checks the streaming split).
  • Goldens moved: the five markdown-gallery-* only.

Measurements

target/qq-perf/tui-U1-2026-09-20/after.txt vs L1:

Gate Before (L1) After Budget
steady_state_frame 22.2 µs 21.9 µs ±5 %
streaming_focused 36.3 35.4 ±5 %
streaming_run_on_32kb 442 442 ±5 %
golden_path 38.0 39.4 ±5 %
resize_horizontal 33.2 31.6 ±5 %

Docs

  • docs/design/transcript.md § Spacing amended; new § Markdown Blocks. Ledger receipt.

Compatibility

  • PROTOCOL / DESCRIPTOR / schema: unchanged.

…nts, quote rails (U1)

Slice U1 of docs/plans/tui-redesign.md (ENG-847), stacked on L1.

Markdown blocks are now separated by exactly one blank row; ordered lists
keep their numbers right-aligned to the widest in the list; bullets are
• and ◦, tasks ☐ and ☑; wrapped list rows hang under the item text; the
▎ quote rail repeats on every row; rules span the content width in the
border style; H1 is text bold with an underline, H2 accent bold, H3+ text
bold. Prose rows no longer end in the whitespace a wrap broke on.

A source that ends at a block boundary keeps its trailing gap so the
streaming settled prefix still concatenates to the whole message's rows;
the existing streaming corpus passes unchanged.

Seven new markdown tests; the five markdown-gallery goldens move with the
before/after in this diff. Render bench flat against L1.
@lg2m
lg2m added this pull request to stack #96 September 21, 2026 03:55
@lg2m
lg2m merged commit 38a47d8 into main Sep 21, 2026
4 checks passed
@lg2m
lg2m deleted the feat/eng-847-u1-markdown-rhythm branch September 21, 2026 03:57
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