Skip to content

Add table command#2

Open
abennett wants to merge 3 commits intomainfrom
table
Open

Add table command#2
abennett wants to merge 3 commits intomainfrom
table

Conversation

@abennett
Copy link
Copy Markdown
Owner

@abennett abennett commented Feb 7, 2026

  • implement a table command
  • add tests and update docs for table/add commands

abennett and others added 2 commits February 7, 2026 14:24
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an interactive Bubble Tea “table” dashboard command and refactors status/impact parsing into strongly-typed enums, with accompanying tests and documentation updates.

Changes:

  • Introduces a Bubble Tea TUI (ruok table) that concurrently fetches all services and supports drill-down detail view.
  • Adds Status / Impact enum types with JSON unmarshaling, plus tests for parsing and summarization logic.
  • Updates CLI output and README docs to reflect new commands and typed status handling.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tui.go New Bubble Tea interactive table/dashboard implementation + summarize helper
tui_test.go Unit tests for summarize behavior (counts, skipping rules, worst severity)
cli.go Adds table command and updates printing for typed Status/Impact
status.go Introduces Status enum + JSON unmarshaling + string/name helpers
status_test.go Tests for Status JSON parsing, emoji rendering, and ordering
impact.go Introduces Impact enum + JSON unmarshaling + string/name helpers
impact_test.go Tests for Impact JSON parsing, emoji rendering, and ordering
statuspage.go Removes old icon helpers; switches component/incident fields to typed enums
statuspage_test.go Adds HTTP server tests for components/incidents + config/service resolution
registry.go Removes atlassian built-in entry
go.mod Adds Bubble Tea / Bubbles / Lipgloss dependencies
README.md Documents table and add commands; updates examples accordingly
CLAUDE.md Repo guidance and architecture notes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +124 to +130
cmds = append(cmds, func() tea.Msg {
sp := StatusPage{
URL: r.url,
Client: &http.Client{Timeout: 10 * time.Second},
}
cmps, err := sp.Components()
return serviceResult{name: r.name, components: cmps, err: err}
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appends commands that close over the r range variable. In Go, the range variable is reused across iterations, so all commands can end up using the last row's values (wrong URL/name). Fix by capturing the loop value inside the loop (e.g., assign r := r before creating the closure, or index the slice and capture m.rows[i]).

Suggested change
cmds = append(cmds, func() tea.Msg {
sp := StatusPage{
URL: r.url,
Client: &http.Client{Timeout: 10 * time.Second},
}
cmps, err := sp.Components()
return serviceResult{name: r.name, components: cmps, err: err}
row := r
cmds = append(cmds, func() tea.Msg {
sp := StatusPage{
URL: row.url,
Client: &http.Client{Timeout: 10 * time.Second},
}
cmps, err := sp.Components()
return serviceResult{name: row.name, components: cmps, err: err}

Copilot uses AI. Check for mistakes.
status.go Outdated
case "partial_outage":
*s = StatusPartial
case "major_outage":
*s = StatusCritical
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StatusMajor is defined (and Status.Name() maps it to major_outage), but UnmarshalJSON maps major_outage to StatusCritical. That makes StatusMajor effectively unreachable for component statuses and will display major outages as 🔴 instead of 🟠. Consider mapping major_outage to StatusMajor, and keeping critical (if desired) mapped to StatusCritical.

Suggested change
*s = StatusCritical
*s = StatusMajor

Copilot uses AI. Check for mistakes.
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.

2 participants