Expand description
Interactive scaffold TUI for haz init per
AUX-003..AUX-005.
Two layers live here:
dispatchis a pure function from a crossterm event and aTuiStateto aDispatchResult. It mutates the state in-place and performs no IO; the side effects the driver needs to perform (loading children from disk, leaving the tree screen to commit) are returned as enum variants. The purity makes every key binding exhaustively unit-testable without a terminal.run_interactive_scaffoldis the IO-driven loop that owns the terminal: it sets up raw mode + the alternate screen, draws each frame, reads events, callsdispatch, and performs the IO actions the dispatcher requests.
The screen layout is a single navigable tree with a synthetic
[ Commit selection ] button just below it; pressing Enter
from any focus position commits, while arrow / space cycle
state for tree rows.
Hidden-directory handling: by default the tree omits
dotfile-prefixed entries (.git, .cache, …) and entries
matched by the cwd’s .gitignore (and git’s global excludes).
H toggles their visibility; when shown, dotfile rows render
dim and gitignored rows render dim with a warning-coloured
foreground so the user can still distinguish them from
ordinary content. The classification is captured per-row via
super::model::HiddenKind.
Structs§
- TuiState
- The full mutable TUI state. Held by the driver, mutated by
dispatch.
Enums§
- Dispatch
Result - What the dispatcher’s caller (the driver loop) should do next.
- Scaffold
Outcome - Final outcome of the scaffold flow as far as the executor is concerned.
- TuiFocus
- Which on-screen element currently carries the focus highlight.
Functions§
- run_
interactive_ scaffold - Run the full interactive scaffold flow against
cwd_host.