Improve action menu escape handling

Make the F11 action menu close through a shared close action so Escape and the explicit Close actions menu item follow the same path. Treat Escape-prefixed Up and Down events as close inputs while the action menu is active, which handles termbox InputAlt behavior after pressing Escape. Preserve and restore the user/channel tree selection across action menu open and close, and preserve selection across live tree rebuilds.

Tested with: GOCACHE=/tmp/barnard-go-cache go test ./...
This commit is contained in:
Storm Dragon committed 2026-06-28 23:57:29 -04:00
1 parent 5ac6703489
commit 342f934029
8 files changed
+343 -142

No files matched your search

+2 -2
View File
@@ -216,7 +216,7 @@ func (b *Barnard) OnUserChange(e *gumble.UserChangeEvent) {
b.AddOutputLine(formatUserStats(e.User))
}
b.updateUserChannel(e)
b.UiTree.Rebuild()
b.RebuildUserChannelTreePreservingSelection()
b.Ui.Refresh()
}
@@ -317,7 +317,7 @@ func (b *Barnard) OnChannelChange(e *gumble.ChannelChangeEvent) {
b.AddOutputLine(fmt.Sprintf("Channel permissions for %s: %s", e.Channel.Name, permissionList(*permission)))
}
}
b.UiTree.Rebuild()
b.RebuildUserChannelTreePreservingSelection()
b.Ui.Refresh()
}