From c4cdc5dee1ce6c86f9d86b03d8845120f8c804f6 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Thu, 8 Jan 2026 11:13:32 -0500 Subject: [PATCH] fix(ui): dry up up/down key binding in dialog commands --- internal/ui/dialog/commands.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/ui/dialog/commands.go b/internal/ui/dialog/commands.go index b560fb8478f267b9ec3aa26938787aa2954a2e39..da95a252c044378690f3cf3f8cfbdde8a124349b 100644 --- a/internal/ui/dialog/commands.go +++ b/internal/ui/dialog/commands.go @@ -31,6 +31,7 @@ type Commands struct { com *common.Common keyMap struct { Select, + UpDown, Next, Previous, Tab, @@ -87,6 +88,10 @@ func NewCommands(com *common.Common, sessionID string) (*Commands, error) { key.WithKeys("enter", "ctrl+y"), key.WithHelp("enter", "confirm"), ) + c.keyMap.UpDown = key.NewBinding( + key.WithKeys("up", "down"), + key.WithHelp("↑/↓", "choose"), + ) c.keyMap.Next = key.NewBinding( key.WithKeys("down", "ctrl+n"), key.WithHelp("↓", "next item"), @@ -240,13 +245,9 @@ func (c *Commands) View() string { // ShortHelp implements [help.KeyMap]. func (c *Commands) ShortHelp() []key.Binding { - upDown := key.NewBinding( - key.WithKeys("up", "down"), - key.WithHelp("↑/↓", "choose"), - ) return []key.Binding{ c.keyMap.Tab, - upDown, + c.keyMap.UpDown, c.keyMap.Select, c.keyMap.Close, }