feat(tui): column sort with indicator on monitors table

Press < / > to cycle sort column (Status, Name, Latency). Press r to
reverse direction. Sorted column shows ▲/▼ arrow in the header.

Groups always float to top. Sort applies to ungrouped monitors and
group children independently. Default: Status descending (DOWN first).
This commit is contained in:
2026-06-21 19:09:42 -04:00
parent 4af800a359
commit d982359f25
6 changed files with 70 additions and 8 deletions
+17
View File
@@ -532,6 +532,23 @@ func (m *Model) handleDashboardKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
m.recalcLayout()
return m, nil
}
case ">", ".":
if m.currentTab == tabMonitors {
m.sortColumn = (m.sortColumn + 1) % sortMax
m.sortAsc = false
m.refreshLive()
}
case "<", ",":
if m.currentTab == tabMonitors {
m.sortColumn = (m.sortColumn - 1 + sortMax) % sortMax
m.sortAsc = false
m.refreshLive()
}
case "r":
if m.currentTab == tabMonitors {
m.sortAsc = !m.sortAsc
m.refreshLive()
}
case "tab":
m.switchTab(m.currentTab + 1)
case "left":