fix(tui): remove error truncation from detail panel
CI / test (pull_request) Successful in 2m29s
CI / lint (pull_request) Successful in 56s
CI / vulncheck (pull_request) Successful in 51s

Error row now word-wraps to terminal width instead of hard-truncating.
Probe results and state change errors show full text.
This commit is contained in:
2026-06-03 16:57:27 -04:00
parent 3d7ab5a49e
commit c25614c098
+8 -3
View File
@@ -44,7 +44,12 @@ func (m Model) viewDetailPanel() string {
row("Status", fmtStatus(site.Status, site.Paused, m.isMonitorInMaintenance(site.ID), errCat))
if (site.Status == "DOWN" || site.Status == "SSL EXP" || site.Status == "LATE") && site.LastError != "" {
row("Error", dangerStyle.Render(limitStr(site.LastError, 60)))
errWidth := m.termWidth - chromePadH - 19
if errWidth < 30 {
errWidth = 30
}
wrapped := lipgloss.NewStyle().Width(errWidth).Render(site.LastError)
row("Error", dangerStyle.Render(wrapped))
}
if site.Type == "http" && site.StatusCode > 0 {
@@ -162,7 +167,7 @@ func (m Model) viewDetailPanel() string {
ago := time.Since(result.CheckedAt).Truncate(time.Second)
line := fmt.Sprintf(" %-14s %s %dms %s ago", nodeID, status, latency, ago)
if !result.IsUp && result.ErrorReason != "" {
line += " " + dangerStyle.Render(limitStr(result.ErrorReason, 30))
line += " " + dangerStyle.Render(result.ErrorReason)
}
b.WriteString(line + "\n")
}
@@ -181,7 +186,7 @@ func (m Model) viewDetailPanel() string {
}
line := fmt.Sprintf(" %s %s", arrow, subtleStyle.Render(ago+" ago"))
if sc.ErrorReason != "" && sc.ToStatus != "UP" {
line += " " + dangerStyle.Render(limitStr(sc.ErrorReason, 40))
line += " " + dangerStyle.Render(sc.ErrorReason)
}
b.WriteString(line + "\n")
}