chore(tui): visual polish — detail sections, column headers, alert detail #37

Merged
lerko merged 20 commits from chore/ux-polish into main 2026-05-28 20:40:29 +00:00

20 Commits

Author SHA1 Message Date
lerko 4e7018ab28 fix(lint): remove unused fmtMaintMonitor function
CI / test (pull_request) Successful in 3m17s
CI / lint (pull_request) Successful in 1m12s
CI / vulncheck (pull_request) Successful in 1m1s
2026-05-28 16:33:00 -04:00
lerko ad14daf6ae fix(tui): account for cell padding in NAME column content limits
CI / test (pull_request) Successful in 2m51s
CI / lint (pull_request) Failing after 1m11s
CI / vulncheck (pull_request) Successful in 56s
Group icons, tree prefixes (├/└), and regular names all need 2 extra
chars margin for cell padding. Reduces truncation limits by 2 across
all name rendering paths.
2026-05-28 16:07:58 -04:00
lerko 1c29758ca2 fix(tui): bump compact UPTIME column 7→8 to fit 100.0% with cell padding
CI / test (pull_request) Successful in 2m41s
CI / lint (pull_request) Failing after 1m1s
CI / vulncheck (pull_request) Successful in 1m1s
2026-05-28 16:04:51 -04:00
lerko fa96c5fd3f fix(tui): render sparkline 2 chars narrower than column to prevent wrapping
CI / test (pull_request) Successful in 3m5s
CI / lint (pull_request) Failing after 1m12s
CI / vulncheck (pull_request) Successful in 56s
Cell padding inside the table causes sparkline content at full column
width to wrap. Subtract 2 from sparkWidth for content rendering.
2026-05-28 16:01:44 -04:00
lerko c487a8eb26 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.
2026-05-28 15:57:33 -04:00
lerko 5401266e83 refactor(tui): two-tier responsive table layout (compact/wide at 120 cols)
CI / test (pull_request) Successful in 2m54s
CI / lint (pull_request) Failing after 1m12s
CI / vulncheck (pull_request) Successful in 56s
Replace continuous surplus distribution with two fixed layouts per table.
Breakpoint at 120 columns — matches how btop/k9s do it.

Compact (<120): short headers (LAT, UP%, RT, ST, MON, SENT, VER),
  tight fixed widths, no surplus guessing.

Wide (≥120): full headers (LATENCY, UPTIME, RETRIES, STATUS, MONITORS,
  LAST SENT, VERSION), generous widths.

Sites tab keeps content-aware NAME sizing + sparkline flex.
All other tabs (Alerts, Maint, Nodes, Users) use simple fixed tiers.

Removed old computeTableLayout/colDef/tierCol/pickTier — no longer needed.
2026-05-28 15:50:23 -04:00
lerko a84f4894f8 fix(tui): maint tab — MONITORS is flex, dates get room, time adapts to width
CI / test (pull_request) Successful in 2m46s
CI / lint (pull_request) Failing after 1m7s
CI / vulncheck (pull_request) Successful in 51s
TITLE was flex eating all space while dates/monitors squeezed. Flipped:
MONITORS is now flex, TITLE fixed (12-24), dates min 14, STATUS min 11.
fmtMaintTime uses compact format (Jan 02) at narrow widths.
2026-05-28 15:40:18 -04:00
lerko d9dcd58b66 fix(tui): maint tab min widths fit 80-column terminals
CI / test (pull_request) Successful in 2m49s
CI / lint (pull_request) Failing after 1m12s
CI / vulncheck (pull_request) Successful in 56s
Reduce minimums so fixedMin=51 (was 71). At narrow: compact headers (ST, MON).
At wide: full headers (STATUS, MONITORS, STARTED) with expanded widths.
2026-05-28 15:31:01 -04:00
lerko 251c723fbd fix(tui): maint tab — bump MONITORS/STARTED/ENDS min widths, respect column width
CI / test (pull_request) Successful in 2m50s
CI / lint (pull_request) Failing after 1m1s
CI / vulncheck (pull_request) Successful in 56s
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.
2026-05-28 15:24:25 -04:00
lerko eb61a0dd3c fix(tui): increase maint tab min column widths for TYPE/MONITORS/STATUS
CI / test (pull_request) Successful in 2m51s
CI / lint (pull_request) Successful in 1m6s
CI / vulncheck (pull_request) Successful in 51s
TYPE min 10→13 (fits 'maintenance'), MONITORS min 10→13, STATUS min 8→11
(fits 'SCHEDULED'). Prevents word wrapping.
2026-05-28 15:22:18 -04:00
lerko d05bbd007b feat(tui): responsive table layout for all tabs
CI / test (pull_request) Successful in 2m45s
CI / lint (pull_request) Successful in 1m12s
CI / vulncheck (pull_request) Successful in 1m6s
Extract shared computeTableLayout() into table_helpers.go — takes column
definitions with short/full headers, min/max widths, and a flex column
that absorbs surplus space. All tabs now use it:

- Alerts: CONFIG column is flex, NAME/TYPE/SENT expand with width
- Maint: TITLE column is flex, TYPE/MONITORS/STATUS/dates expand
- Nodes: NAME column is flex, REGION/LAST SEEN/VERSION expand
- Users: PUBLIC KEY column is flex, USERNAME expands
- Sites: uses same colDef type (keeps special dual-flex for NAME+HISTORY)

Headers auto-switch short/full based on available width across all tabs.
2026-05-28 15:20:12 -04:00
lerko 217276ca18 fix(tui): correct table border overhead calculation
CI / test (pull_request) Successful in 2m54s
CI / lint (pull_request) Successful in 1m6s
CI / vulncheck (pull_request) Successful in 56s
Was hardcoded to 30 — actual overhead is 2 (borders) + numCols-1
(separators) = 10 for 9 columns. The 20-char gap was being
redistributed by lipgloss into columns like # making them too wide.
2026-05-28 15:11:29 -04:00
lerko 2e489cdc1a fix(tui): apply Width/MaxWidth to header row cells too
CI / test (pull_request) Successful in 2m36s
CI / lint (pull_request) Successful in 1m1s
CI / vulncheck (pull_request) Successful in 54s
Header row was returning bare tableHeaderStyle with no width constraints,
letting lipgloss table-level Width() inflate the # column.
2026-05-28 15:04:38 -04:00
lerko 2569a252ff 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.
2026-05-28 14:18:32 -04:00
lerko 9121b79582 fix(tui): prevent # and SSL columns from expanding unnecessarily
CI / test (pull_request) Successful in 2m48s
CI / lint (pull_request) Successful in 1m12s
CI / vulncheck (pull_request) Successful in 56s
Set min=max for columns that don't benefit from extra width.
Surplus space goes to sparkline instead.
2026-05-28 13:58:04 -04:00
lerko 2c78c60d08 fix(tui): set explicit NAME column width to match content truncation
CI / test (pull_request) Successful in 2m41s
CI / lint (pull_request) Successful in 1m11s
CI / vulncheck (pull_request) Successful in 56s
Was width=0 (auto) which let lipgloss over-allocate the column,
causing visible empty space between truncated names and TYPE column.
Now set to nameW explicitly so column width = truncation limit.
2026-05-28 13:52:24 -04:00
lerko c5477c7ef6 fix(tui): size NAME column to actual content, surplus goes to sparkline
CI / test (pull_request) Successful in 2m44s
CI / lint (pull_request) Successful in 1m12s
CI / vulncheck (pull_request) Successful in 56s
Compute max monitor name length and cap NAME column to that + 4 (icon/padding).
Extra space goes to HISTORY sparkline instead of dead whitespace.
2026-05-28 13:39:00 -04:00
lerko ecdb1a6632 fix(tui): increase LAT/UPTIME min column widths to prevent wrapping
CI / test (pull_request) Successful in 2m59s
CI / lint (pull_request) Successful in 1m16s
CI / vulncheck (pull_request) Successful in 1m2s
LAT min 5→7 (fits '142ms' + padding), UPTIME min 5→8 (fits '100.0%' + padding).
2026-05-28 13:35:55 -04:00
lerko 82d7b2942b feat(tui): responsive table columns — expand headers with terminal width
CI / test (pull_request) Successful in 2m48s
CI / lint (pull_request) Successful in 1m17s
CI / vulncheck (pull_request) Successful in 51s
Replace hardcoded column widths with dynamic layout system:
- Each column has short/full header and min/max width
- At narrow terminals: LAT, UP%, RT, compact widths
- At wide terminals: LATENCY, UPTIME, RETRIES, expanded widths
- Surplus space distributed left-to-right across expandable columns
- Headers switch between short/full based on actual column width

Column definitions:
  # (4-6)  TYPE (8-10)  STATUS (8-10)  LAT/LATENCY (5-10)
  UP%/UPTIME (5-8)  SSL (5-7)  RT/RETRIES (5-9)
2026-05-28 13:28:08 -04:00
lerko af5246e777 chore(tui): visual polish — detail sections, column headers, alert detail
CI / test (pull_request) Successful in 2m41s
CI / lint (pull_request) Successful in 1m12s
CI / vulncheck (pull_request) Successful in 51s
Detail panel:
- Grouped fields into sections (ENDPOINT, TIMING, HTTP, CONFIG)
- Omit Timeout when 0 (unconfigured)
- Omit Method when default GET
- Show explicit "200-299" when AcceptedCodes empty

Table:
- LATENCY header → LAT (design short, never truncate)

Alerts:
- Press [i] for alert detail panel: full config, health status,
  send counts, last error
- Keybinding display updated with [i]Info

Bundled remaining UX polish items from screenshot review.
2026-05-28 13:18:27 -04:00