From 94b27488bdfa54ddd2a26d21014c27f50b352b19 Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Sat, 20 Jun 2026 14:11:18 -0400 Subject: [PATCH] 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. --- internal/tui/view_dashboard.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/tui/view_dashboard.go b/internal/tui/view_dashboard.go index d25e64b..dadb755 100644 --- a/internal/tui/view_dashboard.go +++ b/internal/tui/view_dashboard.go @@ -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)) }