Skip to content

Show live per-app progress in the CLI and colour the preview report - #31

Merged
adamXbot merged 1 commit into
mainfrom
feat/privacy-cli-brew-preview-f18825
Oct 9, 2026
Merged

adamXbot merged 1 commit into
mainfrom
feat/privacy-cli-brew-preview-f18825

Conversation

@adamXbot

@adamXbot adamXbot commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Why

privacycommand preview / upgrade gave no feedback while they worked — the only sign of life was network activity. A one-line spinner didn't fix it: on a 50-column terminal panel it was cut down to Analyzing 6 installed apps — 0 of 6 done…, losing the app name and step.

What changes

Live progress board (terminal only). preview and upgrade draw a board on stderr: one row per app with marker, name, version and current step, plus a footer with the spinner, a done count and elapsed time. With --fetch / upgrade the rows continue through ↓ downloading — 4.6 MB so far, opening the download, analyzing the new build — <step> and the outcome (✓ no privacy-relevant changes / ⚠ 3 changes · risk 14 → 22). The board erases itself before the report prints.

  • Markers and colours match the interactive browser's list (· queued, ~ working, ↓ downloading, ✓ clean, ⚠ noteworthy, ✗ failed, – skipped).
  • Nothing wraps: every line is clipped to the terminal width; the version column is dropped first so the step text survives at 50 columns; when there are more apps than screen rows, finished rows hide first behind … +N more (k done, j queued).
  • ProgressBoard (CLIKit) is the pure layout with 8 unit tests; StatusBoard (CLI) is the stderr driver and replaces Spinner.swift. The one-shot audit uses it too.
  • Only drawn when stderr is a TTY; log prints notes above the board so they never land mid-frame.

Report. Coloured like audit (tier colour on the headline, [error]/[warn] tags, ✓/⚠ markers, red held:), cask versions shown without brew's build hash (3.23.12 → 3.24.9, not 3.23.12,2d29876d…; JSON keeps the full string). --no-color added to preview and upgrade (honours NO_COLOR); completion tables updated.

TUI. The analyzer's step is shown under "Analyzing …" in the detail pane (a second inbox from the worker to the main loop), so a slow app no longer looks stuck.

Core. HomebrewCaskInventory.outdatedScan(progress:) and CaskArtifactFetcher.withDownloadedApp(progress:) report their phases; partialFile(for:) names brew's <cache>.incomplete download file, which gives the bytes so far.

Piped output and --json are byte-for-byte unchanged.

Testing

  • 313 core + 61 CLI-kit tests pass (9 new); just check passes; --tui-selftest passes.
  • Pseudo-terminal captures at 50 and 70 columns, checked frame by frame: 675 and 929 repaints, every cursor move correct, no line over the width.
  • Real runs in a Terminal panel: preview (6 casks) and upgrade iterm2 (download → analyze → diff), board cleared and report printed cleanly beneath.
  • preview iterm2 nosuchcask > out 2> err: stderr holds only the note, stdout has no escape codes; --json parses.

🤖 Generated with Claude Code

`preview` / `upgrade` were silent for the whole run — on a ~50-column
terminal even a one-line spinner lost the app name and step. They now
draw a progress board on stderr (only when it's a TTY): one row per app
with its current analysis step, download progress in MB for
--fetch/upgrade, and each app's result as it finishes; the board erases
itself before the report prints. Rows never wrap: the version column is
dropped first on a narrow terminal, and finished rows hide behind an
"… +N more" line when there are more apps than screen rows.

- `ProgressBoard` (CLIKit) is the pure layout, unit-tested; markers and
  colours match the interactive browser's list.
- `StatusBoard` (CLI) is the stderr driver and replaces `Spinner`; the
  one-shot audit uses it too ("Analyzing X — checking code signature").
- The TUI's detail pane shows the analyzer's step under "Analyzing …",
  so a slow app no longer looks stuck.
- `HomebrewCaskInventory.outdatedScan` and
  `CaskArtifactFetcher.withDownloadedApp` report progress; brew's
  `<cache>.incomplete` file gives the bytes downloaded so far.
- The preview/upgrade report is coloured like `audit` (tier on the
  headline, severity tags, ✓/⚠ markers, red `held:`), shows cask
  versions without brew's build hash (JSON keeps the full string), and
  takes `--no-color` (NO_COLOR honoured); completion tables updated.

Piped output and --json are byte-for-byte unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@adamXbot
adamXbot merged commit 18c7d67 into main Oct 9, 2026
7 checks passed
adamXbot added a commit that referenced this pull request Oct 12, 2026
Bump MARKETING_VERSION to 0.2.2 and add the release notes for the CLI
progress board, coloured preview/upgrade report and --no-color (#31).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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