fix: grow the hint panel for long prose hints

A long prose hint (insert field-value hints, the parse.usage.*
synopses) wrapped but was clipped by the fixed one-row Hint panel,
hiding the most useful tail. The candidate list already scrolled
horizontally, so only prose was affected.

Pre-wrap the prose body and size the Hint panel to the wrapped line
count: one row by default, growing to a 3-row cap and reclaiming the
space when short, with an ellipsis backstop on the last row. Also
shorten the 299-char create-table usage synopsis to a terse one-liner
(the full grammar remains under `help`). ADR-0022 Amendment 5.
This commit is contained in:
claude@clouddev1
2026-05-30 09:02:12 +00:00
parent 5ea69dbc08
commit f7ca288fe1
10 changed files with 259 additions and 63 deletions
@@ -642,6 +642,50 @@ example), `advanced_double_precision_classified_as_type`,
extended theme mapping/contrast tests. Text snapshots are colour-blind
(`render_to_string` strips style), so none churned.
## Amendment 5 — Hint panel grows for long prose hints (2026-05-29)
§6 specified a single-row hint panel. A long **prose** hint
(field-value hints on `insert`, the `parse.usage.*` synopses) simply
didn't fit: the renderer wrapped it but the fixed one-row panel
clipped everything past the first line, hiding the most useful tail
(issue #12). The candidate-list path was already safe — it scrolls
horizontally with `<` / `>` markers (Amendment 2's deferred *two-line
candidate box* remains deferred; this amendment does **not** touch
candidate rendering).
**Change:**
1. **Dynamic height.** `resolve_hint_lines` pre-wraps the prose body
to the panel's inner width and `render_right_column` sizes the
Hint panel to the line count — one content row by default, growing
to `MAX_HINT_ROWS` (3), and reclaiming the space when the hint is
short or empty. The candidate list stays one row.
2. **Ellipsis backstop.** `clamp_wrapped` caps the wrap at
`MAX_HINT_ROWS`; if the hint needs more, the last visible row ends
with `…` so overflow is signalled, not silently dropped. (A hint
long enough to ellipsize on a narrow terminal fits in full on a
wide one.)
3. **Shorter `create table` synopsis.** `parse.usage.sql_create_table`
was a 299-char "instruction manual" — by far the longest hint
string (next was 115). It is now a terse one-liner
(`create table [if not exists] <Name> (<col> <type> [constraints],
...)`); the exhaustive column- and table-level grammar still lives
in `help.ddl.sql_create_table`, reachable via `help`. The
`insert.form_b_*` notes (the other long strings) render in the
scrollable Output panel, not the Hint panel, so they were left
alone.
**Why 3 rows:** the panel is usually wide (most hints fit one or two
rows), and capping at three keeps the Output panel usable; the value
can be revisited if hints routinely need more.
**Coverage:** `long_prose_hint_shows_tail_across_multiple_rows`,
`short_hint_keeps_panel_at_one_content_row` (reclaim),
`long_hint_grows_panel_but_caps_at_max_rows`,
`clamp_wrapped_truncates_with_ellipsis_past_max`, and six re-baselined
full-screen snapshots (the empty-state placeholder and the `insert`
usage hint now wrap to their full text instead of being clipped).
## Out of scope
Deliberately deferred to keep this ADR shippable as a single