Skip to content

Phase 4: unified TUI progress, help overlay, execute confirmation - #18

Open
zackkitzmiller wants to merge 2 commits into
feat/phase3-smarter-groupingfrom
feat/phase4-tui-polish
Open

Phase 4: unified TUI progress, help overlay, execute confirmation#18
zackkitzmiller wants to merge 2 commits into
feat/phase3-smarter-groupingfrom
feat/phase4-tui-polish

Conversation

@zackkitzmiller

Copy link
Copy Markdown
Member

Why

The longest wait in the app — scanning and AI analysis — happened as plain println! lines outside the TUI, then the review screen appeared abruptly. There was no help surface for discovering keys, and x executed immediately with no summary of what was about to happen.

Stacked on #17.

Changes

  • Pipeline phase inside the TUI (tui::run_pipeline_progress): a centered, review-theme-matched panel with a stage checklist (Scan → Fingerprint → Analyze → Group), braille spinner, live analysis gauge with cached-count and cost estimate, current-file line, and failure count. Runs on a blocking task fed by PipelineEvents; hands off to the review screen when the plan is ready. Ctrl-C aborts cleanly (exit 130 after restoring the terminal). Piped/non-tty runs keep the existing line output.
  • Help overlay: ? opens a keys reference (sections: Navigate / Organize-or-Dupes / Act) tailored to the active mode; any key closes.
  • Execute confirmation modal: x now shows what will happen first — Organize: "Move N files into M folders" with the top folder list; Dupes: "Stage K duplicates to trash (X MB)" plus the undo/purge reassurance. ⏎/y proceeds, esc/n returns to review.
  • Terminal safety: the progress task is joined before pipeline errors propagate, so a cost-limit abort never leaves the terminal in raw mode.
  • Deps: atty (RUSTSEC-2021-0145) → std::io::IsTerminal; dotenv (unmaintained) → dotenvy.

Deferred (noted for a follow-up): in-TUI post-execute results screen; moving text preview/diff file reads off the render thread.

Test plan

  • cargo test — 376 passed (new: x-opens-confirmation-then-enter-executes, confirm-cancel, help open/close)
  • cargo clippy --all-targets — clean; cargo fmt applied

- the scan/fingerprint/analyze/group phase now renders inside the TUI
  (stage checklist with spinner, live analysis gauge, cost estimate,
  failure count) and hands off to the review screen; plain line output
  is kept for piped/non-tty runs
- '?' opens a help overlay listing every key per mode (organize vs
  dupes) — any key closes it
- 'x' now opens a confirmation modal summarizing what will happen
  (N files into M folders, or K duplicates staged to trash with byte
  total and the undo/purge hint) before anything executes
- footer gains a '?' hint; terminal is always restored before pipeline
  errors propagate
- deps: atty (RUSTSEC-advisoried) dropped for std::io::IsTerminal,
  dotenv swapped for maintained dotenvy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant