fix(tui): compute table Width from column sum, not terminal width
CI / test (pull_request) Successful in 2m47s
CI / lint (pull_request) Failing after 1m6s
CI / vulncheck (pull_request) Successful in 56s

Table Width was set to terminal width, forcing lipgloss to redistribute
surplus space into columns like #. Now computed from sum of column widths
+ border overhead. Table is exactly as wide as needed, capped at terminal.
This commit is contained in:
2026-05-28 15:57:33 -04:00
parent 5401266e83
commit c487a8eb26
+10 -1
View File
@@ -34,7 +34,16 @@ func (m Model) renderTable(headers []string, items int, buildRows func(start, en
selectedVisual := m.cursor - m.tableOffset
rows := buildRows(m.tableOffset, end)
tableWidth := m.termWidth - chromePadH - 2
colTotal := 0
for _, w := range colWidths {
colTotal += w
}
borderOverhead := 2 + len(colWidths) - 1
tableWidth := colTotal + borderOverhead
maxWidth := m.termWidth - chromePadH - 2
if tableWidth > maxWidth {
tableWidth = maxWidth
}
if tableWidth < 40 {
tableWidth = 40
}