update size based on screen

This commit is contained in:
2025-07-13 21:12:21 -07:00
parent 491416a575
commit 7032659d07
2 changed files with 25 additions and 6 deletions

View File

@@ -165,9 +165,16 @@ func (m *RowDetailModel) View() string {
}
value := row[i]
if len(value) > 50 {
// Calculate available width for value display
// Account for column name, ": ", and indentation
availableWidth := m.Shared.Width - len(col) - 4 // 4 for ": " and "> " prefix
if availableWidth < 20 {
availableWidth = 20 // Minimum width
}
if len(value) > availableWidth {
// Wrap long values
lines := WrapText(value, 50)
lines := WrapText(value, availableWidth)
value = strings.Join(lines, "\n ")
}