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:
@@ -10,14 +10,15 @@ func (m Model) viewNodesTab() string {
|
||||
return "\n No probe nodes connected."
|
||||
}
|
||||
|
||||
cols := []colDef{
|
||||
{"NAME", "NAME", 12, 24, true},
|
||||
{"REGION", "REGION", 8, 14, false},
|
||||
{"SEEN", "LAST SEEN", 8, 20, false},
|
||||
{"VER", "VERSION", 8, 12, false},
|
||||
{"STATUS", "STATUS", 8, 10, false},
|
||||
var headers []string
|
||||
var widths []int
|
||||
if m.isWide() {
|
||||
headers = []string{"NAME", "REGION", "LAST SEEN", "VERSION", "STATUS"}
|
||||
widths = []int{24, 14, 16, 12, 10}
|
||||
} else {
|
||||
headers = []string{"NAME", "REGION", "SEEN", "VER", "STATUS"}
|
||||
widths = []int{16, 10, 10, 8, 8}
|
||||
}
|
||||
headers, widths := m.computeTableLayout(cols, 0)
|
||||
nameW := widths[0]
|
||||
|
||||
return m.renderTable(
|
||||
|
||||
Reference in New Issue
Block a user