feat(scan): interactive TUI (scan -i) to browse recommendations#18
Merged
Conversation
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.
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.
Implements the roadmap's interactive
scan -iTUI — browse and filter recommendations and drill into the full--explaindetail, all in the terminal.What it does
kubectl tidy scan -iopens a full-screen browser over the scan:--explainblock (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 quitHow
internal/cli/tui.go— a bubbletea model usingbubbles/list(built-in filtering + pagination) for the list andbubbles/viewportfor the detail, which reusesreport.Explainso the list and detail stay consistent with the non-interactive output.scan -i/--interactivelaunches 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.runScanTUIis a seam (var) so tests don't spawn a real program; the model'sUpdate/Vieware unit-tested directly (navigate → detail → back → quit).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.