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:
@@ -32,13 +32,15 @@ func (m Model) viewUsersTab() string {
|
||||
return "\n No users configured. Press [n] to add one."
|
||||
}
|
||||
|
||||
cols := []colDef{
|
||||
{"#", "#", 4, 4, false},
|
||||
{"USER", "USERNAME", 10, 18, false},
|
||||
{"ROLE", "ROLE", 8, 10, false},
|
||||
{"KEY", "PUBLIC KEY", 20, 60, true},
|
||||
var headers []string
|
||||
var widths []int
|
||||
if m.isWide() {
|
||||
headers = []string{"#", "USERNAME", "ROLE", "PUBLIC KEY"}
|
||||
widths = []int{4, 18, 10, 50}
|
||||
} else {
|
||||
headers = []string{"#", "USER", "ROLE", "KEY"}
|
||||
widths = []int{4, 14, 8, 30}
|
||||
}
|
||||
headers, widths := m.computeTableLayout(cols, 0)
|
||||
userW := widths[1]
|
||||
|
||||
return m.renderTable(
|
||||
|
||||
Reference in New Issue
Block a user