refactor(tui): consistent chrome across all views
CI / test (pull_request) Successful in 2m42s
CI / lint (pull_request) Successful in 56s
CI / vulncheck (pull_request) Successful in 41s

- Extract divider() and emptyState() helpers to format.go
- All empty states now use bordered box with accent color
- Detail and alert detail panels get header/section dividers
- SLA label width 14→16 to match detail/alert panels
- Logs key hints moved from content to dashboard footer
- History/SLA panels use shared divider helper
This commit is contained in:
2026-06-04 15:08:29 -04:00
parent 60592ef810
commit bcb2678a20
11 changed files with 60 additions and 48 deletions
+6 -4
View File
@@ -164,7 +164,7 @@ func fmtAlertLastSent(h monitor.AlertHealth) string {
func (m Model) viewAlertsTab() string {
if len(m.alerts) == 0 {
return "\n No alert channels configured. Press [n] to add one."
return m.emptyState("No alert channels configured.", "[n] Add your first alert")
}
var headers []string
@@ -214,7 +214,8 @@ func (m Model) viewAlertDetailPanel() string {
var b strings.Builder
b.WriteString(subtleStyle.Render(" Alerts > ") + titleStyle.Render(a.Name) + "\n\n")
b.WriteString(subtleStyle.Render(" Alerts > ") + titleStyle.Render(a.Name) + "\n")
b.WriteString(m.divider() + "\n")
row := func(label, value string) {
fmt.Fprintf(&b, " %-16s %s\n", subtleStyle.Render(label), value)
@@ -240,12 +241,13 @@ func (m Model) viewAlertDetailPanel() string {
row("Last Error", dangerStyle.Render(limitStr(h.LastError, 60)))
}
b.WriteString("\n" + subtleStyle.Render(" CONFIGURATION") + "\n")
b.WriteString(m.divider() + "\n")
b.WriteString(subtleStyle.Render(" CONFIGURATION") + "\n")
for k, v := range a.Settings {
row(k, v)
}
b.WriteString("\n\n")
b.WriteString(m.divider() + "\n")
b.WriteString(subtleStyle.Render(" [i/Esc] Back [e] Edit [t] Test [q] Quit"))
return lipgloss.NewStyle().Padding(1, 2).Render(b.String())