From 251c723fbd58a543084f2cfce624749cd5b0311d Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Thu, 28 May 2026 15:24:25 -0400 Subject: [PATCH] =?UTF-8?q?fix(tui):=20maint=20tab=20=E2=80=94=20bump=20MO?= =?UTF-8?q?NITORS/STARTED/ENDS=20min=20widths,=20respect=20column=20width?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MONITORS min 13→15 (monitor names can be long, truncate to column width). STARTED/ENDS min 10→14 (fits '18:30 May 28' = 12 chars + padding). fmtMaintMonitorW truncates name to actual column width. --- internal/tui/tab_maint.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/tui/tab_maint.go b/internal/tui/tab_maint.go index 0991cd4..b12c394 100644 --- a/internal/tui/tab_maint.go +++ b/internal/tui/tab_maint.go @@ -42,12 +42,16 @@ func fmtMaintType(t string) string { } func fmtMaintMonitor(monitorID int, sites []models.Site) string { + return fmtMaintMonitorW(monitorID, sites, 18) +} + +func fmtMaintMonitorW(monitorID int, sites []models.Site, maxW int) string { if monitorID == 0 { return "All" } for _, s := range sites { if s.ID == monitorID { - return limitStr(s.Name, 18) + return limitStr(s.Name, maxW) } } return fmt.Sprintf("#%d", monitorID) @@ -97,13 +101,14 @@ func (m Model) viewMaintTab() string { {"#", "#", 4, 4, false}, {"TITLE", "TITLE", 12, 28, true}, {"TYPE", "TYPE", 13, 14, false}, - {"MON", "MONITORS", 13, 20, false}, + {"MON", "MONITORS", 15, 22, false}, {"STATUS", "STATUS", 11, 12, false}, - {"START", "STARTED", 10, 16, false}, - {"ENDS", "ENDS", 10, 16, false}, + {"START", "STARTED", 14, 16, false}, + {"ENDS", "ENDS", 14, 16, false}, } headers, widths := m.computeTableLayout(cols, 0) titleW := widths[1] + monW := widths[3] return m.renderTable( headers, @@ -117,7 +122,7 @@ func (m Model) viewMaintTab() string { strconv.Itoa(i + 1), m.zones.Mark(fmt.Sprintf("maint-%d", i), limitStr(mw.Title, titleW-2)), fmtMaintType(mw.Type), - fmtMaintMonitor(mw.MonitorID, allSites), + fmtMaintMonitorW(mw.MonitorID, allSites, monW-2), fmtMaintStatus(mw), fmtMaintTime(mw.StartTime), fmtMaintTime(mw.EndTime),