Commit Graph

2 Commits

Author SHA1 Message Date
Edward Langley fc059c7ce1 fix: mode_style matches AppMode exhaustively (improvise-zx8t)
The repo map promises of `AppMode` that "add a variant and the compiler names
every one you must fill in". That was true of the five enum methods and false
of `src/draw.rs::mode_style`, which swept eleven variants into a `_ =>`
wildcard — so `SavePrompt` took `ExportPrompt`'s DarkGray by accident rather
than by decision, and the next person adding a variant would have trusted the
sentence.

Of the ticket's two options, the first: `mode_style` is now exhaustive and
stays in `draw.rs`, because `Style` is a ratatui type (gotcha 26). The second —
a semantic colour method on `AppMode` in `improvise-protocol`, the
`AxisColor`/`MinibufColor` shape — is NOT taken here, and deliberately: the
ticket says to decide it together with improvise-k099, which asks the same
question of `hint_text`/`label` and is not in this unit. The repo map's promise
needed exhaustiveness; the semantic enum is a separate, larger answer and stays
open.

No colour changes. The fourteen default-chrome variants are spelled out with
the DarkGray they already had, so this is the wildcard becoming a list.

The guard is the compiler, not a test — a test enumerating today's variants
would not fail when a fifteenth is added. Verified by deleting the
`AppMode::Help` arm:

    error[E0004]: non-exhaustive patterns: `&AppMode::Help` not covered

Also removes the doc comment calling the wildcard "a known defect", which this
commit makes false, and updates `context/code/tui.md`, which said the same.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FC2jVn8Au7E9JPkw6bwXXH
2026-09-20 20:40:28 -07:00
Edward Langley 5d0fb5c2d4 docs(tui): the root crate's arguments, moved to context/ prose
improvise-9c8c. The two files this unit owns, written before any comment is
capped so nothing is capped without somewhere to land.

context/code/tui.md carries the grid widget's module doc whole (it is the
best-written statement of the no-&Model/no-&View rule in the repo, better
than the repo map's own), the two semantic-to-terminal colour mappings and
why mode_style is NOT that shape (improvise-zx8t), the wizard's
set_bottom_line and bytes-vs-cells arguments, and the per-frame cache
building that is the temporary half of improvise-35e.

context/test-evidence/tui.md carries the injected-fault records, keyed by
test name per design-principles §7 — including THE_MEMBERSHIP_CORRECT_SPANS,
whose assert_ne! is a live tripwire that starts failing the day
improvise-gd83 is fixed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-20 09:51:27 -07:00