fix(tui): enforce column MaxWidth to prevent lipgloss redistribution
CI / test (pull_request) Successful in 2m50s
CI / lint (pull_request) Successful in 1m11s
CI / vulncheck (pull_request) Successful in 56s

lipgloss table with Width(tableWidth) redistributes surplus space across
all columns. Adding MaxWidth() caps each column to its computed width.
Also dump any remaining surplus into the HISTORY sparkline column.
This commit is contained in:
2026-05-28 14:18:32 -04:00
parent 9121b79582
commit 2569a252ff
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ func (m Model) renderTable(headers []string, items int, buildRows func(start, en
style = tableSelectedStyle.Foreground(s.GetForeground())
}
if col < len(colWidths) && colWidths[col] > 0 {
style = style.Width(colWidths[col])
style = style.Width(colWidths[col]).MaxWidth(colWidths[col])
}
return style
}
@@ -64,7 +64,7 @@ func (m Model) renderTable(headers []string, items int, buildRows func(start, en
base = tableSelectedStyle
}
if col < len(colWidths) && colWidths[col] > 0 {
base = base.Width(colWidths[col])
base = base.Width(colWidths[col]).MaxWidth(colWidths[col])
}
return base
})