feat(tui): click anywhere in row to select monitor or maint item
CI / test (pull_request) Successful in 1m56s
CI / lint (pull_request) Successful in 1m22s
CI / vulncheck (pull_request) Successful in 56s

Use panel zone Pos() to compute clicked row from Y offset instead of
per-cell zone matching. Monitors and maint strip both support full-row
click selection.
This commit was merged in pull request #167.
This commit is contained in:
2026-06-30 23:06:00 -04:00
parent 0484153103
commit f0d97f5562
+17 -17
View File
@@ -868,9 +868,26 @@ func (m *Model) handleClick(msg tea.MouseMsg) (tea.Model, tea.Cmd) {
if m.bottomPanel == bottomMaint && m.zones.Get("panel-maint").InBounds(msg) { if m.bottomPanel == bottomMaint && m.zones.Get("panel-maint").InBounds(msg) {
m.focusedPanel = panelMaint m.focusedPanel = panelMaint
_, relY := m.zones.Get("panel-maint").Pos(msg)
row := relY - 2
windows := m.activeMaintWindows()
if row >= 0 && row < len(windows) {
m.maintCursor = row
}
return m, nil return m, nil
} else if m.zones.Get("panel-monitors").InBounds(msg) { } else if m.zones.Get("panel-monitors").InBounds(msg) {
m.focusedPanel = panelMonitors m.focusedPanel = panelMonitors
_, relY := m.zones.Get("panel-monitors").Pos(msg)
row := relY - 4 + m.tableOffset
if row >= 0 && row < len(m.sites) {
m.cursor = row
m.syncSelectedID()
if m.detailOpen {
m.detailScrollOffset = 0
return m, m.loadDetailCmd(m.sites[m.cursor].ID)
}
}
return m, nil
} else if m.zones.Get("panel-logs").InBounds(msg) { } else if m.zones.Get("panel-logs").InBounds(msg) {
m.focusedPanel = panelLogs m.focusedPanel = panelLogs
return m, nil return m, nil
@@ -879,23 +896,6 @@ func (m *Model) handleClick(msg tea.MouseMsg) (tea.Model, tea.Cmd) {
return m, nil return m, nil
} }
end := m.tableOffset + m.maxTableRows
if end > len(m.sites) {
end = len(m.sites)
}
for i := m.tableOffset; i < end; i++ {
if m.zones.Get(fmt.Sprintf("site-%d", i)).InBounds(msg) {
m.cursor = i
m.syncSelectedID()
m.focusedPanel = panelMonitors
if m.detailOpen {
m.detailScrollOffset = 0
return m, m.loadDetailCmd(m.sites[m.cursor].ID)
}
return m, nil
}
}
return m, nil return m, nil
} }