1.9 KiB
1.9 KiB
| id | slug | title | status | kind | priority | labels | created_at | updated_at | assignee | ||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 20260531-074258-tui-move-view-mode-state | tui-move-view-mode-state | TUI: move view mode state out of ui module | closed | task | P2 |
|
2026-05-31T07:42:58Z | 2026-05-31T13:45:39Z | null |
Background
A read-only investigation of crates/tui found that app.rs imports crate::ui::Mode while ui.rs imports and renders App. This is not a Rust module cycle, but it makes the state/render boundary conceptually circular: application state depends on a type owned by the rendering module.
This ticket separates the single-Pod display/history mode state from the render module before larger module grouping work.
Requirements
- Move the single-Pod display/history mode type currently owned by
ui.rsto a state-oriented location.- Acceptable destinations include
app.rsor a focused module such asview_mode.rs. - If renaming, prefer a clearer name such as
ViewModeorHistoryMode; keep the diff small if a rename would become noisy.
- Acceptable destinations include
- Update
app.rs,ui.rs,tool.rs, and tests to use the new location/name. - Remove the
app.rs -> ui.rsdependency caused only by this mode type. - Preserve rendering behavior and keyboard/command behavior.
- Keep visibility changes minimal; do not combine this with broad
Appfield privatization.
Non-goals
- Moving the whole render tree into
render/. - Splitting
app.rsbroadly. - Reworking mode semantics or UI layout.
- Renaming the
tuicrate/package.
Acceptance criteria
app.rsno longer importscrate::uisolely to access display/history mode state.- Render code still consumes the mode state from the state-oriented module/type.
- Existing mode-related behavior is unchanged.
- Focused tests covering mode/key/render behavior pass.
cargo fmt --check, relevantcargo test -p tui,cargo check -p tui,./tickets.sh doctor, andgit diff --checkpass.