fix(tui): limit sidebar height to match table, fix detail clipping

Log sidebar was rendering all lines regardless of table height. When
detail panel was open and table shrank, the sidebar stayed tall, pushing
the detail panel past MaxHeight (clipped to empty). Now sidebar accepts
a maxLines parameter capped to table row count.
This commit is contained in:
2026-06-20 19:13:37 -04:00
parent 54299583d6
commit 5720fabdbc
3 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -52,7 +52,7 @@ func (m Model) renderCompactLogLine(line string, maxW int) string {
return " " + tag + " " + msg
}
func (m Model) viewLogsSidebar(width int) string {
func (m Model) viewLogsSidebar(width, maxLines int) string {
logs := m.engine.GetLogs()
if len(logs) == 0 {
return m.st.subtleStyle.Render(" No logs yet")
@@ -69,6 +69,9 @@ func (m Model) viewLogsSidebar(width int) string {
continue
}
lines = append(lines, m.renderCompactLogLine(line, width))
if maxLines > 0 && len(lines) >= maxLines {
break
}
}
return "\n" + sidebarStyle.Render(strings.Join(lines, "\n"))