fix(tui): pin footer to bottom of terminal
CI / test (pull_request) Successful in 2m45s
CI / lint (pull_request) Successful in 56s
CI / vulncheck (pull_request) Successful in 51s

Replace string concatenation layout with lipgloss.JoinVertical
and fixed-height content area. Footer now stays at the same
vertical position regardless of tab content height. Uses
lipgloss.Height() to dynamically measure header/footer and
fill remaining space.
This commit is contained in:
2026-06-04 15:59:32 -04:00
parent e0f189efe9
commit aae6e6e65e
+13 -4
View File
@@ -173,11 +173,20 @@ func (m Model) viewDashboard() string {
footer := m.renderFooter(stats) footer := m.renderFooter(stats)
s := lipgloss.NewStyle().Padding(1, 2) outerPad := lipgloss.NewStyle().Padding(1, 2)
if m.termHeight > 0 { _, frameV := outerPad.GetFrameSize()
s = s.MaxHeight(m.termHeight) availHeight := m.termHeight - frameV
if availHeight < 5 {
availHeight = 5
} }
return s.Render(header + "\n" + content + "\n" + footer)
contentHeight := availHeight - lipgloss.Height(header) - lipgloss.Height(footer) - 2
if contentHeight < 1 {
contentHeight = 1
}
paddedContent := lipgloss.NewStyle().Height(contentHeight).Render(content)
return outerPad.Render(lipgloss.JoinVertical(lipgloss.Top, header, paddedContent, footer))
} }
func (m Model) renderTabBar(stats dashboardStats) string { func (m Model) renderTabBar(stats dashboardStats) string {