From fa5c593c61775ffb3d14f02b06f784c696cea303 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Thu, 8 Jan 2026 15:01:12 -0500 Subject: [PATCH] fix(ui): dry up session dialog key bindings --- internal/ui/dialog/sessions.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/ui/dialog/sessions.go b/internal/ui/dialog/sessions.go index 13306cc87945d1dafe2240c08d04a2200d7c83b9..a60e900e12e5fc8578c077f0bc63257619cccc57 100644 --- a/internal/ui/dialog/sessions.go +++ b/internal/ui/dialog/sessions.go @@ -27,6 +27,7 @@ type Session struct { Select key.Binding Next key.Binding Previous key.Binding + UpDown key.Binding Close key.Binding } } @@ -74,6 +75,10 @@ func NewSessions(com *common.Common, selectedSessionID string) (*Session, error) key.WithKeys("up", "ctrl+p"), key.WithHelp("↑", "previous item"), ) + s.keyMap.UpDown = key.NewBinding( + key.WithKeys("up", "down"), + key.WithHelp("↑↓", "choose"), + ) s.keyMap.Close = CloseKey return s, nil @@ -167,12 +172,8 @@ func (s *Session) View() string { // ShortHelp implements [help.KeyMap]. func (s *Session) ShortHelp() []key.Binding { - updown := key.NewBinding( - key.WithKeys("down", "up"), - key.WithHelp("↑↓", "choose"), - ) return []key.Binding{ - updown, + s.keyMap.UpDown, s.keyMap.Select, s.keyMap.Close, }