返回 CodeWhale
TUI_METAMORPHOSIS.md
根目录 / docs / TUI_METAMORPHOSIS.md
1 # TUI metamorphosis boundary
2
3 The underwater TUI is being replaced as a staged molt, not rewritten inside
4 the legacy god files.
5
6 ## New owners
7
8 - `crates/tui/src/tui/work_surface/` owns transcript-top Tasks, To-do, active
9 workers, stable row IDs, focus, scrolling, hitboxes, and row actions.
10 - `crates/tui/src/route_billing.rs` owns whether a route presents money,
11 subscription/quota usage, or local usage. Model IDs never decide this alone.
12 - `crates/tui/src/tui/underwater.rs` remains the Ocean shell composition owner.
13
14 `ui.rs` and `mouse_ui.rs` are adapters: they forward terminal events and apply
15 typed actions. They must not regain per-surface state or rendering rules.
16
17 ## Rollback contract (historical — Classic is gone)
18
19 Classic and its sidebar were deleted in `1b07e2cbc` (0.9.4 rail
20 unification), after the gates below were satisfied. This section is kept as
21 a record of that decision, not as live guidance: there is no Classic shell
22 to roll back to, and "restore old behavior" must never mean resurrecting
23 `sidebar.rs`. Panel logic lives in `work_surface/panels.rs` and the row
24 machinery in `work_surface/render/`; the remaining `tui::sidebar` line
25 builders are `pub(crate)` helpers being wound down.
26
27 The original gates, for provenance:
28
29 1. `40x12`, `60x16`, `80x24`, `100x32`, and `140x40` pass keyboard and mouse
30 interaction checks.
31 2. Full/reduced motion and Ombre/Flat/Terminal treatments pass live PTY checks.
32 3. The hermetic TUI suite passes twice.
33 4. A release build is installed through `scripts/release/install-dogfood.sh`,
34 and its commit/SHA receipt matches the running binary.
35 5. Hunter accepts the live candidate.
36
36 lines MARKDOWN