Commit b5e851c
committed
refactor(tui): migrate settings screen to app-shell
Replace the hand-rolled root container, single overloaded status
line, and manual keypress listener with appShell() + panel() +
Keymap, completing the pattern already adopted by about and history
on this branch (and dashboard, file-picker, workflow, and the
results screens before it).
Settings is the most involved of the three TR.B6 migrations: inline
text/dropdown edit renderables created per-edit, a two-press reset
confirm, section-header skip-navigation, and directory fields that
round-trip through the file-picker all carry over unchanged. The
status line — which used to juggle five different messages (nav
bar, edit prompt, dropdown prompt, reset-confirm, "Saved!") in one
TextRenderable — now routes through shell.setFooter() /
refreshFooter(), mirroring history's pattern; "Saved!" self-clears
after 2s via setTimeout instead of persisting until the next
navigation.
Save/Reset/Back bindings carry `when: () => !this.editing` guards so
they neither fire nor show in the keybar mid-edit, replacing the old
manual `if (this.editing) return` gate at the top of the keypress
handler. ESC is dual-purpose via onBack: cancels an in-flight edit if
editing, otherwise pops the screen.
Tests rewritten to the app-shell pattern (shell mounting, breadcrumb,
footer keybar contents, panel title, directory-field push, ESC/q
resolution, cleanup) and switched to a reassignable storage mock so
save behaviour can actually be asserted — the previous inline mock
had no outer handle to check against.
Settings never read the write-only SelectRenderable.selectedIndex
bug fixed in history.ts — it only ever used setSelectedIndex() and
event-delivered indices, so no equivalent fix was needed here.
Verified via `bunx vitest run` (58 files, 679 tests, all green) —
`bun test` hung in the review sandbox on unrelated baseline files,
so vitest (same @opentui/core mock, already used by test:svelte) was
used as the reliable signal instead.1 parent e6061e9 commit b5e851c
2 files changed
Lines changed: 262 additions & 147 deletions
0 commit comments