Add scan roots and an interactive directory picker to the TUI - #4
Merged
Conversation
The TUI could only ever scan $HOME: vacuum-tui called safety::default_roots() directly and vacuum_tui::run() took no arguments, so a target outside $HOME was reachable only via a HOME-override hack (which also misdirects the XDG trash). This threads roots into the TUI properly and adds a runtime picker. CLI roots: 'vacuum tui [PATHS]... [--root PATH]...' now accepts roots (cli::TuiArgs) and resolves them through the same machinery as scan/list/clean — app::run_tui reuses resolve_roots + config::fallback_roots, so precedence is CLI --root/paths > VACUUM_ROOTS > config 'roots' > $HOME. Bare 'vacuum'/'vacuum tui' still defaults to $HOME but now also honors VACUUM_ROOTS/config. run(roots) threads the roots into both the scan and the Deleter. Interactive picker: press 'r' to open a Clear-based centered overlay that browses the filesystem (std::fs only, no new deps) and adds/removes scan roots at runtime, re-scanning on close. Keys: j/k move, enter/l descend, h/Backspace up, space add/remove (✓ marks active roots), d remove, esc apply. Pure helpers (read_subdirs, toggle_root) carry the logic and are unit-tested; symlinks are not followed and unreadable dirs are skipped. Safety unchanged: the picked roots become the deletion allowlist via safety::check_deletable exactly as for the CLI — the picker cannot widen the boundary, and the system-path denylist still applies. Surface + docs: schema/describe advertise 'tui'; the Texinfo manual gains an Interactive TUI chapter (keys + picker) and builds zero-warning; AGENTS.md and SKILL.md updated. Adds 2 CLI parse tests and 3 TUI unit tests (44 total). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
UnbreakableMJ
force-pushed
the
feature/tui-scan-roots-and-picker
branch
from
June 22, 2026 20:12
04d6c5d to
54803b7
Compare
UnbreakableMJ
changed the base branch from
feature/empty-trash-and-config-roots
to
main
June 22, 2026 20:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The TUI could only ever scan
$HOME—vacuum-tuicalledsafety::default_roots()directly andvacuum_tui::run()took no arguments, so a target outside$HOME(e.g./spacecraft-software) was reachable only via aHOME=…hack (which also misdirects the XDG trash). This makes the TUI take roots properly and adds a runtime directory picker.vacuum tui [PATHS]... [--root PATH]...now accepts roots (cli::TuiArgs) and resolves them through the same machinery asscan/list/clean:app::run_tuireusesresolve_roots+config::fallback_roots, so precedence is CLI--root/paths >VACUUM_ROOTS> configroots>$HOME. Barevacuum/vacuum tuistill defaults to$HOMEbut now also honorsVACUUM_ROOTS/config.run(roots)threads the roots into both the scan and theDeleter.rto open aClear-based centered overlay that browses the filesystem (std::fsonly — no new deps) and adds/removes scan roots at runtime, re-scanning on close. Keys:j/kmove ·enter/ldescend ·h/Backspaceup ·spaceadd/remove (✓ marks active roots) ·dremove ·escapply. Pure helpers (read_subdirs,toggle_root) carry the logic; symlinks are not followed and unreadable dirs are skipped.safety::check_deletableexactly as for the CLI — the picker cannot widen the boundary, and the system-path denylist still applies.Surface & docs
schema/describeadvertisetui(withpaths+root); stale "Defaults to $HOME" descriptions corrected to the real precedence.AGENTS.mdandSKILL.mdupdated.Testing
cargo fmt --check·cargo clippy --workspace --all-targets -- -D warnings·cargo test --workspace(44 pass — 2 new CLI parse tests, 3 new TUI unit tests) ·reuse lintcompliant ·makeinfozero-warning.~/.cargo/bin/vacuum; verifiedtui --help/schema/describefrom outside the repo.Follow-ups (out of scope)
🤖 Generated with Claude Code