fix(tui): forward all msg types to huh forms, improve row selection UX

Huh forms need all message types (timers, resize, etc.) not just
KeyMsg to function. Restructured Update to delegate all messages to
huh when in form state. Fixed selected row style to be visually
distinct from header (white text on darker bg). Moved click zone
from narrow ID cell to wider Name cell for better click targets.
This commit is contained in:
2026-05-14 01:27:17 -04:00
parent 5a8e016183
commit c24bb7a0d4
-23
View File
@@ -157,29 +157,6 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
} }
switch m.state { switch m.state {
case stateFormSite, stateFormAlert, stateFormUser:
if msg.String() == "esc" {
m.huhForm = nil
m.state = stateDashboard
if m.currentTab == 3 {
m.state = stateUsers
}
return m, nil
}
if m.huhForm != nil {
form, formCmd := m.huhForm.Update(msg)
if f, ok := form.(*huh.Form); ok {
m.huhForm = f
}
if m.huhForm.State == huh.StateCompleted {
m.submitForm()
m.refreshData()
m.huhForm = nil
}
return m, formCmd
}
case stateDashboard, stateLogs, stateUsers: case stateDashboard, stateLogs, stateUsers:
switch msg.String() { switch msg.String() {
case "q": case "q":