crabidy/plan/visual-mode.md

1.8 KiB
Raw Permalink Blame History

Task plan — TUI visual mode

Ordered, verifiable tasks for the library paint-select visual mode (architecture/visual-mode.md, quality/visual-mode.md). All in cbd-tui.

  • P1 — bindings (app/bindings.rs): add Action::LibraryVisualMode; move ToggleSpectrum from Global v to Global f (update description key); add Library bindings v (NONE) and V (SHIFT) → LibraryVisualMode with a clear description. Verify: T1, T2, T3.
  • P2 — Library state + paint (app/library.rs): add visual: bool; is_visual, toggle_visual (on-enter toggles the current mark), exit_visual, selected_view, and paint_between(from_view, to_view) that toggles the mark (respecting is_queable) of every view index in the half-open sweep, mapping through the filter. Verify: T10, and compiles for T4T9.
  • P3 — title indicator (app/library.rs render): show — VISUAL in the pane title while visual is active (precedence over the search/creatable hints). Verify: G6 by reading; render smoke test if one exists.
  • P4 — dispatch routing (app/mod.rs): capture was_visual; auto-exit visual for any action except the six movements, LibraryVisualMode, and ClearSearch; route the six movements through a library_move helper that paints the (old,new] sweep when visual is active; LibraryVisualModetoggle_visual; ClearSearch exits visual when active (else clears filter); LibraryDive/LibraryAscend/CycleFocus exit visual then act. Verify: T4T9, T11.
  • P5 — help/parity check: confirm the help modal renders the new/moved bindings from BINDINGS (no code change expected). Verify: G4, G6.
  • P6 — gate: cargo test -p cbd-tui, cargo clippy -p cbd-tui -D warnings, cargo fmt --check. Re-read G1G6 against the diff.