feat(tui): consolidate tabs 6→3, add log sidebar #145

Merged
lerko merged 5 commits from feat/tab-consolidation into main 2026-06-20 22:32:33 +00:00
Owner

Summary

Major TUI layout refactor — fewer tabs, more information density.

Tab consolidation (6→3):

  • Monitors | Maint | Settings replaces Monitors | Alerts | Logs | Nodes | Maint | Users
  • Settings tab has sub-sections (Alerts / Nodes / Users) navigated with ←/→
  • All keybindings, CRUD, delete confirmation, cursor state work per-section
  • Named tab constants replace magic numbers throughout

Log sidebar:

  • Monitors tab shows a compact log stream on the right (70/30 split) at >= 120 cols
  • Single-char severity icons (▼▲◆●·), truncated messages, stripped "Monitor " prefix
  • Below 120 cols, monitors render full-width without sidebar

Responsive layout:

  • Tables adapt to panel width via contentWidth field (not terminal width)
  • Columns hide at breakpoints relative to the panel, not the terminal
  • Sidebar hard-clamped with lipgloss MaxWidth — no line wrapping

Design items P4a + P4c from tui-polish-design.local.md.

Test plan

  • Tab switching cycles through 3 tabs (Monitors → Maint → Settings → wrap)
  • Settings sub-sections switch with ←/→ arrows
  • CRUD operations work on each Settings section (n/e/d on Alerts, Users)
  • Alert test (t) works from Settings > Alerts
  • Delete confirmation routes correctly from all tabs/sections
  • Log sidebar appears at >= 120 cols, disappears below
  • Monitor table columns adapt — no row wrapping at any width
  • Log sidebar lines don't overflow panel boundary
  • Detail panel (i) still works from Monitors tab
  • Theme switching works from all tabs
## Summary Major TUI layout refactor — fewer tabs, more information density. **Tab consolidation (6→3):** - `Monitors | Maint | Settings` replaces `Monitors | Alerts | Logs | Nodes | Maint | Users` - Settings tab has sub-sections (Alerts / Nodes / Users) navigated with ←/→ - All keybindings, CRUD, delete confirmation, cursor state work per-section - Named tab constants replace magic numbers throughout **Log sidebar:** - Monitors tab shows a compact log stream on the right (70/30 split) at >= 120 cols - Single-char severity icons (▼▲◆●·), truncated messages, stripped "Monitor " prefix - Below 120 cols, monitors render full-width without sidebar **Responsive layout:** - Tables adapt to panel width via `contentWidth` field (not terminal width) - Columns hide at breakpoints relative to the panel, not the terminal - Sidebar hard-clamped with lipgloss MaxWidth — no line wrapping Design items P4a + P4c from `tui-polish-design.local.md`. ## Test plan - [x] Tab switching cycles through 3 tabs (Monitors → Maint → Settings → wrap) - [x] Settings sub-sections switch with ←/→ arrows - [x] CRUD operations work on each Settings section (n/e/d on Alerts, Users) - [x] Alert test (t) works from Settings > Alerts - [x] Delete confirmation routes correctly from all tabs/sections - [x] Log sidebar appears at >= 120 cols, disappears below - [x] Monitor table columns adapt — no row wrapping at any width - [x] Log sidebar lines don't overflow panel boundary - [x] Detail panel (i) still works from Monitors tab - [x] Theme switching works from all tabs
lerko added 5 commits 2026-06-20 22:27:51 +00:00
Tab bar: Monitors | Maint | Settings (was 6 tabs).

Settings tab merges Alerts, Nodes, Users as sub-sections with
left/right arrow navigation. Each section keeps its own cursor,
keybindings, and CRUD operations.

Monitors tab now shows a log sidebar at >= 120 cols (70/30 split).
Under 120 cols, monitors render full-width without logs.

- Introduced tab constants (tabMonitors, tabMaint, tabSettings)
- Introduced section constants (sectionAlerts, sectionNodes, sectionUsers)
- Removed stateLogs and stateUsers states
- All magic tab numbers replaced with named constants
Replace full viewLogsTab with compact sidebar renderer for the 70/30
monitors split. Single-char severity icons (▼▲◆●·), truncated messages,
no header chrome. Renders directly from engine logs without viewport.
Table columns were computed from terminal width, causing row wrapping
when the monitors panel only gets 70% of the space. Introduced
contentWidth field set per-tab in viewDashboard. computeLayout,
isWide, and renderTable now use contentWidth for column visibility,
available space, and max table width calculations.

Columns gracefully hide (SSL, RETRIES, TYPE, UPTIME) when the panel
is narrower, matching the existing responsive breakpoint behavior.
Log lines now hard-clamped to panel width via lipgloss MaxWidth.
Stripped "Monitor " and "Push " prefixes from sidebar messages —
redundant in a monitoring app, saves 8 chars per line. Improved
prefix width calculation to prevent line wrapping at narrow widths.
fix(tui): align log sidebar with monitor table top edge
CI / test (pull_request) Successful in 1m42s
CI / lint (pull_request) Successful in 1m16s
CI / vulncheck (pull_request) Successful in 51s
060cd24de2
lerko merged commit 060cd24de2 into main 2026-06-20 22:32:33 +00:00
lerko deleted branch feat/tab-consolidation 2026-06-20 22:32:33 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lerkolabs/uptop#145