Compare commits

2 Commits

Author SHA1 Message Date
lerko ba75be194d refactor(tui): consistent chrome across all views
CI / test (pull_request) Successful in 2m36s
CI / lint (pull_request) Successful in 56s
CI / vulncheck (pull_request) Successful in 51s
- 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
2026-06-04 19:23:12 +00:00
lerko e0cb0adebd fix(tui): quick wins batch — version footer, column widths, zebra, sparkline
CI / test (pull_request) Successful in 2m34s
CI / lint (pull_request) Successful in 57s
CI / vulncheck (pull_request) Successful in 51s
- Show version in dashboard footer (wired from goreleaser ldflags)
- Cap name column at 35, raise sparkline minimum to 15 chars
- Preserve zebra background on group rows (was lost by style override)
- Group sparkline uses bullet • instead of heavy circle ●
2026-06-04 14:56:01 -04:00
6 changed files with 17 additions and 11 deletions
+2 -2
View File
@@ -413,7 +413,7 @@ func runServe(args []string) {
sshSrv := startSSHServer(*port, s, eng, kc) sshSrv := startSSHServer(*port, s, eng, kc)
if isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd()) { if isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd()) {
p := tea.NewProgram(tui.InitialModel(true, s, eng), tea.WithAltScreen(), tea.WithMouseCellMotion()) p := tea.NewProgram(tui.InitialModel(true, s, eng, version), tea.WithAltScreen(), tea.WithMouseCellMotion())
if _, err := p.Run(); err != nil { if _, err := p.Run(); err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err) fmt.Fprintf(os.Stderr, "error: %v\n", err)
} }
@@ -449,7 +449,7 @@ func startSSHServer(port int, db store.Store, eng *monitor.Engine, kc *keyCache)
}), }),
wish.WithMiddleware( wish.WithMiddleware(
bm.Middleware(func(s ssh.Session) (tea.Model, []tea.ProgramOption) { bm.Middleware(func(s ssh.Session) (tea.Model, []tea.ProgramOption) {
return tui.InitialModel(false, db, eng), []tea.ProgramOption{tea.WithAltScreen(), tea.WithMouseCellMotion()} return tui.InitialModel(false, db, eng, version), []tea.ProgramOption{tea.WithAltScreen(), tea.WithMouseCellMotion()}
}), }),
), ),
) )
+2 -2
View File
@@ -131,9 +131,9 @@ func (m Model) groupSparkline(groupID int, width int) string {
} }
for _, up := range aggregated { for _, up := range aggregated {
if up { if up {
sb.WriteString(specialStyle.Render("")) sb.WriteString(specialStyle.Render(""))
} else { } else {
sb.WriteString(dangerStyle.Render("")) sb.WriteString(dangerStyle.Render(""))
} }
} }
return sb.String() return sb.String()
+4 -4
View File
@@ -78,13 +78,13 @@ func (m Model) computeLayout() tableLayout {
if nameW < 13 { if nameW < 13 {
nameW = 13 nameW = 13
} }
if nameW > 40 { if nameW > 35 {
nameW = 40 nameW = 35
} }
sparkW := avail - nameW sparkW := avail - nameW
if sparkW < 10 { if sparkW < 15 {
sparkW = 10 sparkW = 15
} }
widths[1] = nameW widths[1] = nameW
+3
View File
@@ -66,6 +66,9 @@ func (m Model) renderTable(headers []string, items int, buildRows func(start, en
if styleOverride != nil { if styleOverride != nil {
if s := styleOverride(row, col); s != nil { if s := styleOverride(row, col); s != nil {
style := *s style := *s
if row%2 == 1 {
style = style.Background(tableZebraStyle.GetBackground())
}
if isSelected { if isSelected {
style = tableSelectedStyle.Foreground(s.GetForeground()) style = tableSelectedStyle.Foreground(s.GetForeground())
} }
+3 -1
View File
@@ -138,9 +138,10 @@ type Model struct {
// demoMode renders a stable status dot instead of the animated pulse so // demoMode renders a stable status dot instead of the animated pulse so
// screenshots/recordings don't capture the spinner mid-frame. Set via UPTOP_DEMO=1. // screenshots/recordings don't capture the spinner mid-frame. Set via UPTOP_DEMO=1.
demoMode bool demoMode bool
version string
} }
func InitialModel(isAdmin bool, s store.Store, eng *monitor.Engine) Model { func InitialModel(isAdmin bool, s store.Store, eng *monitor.Engine, version string) Model {
vpLogs := viewport.New(100, 20) vpLogs := viewport.New(100, 20)
vpLogs.SetContent("Waiting for logs...") vpLogs.SetContent("Waiting for logs...")
z := zone.New() z := zone.New()
@@ -172,6 +173,7 @@ func InitialModel(isAdmin bool, s store.Store, eng *monitor.Engine) Model {
theme: theme, theme: theme,
themeIndex: themeIdx, themeIndex: themeIdx,
demoMode: os.Getenv("UPTOP_DEMO") == "1", demoMode: os.Getenv("UPTOP_DEMO") == "1",
version: version,
} }
} }
+3 -2
View File
@@ -275,9 +275,10 @@ func (m Model) renderFooter(stats dashboardStats) string {
keys = "[T]Theme [Tab]Switch [q]Quit" keys = "[T]Theme [Tab]Switch [q]Quit"
} }
footer := "\n" + statusLine + " " + subtleStyle.Render(keys) ver := subtleStyle.Render("v" + m.version)
footer := "\n" + statusLine + " " + subtleStyle.Render(keys) + " " + ver
if m.filterText != "" && m.currentTab == 0 { if m.filterText != "" && m.currentTab == 0 {
footer = "\n" + subtleStyle.Render(fmt.Sprintf("filter: %s", m.filterText)) + " " + statusLine + " " + subtleStyle.Render(keys) footer = "\n" + subtleStyle.Render(fmt.Sprintf("filter: %s", m.filterText)) + " " + statusLine + " " + subtleStyle.Render(keys) + " " + ver
} }
return footer return footer
} }