Skip to content

fix: keep a multi-line item detail's shape on the widget and markdown surfaces - #61

Merged
silversurfer562 merged 3 commits into
mainfrom
claude/attune-forms-types-constructs-2f75b4
Aug 29, 2026
Merged

fix: keep a multi-line item detail's shape on the widget and markdown surfaces#61
silversurfer562 merged 3 commits into
mainfrom
claude/attune-forms-types-constructs-2f75b4

Conversation

@silversurfer562

Copy link
Copy Markdown
Member

A detail carrying more than one line — a diff hunk, a log excerpt — was corrupted on the way out of both rendering surfaces. Found by probing the zero-change triage encoding for hunk review: the round table asserted the encoding works; running it showed what it costs.

Answer layer untouched — no validator, fold, or answer-shape changes.

The two defects

Widget. The detail rendered as an inline <span> inside a flex row with no white-space rule, so HTML folded its newlines and leading indentation into single spaces — a diff arrived as one run-on line, on the rich surface.

Markdown. The detail was interpolated into the item's bullet line, so every line it started with - — every removed line of a diff — parsed as a new bullet, and a suggested suffix landed on the detail's last line instead of the bullet.

- **bound the retry loop** `high` → suggested: `apply`
      @@ -88,7 +88,9 @@ def retry(fn):
      -    while True:
      +    for _ in range(MAX_RETRIES):

The fix

One helper and one CSS rule rather than four per-construct patches:

  • widget._detail_html(text, cls) — inline <span> when single-line, <div class="… ae-detail-block"> when not. Five call sites: triage, assumption_review, both progress renderers, confirm.
  • One CSS_BASE rule.ae-detail-block { flex-basis:100%; white-space:pre-wrap; …monospace; overflow-x:auto; }, plus flex-wrap:wrap on .ae-prog-row / .ae-gate-row.
  • markdown_surface._detail_block / _item_row — a multi-line detail becomes an indented code block under the bullet, suffix left on the bullet. Applied to triage, assumption_review, and confirm consequences.

A single-line detail still renders as the same inline span / inline em-dash it always did — the common case is byte-identical.

Why indented and not fenced

A fence cannot survive the markdown surface: _defuse_fences breaks every three-backtick run in author text so the trailing reply skeleton keeps its boundaries (confirmation pass 2). My first attempt fenced the block and it rendered as visible backtick-plus-zero-width noise. An indented block needs no backticks at all.

For the same reason an author's own ```lang wrapper is now stripped rather than kept — defused, it could only ever render as noise. The answers skeleton is verified to still round-trip: form_to_markdownmarkdown_to_answerscollect_form_response, zero problems.

Theme budget

FORM_THEME_CSS raised 10 KB → 12 KB (chair-ruled 2026-08-28) for the shared rule; a trim to fit under 10 KB was offered and declined. Now 10,263 B, 2,025 B headroom. Recorded in the theme docstring alongside the previous three raises — the cap remains a design decision, not a ratchet.

Also included

docs/reports/roundtable/q-forms-hunk-review-001.md — the round table that surfaced this. 3/3 for build nothing: hunk_review stays consumer-gated, the reuse target is triage (not assumption_review, whose fixed vocabulary is the construct), and the interim costs zero files. The stub carries the zero-change encoding table and three pre-recorded flip conditions.

Verification

  • 824 passing (11 new regression tests, each naming its defect and thread)
  • ruff check + ruff format clean
  • All four constructs' real HTML inspected, not just asserted
  • Both defects are pre-existing and construct-agnostic — any multi-line detail hit them; diffs just made them obvious

🤖 Generated with Claude Code

silversurfer562 and others added 3 commits August 28, 2026 23:21
…s-hunk-review-001)

3/3 for (C): `hunk_review` stays consumer-gated. No seat argued for
building it; none could name a construct-defining validator rule that
`triage` does not already cover.

Two corrections to the chair's held lean, reached independently:

- The reuse target is `triage`, not `assumption_review`. Its vocabulary
  is fixed BECAUSE the vocabulary is the construct (D2-a), so
  accept/edit/reject over hunks matches the answer shape and lies about
  the speech act.
- The interim costs zero files, not three: a verdict-only hunk board is
  expressible in shipped `triage` slots (id / detail / tag /
  dispositions / suggested) with no library change.

Curated stub carries the ruling, the zero-change encoding table, the
needs classified as rendering-vs-answer-shape, and three pre-recorded
flip conditions so the gate stays a decision rather than an indefinite
deferral. Full transcript is machine-local and untracked.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… surfaces

A `detail` carrying more than one line — a diff hunk, a log excerpt —
was corrupted on the way out of both rendering surfaces. Found by
probing the zero-change `triage` encoding for hunk review (round table
q-forms-hunk-review-001): the deliberation asserted the encoding works,
running it showed what it costs.

Widget: the detail rendered as an inline <span> inside a flex row with
no `white-space` rule, so HTML folded its newlines and leading
indentation into single spaces and a diff arrived as one run-on line.
A multi-line detail now renders as an `ae-detail-block` — full-width,
white-space:pre-wrap, monospace — via one shared `_detail_html` helper
and one CSS_BASE rule, fixing `triage`, `assumption_review`, `progress`
and `confirm` together. A single-line detail still renders as the same
inline span it always did, so the common case is byte-identical.

Markdown: the detail was interpolated into the item's bullet line, so
every line it started with `-` — every removed line of a diff — parsed
as a NEW bullet, and a `suggested` suffix landed on the detail's last
line instead of the bullet. A multi-line detail now renders as an
indented code block under the bullet.

The block is INDENTED rather than fenced because a fence cannot survive
this surface: `_defuse_fences` breaks every three-backtick run in author
text so the trailing reply skeleton keeps its boundaries (confirmation
pass 2). For the same reason an author's own ```lang wrapper is stripped
rather than kept — defused, it would render as visible backtick noise.
The answers skeleton is verified to still round-trip through
`markdown_to_answers` -> `collect_form_response`.

Answer layer untouched: no validator, fold, or answer shape changes.

FORM_THEME_CSS budget raised 10 KB -> 12 KB (chair-ruled 2026-08-28)
for the shared rule; a trim to fit under 10 KB was offered and declined.
Now 10,263 B. The ratification is recorded in the theme docstring
alongside the previous three.

11 regression tests added, each naming the defect and its thread.
824 passing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The project formats with black (pinned 24.10.0 in .pre-commit-config),
not `ruff format` — the two disagree on these call wrappings, so CI's
lint job failed on an otherwise-green branch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@silversurfer562
silversurfer562 merged commit d7c3220 into main Aug 29, 2026
7 checks passed
silversurfer562 added a commit that referenced this pull request Aug 29, 2026
…'s missed fourth site (#62)

Retro probe 2026-08-29: the multi-line-detail defect fixed in #61 for triage/assumption_review/confirm was still live in _progress_lines. Both progress row styles now route through _item_row; one regression test. Also records the theme-cap bar (raises buy families, not rules) in the theme docstring. Shipped via the first live consumer run of the hunk-review-as-triage encoding (q-forms-hunk-review-001); both hunks chair-ruled apply. 825 tests passing.
@silversurfer562
silversurfer562 deleted the claude/attune-forms-types-constructs-2f75b4 branch August 29, 2026 11:51
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