refactor(tui): two-tier responsive table layout (compact/wide at 120 cols)
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.
This commit is contained in:
@@ -100,16 +100,15 @@ func (m Model) viewMaintTab() string {
|
||||
return "\n No maintenance windows or incidents. Press [n] to create one."
|
||||
}
|
||||
|
||||
cols := []colDef{
|
||||
{"#", "#", 4, 4, false},
|
||||
{"TITLE", "TITLE", 12, 24, false},
|
||||
{"TYPE", "TYPE", 13, 14, false},
|
||||
{"MON", "MONITORS", 14, 22, true},
|
||||
{"ST", "STATUS", 11, 12, false},
|
||||
{"START", "STARTED", 14, 16, false},
|
||||
{"ENDS", "ENDS", 14, 16, false},
|
||||
var headers []string
|
||||
var widths []int
|
||||
if m.isWide() {
|
||||
headers = []string{"#", "TITLE", "TYPE", "MONITORS", "STATUS", "STARTED", "ENDS"}
|
||||
widths = []int{4, 24, 14, 22, 12, 16, 16}
|
||||
} else {
|
||||
headers = []string{"#", "TITLE", "TYPE", "MON", "ST", "START", "ENDS"}
|
||||
widths = []int{4, 14, 13, 14, 11, 14, 14}
|
||||
}
|
||||
headers, widths := m.computeTableLayout(cols, 0)
|
||||
titleW := widths[1]
|
||||
monW := widths[3]
|
||||
timeW := widths[5]
|
||||
|
||||
Reference in New Issue
Block a user