5.6 KiB
5.6 KiB
Plan — queue selection, visual mode, and the register
Executes architecture/queue-register.md against
quality/queue-register.md. Ordered by dependency. Three commits: (A)
the shared mark/visual trait with the library moved onto it, (B) queue
marks + the register in cbd-tui, (C) cbd-web parity + docs.
No server work: Remove already takes many positions and Insert takes a
path list (G25).
A — Shared mark and visual behaviour (cbd-tui)
- A1 — Fill in
MarkedPaneinapp/list.rs:toggle_visual,toggle_mark,toggle_mark_view,paint_between,selection— moved verbatim in behaviour fromlibrary.rs, with themarkablegate taken from the implementor. Verifies: G11, G12, G16. - A2 —
impl MarkedPane for Library, deleting the now-duplicated inherent methods and keepingget_selectedas a thin wrapper overselectionso existing call sites are untouched.markable=is_queable. Verifies: the existing library visual-mode suite passes unchanged (G11, G12). - A3 —
carry_marksinapp/list.rs: greedy in-order path match, drop marks whose track is gone, all-false when nothing matches, tolerant of a shortold_marked. Verifies: the tencarry_marks_tests(G2, G3). - A4 — Commit A. Merged into commit B: group A alone leaves
carry_marksandRegisterunwired, and committing dead code for the next commit to use is worse than one larger commit. The extraction is still proven behaviour-preserving — the library's whole visual-mode suite passes untouched.
B — Queue marks and the register (cbd-tui)
- B1 —
impl MarkedPane for Queuewithmarkable= always, and avisual: Option<usize>field onQueue. Verifies: G12. - B2 —
update_queuecarries marks throughcarry_marksinstead of rebuilding them asfalse: keep the previous path list and mark flags, reconcile, apply. Verifies: G1, G2. - B3 —
Register::set(replace thetodo!()) and anApp.registerfield. Verifies: the register suite (G6, G10). - B4 —
yin both panes. NewAction::LibraryYankandAction::QueueYank; each takesselection(), writes the register, and clears the marks it consumed. Verifies: G5, G14, G15. - B5 —
din the queue deletes every marked row (cursor row when none), writing them to the register first, in oneRemoveTrackscall with positions from the current list. Replaces theFIXME. Verifies: G1, G13, G14, G15. - B6 —
c/Cfill the register with the tracks they drop (Ceverything,ceverything but the current track). Verifies: G4. - B7 —
p/Ppaste the register.Action::QueuePaste/QueuePasteBeforesendInsertTracks(register.paths(), pos)withpos= cursor + 1 forp, cursor forP; a no-op on an empty register; the register survives.QueueInsertHere's old cross-pane behaviour is gone. Verifies: G7, G8, G9. - B8 — Queue visual mode in dispatch. A
queue_movewrapper mirroringlibrary_move, and the visual auto-leave guard generalized to whichever pane is in visual mode with its own movement whitelist. Verifies: G11. - B9 — Bindings + help. Queue scope gains
s,v,V,y,P; library gainsy;p's description changes. The help modal derives fromBINDINGS, so it follows. Verifies: G19, G20. - B10 — Status feedback. The pane title shows
— VISUALin the queue as in the library, and a non-empty register is visible somewhere (title or now-playing line) so paste is not blind. Verifies: G22 in spirit; keeps G9's no-op explicable. - B11 — Dispatch tests for the gates named above. Verifies: G1, G4, G5, G7–G9, G13–G15.
- B12 — Commit B with the whole
cbd-tuisuite, clippy-D warnings, and fmt clean (G24, G26).
C — cbd-web parity and docs
- C1 —
Register+carry_marksincbd-web/src/state.rs, same shape and same test cases as the TUI's. Verifies: G17, G18. - C2 — Library visual mode (the piece deferred when
v/Vlanded in the TUI):visual: Option<usize>onLibraryPane, the same anchored paint,Action::LibraryVisualModeonv/V, auto-leave on non-movement. Verifies: G17. - C3 — Queue marks beside the signal. The web queue owns no list, so
hold
marks: Vec<bool>plus the path list they were taken against, and reconcile on eachQueueupdate. Verifies: G18. - C4 — Queue actions:
QueueToggleMark,QueueVisualMode,QueueYank,QueuePaste,QueuePasteBefore, plusd/c/Cwriting the register — same semantics as the TUI. Verifies: G17. - C5 — Keymap +
HELPtable rows for all of the above, keeping the lockstep test green; clickable equivalents where the web client has them. Verifies: G19. - C6 — Verify the web half properly: clippy for native and
wasm32-unknown-unknown,cargo test -p cbd-web, and a trunk bundle build. Verifies: G26. - C7 — Docs.
docs/src/clients/tui.md(key table + a register section),docs/src/clients/web.md,docs/src/queue.md(what the register is and is not), and the README usage section. State plainly thatpchanged meaning. Verifies: G21, G22, G23. - C8 —
plan/summary.mdentry, then commit C.
Deferred (recorded, not dropped)
- Named registers (
"a) —Registeris shaped for it; not built. - A numbered/history register stack, and any cross-client or persistent register.
- A per-entry queue id in the proto, which would make mark reconciliation exact instead of a greedy path match.