From ea401136a9f2650dc6b3f84761d8cd938ed982fd Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Fri, 22 May 2026 18:19:08 -0400 Subject: [PATCH] fix(tui): correct viewport sizing and dynamic chrome calculation Replace hardcoded row offset with counted chrome lines, account for filter bar, and fix log viewport dimensions. --- internal/tui/tui.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/tui/tui.go b/internal/tui/tui.go index 6f32161..2e93ea8 100644 --- a/internal/tui/tui.go +++ b/internal/tui/tui.go @@ -186,12 +186,17 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case tea.WindowSizeMsg: m.termWidth = msg.Width m.termHeight = msg.Height - m.maxTableRows = msg.Height - 12 + // Chrome: 1 top pad + 1 tabs + 2 newlines + 3 table borders + 1 table header + 1 footer + 1 bottom pad = 10 + chrome := 10 + if m.filterText != "" { + chrome++ + } + m.maxTableRows = msg.Height - chrome if m.maxTableRows < 1 { m.maxTableRows = 1 } - m.logViewport.Width = msg.Width - m.logViewport.Height = msg.Height - 6 + m.logViewport.Width = msg.Width - 4 + m.logViewport.Height = msg.Height - 8 return m, tea.ClearScreen case time.Time: -- 2.52.0