Skip to content

feat(scan): interactive TUI (scan -i) to browse recommendations#18

Merged
mayur-tolexo merged 1 commit into
mainfrom
feat/scan-interactive-tui
Jun 2, 2026
Merged

feat(scan): interactive TUI (scan -i) to browse recommendations#18
mayur-tolexo merged 1 commit into
mainfrom
feat/scan-interactive-tui

Conversation

@mayur-tolexo

Copy link
Copy Markdown
Owner

Implements the roadmap's interactive scan -i TUI — browse and filter recommendations and drill into the full --explain detail, all in the terminal.

What it does

kubectl tidy scan -i opens a full-screen browser over the scan:

  • a filterable list of recommendations (workload · save $/mo · confidence · cpu/mem change)
  • press enter on a row → a scrollable detail pane with the full --explain block (the bordered avg/p95/p99/peak table, savings, confidence, "how it's sized")
  • / to filter, ↑/↓ to navigate, esc to go back, q/ctrl+c to quit

How

  • internal/cli/tui.go — a bubbletea model using bubbles/list (built-in filtering + pagination) for the list and bubbles/viewport for the detail, which reuses report.Explain so the list and detail stay consistent with the non-interactive output.
  • scan -i / --interactive launches the TUI only when attached to a TTY, in table mode, with results to show — pipes, --output json, and CI fall through to the normal render unchanged.
  • runScanTUI is a seam (var) so tests don't spawn a real program; the model's Update/View are unit-tested directly (navigate → detail → back → quit).
  • Deps: charmbracelet/bubbletea + bubbles + lipgloss (no vendor dir; the TUI option was chosen knowing it adds bubbletea).

Docs

README scan -i, ROADMAP item checked off, CHANGELOG (v0.1.2).

Tests

TUI model navigate/detail/back/quit covered; full go build/vet/gofmt/test ./... + golangci-lint (0 issues) green.

Adds an opt-in full-screen terminal UI over a scan: a filterable list of
recommendations and a scrollable detail pane (the same `--explain` block).

- `internal/cli/tui.go`: a bubbletea model — bubbles/list for the workload list
  (with built-in `/` filtering + pagination) and bubbles/viewport for the detail,
  which reuses report.Explain so list and detail stay consistent.
  Keys: ↑/↓ navigate · / filter · enter → detail · esc → back · q/ctrl+c quit.
- `scan -i` / `--interactive`: launches the TUI only on a TTY, in table mode, with
  results to show; pipes / JSON / CI fall through to the normal render unchanged.
- runScanTUI is a seam (var) so tests don't spawn a real program; the model's
  Update/View are unit-tested directly.
- deps: charmbracelet bubbletea + bubbles + lipgloss (no vendor dir).
- docs: README scan -i, ROADMAP checked off, CHANGELOG (v0.1.2).

Full build/vet/fmt/test/lint green.
@mayur-tolexo
mayur-tolexo merged commit c6e6423 into main Jun 2, 2026
2 checks passed
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