fix(tui): vertically center sparse tab content

Tables on tabs with few rows (Alerts, Nodes, Maint, Users) now sit in
the upper third of the viewport instead of flush against the tab bar.
Dense tabs like Monitors and Logs fill naturally and are unaffected.
This commit is contained in:
2026-06-20 14:11:18 -04:00
parent 7d0b4dab8b
commit 94b27488bd
+12 -1
View File
@@ -181,7 +181,18 @@ func (m Model) viewDashboard() string {
if contentHeight < 1 {
contentHeight = 1
}
paddedContent := lipgloss.NewStyle().Height(contentHeight).MaxHeight(contentHeight).Render(content)
contentLines := lipgloss.Height(content)
var paddedContent string
if contentLines < contentHeight {
topPad := (contentHeight - contentLines) / 3
paddedContent = lipgloss.NewStyle().
PaddingTop(topPad).
Height(contentHeight).MaxHeight(contentHeight).
Render(content)
} else {
paddedContent = lipgloss.NewStyle().Height(contentHeight).MaxHeight(contentHeight).Render(content)
}
return outerPad.Render(lipgloss.JoinVertical(lipgloss.Top, header, paddedContent, footer))
}