@@ -27,9 +27,7 @@ type CommandType uint
2727func (c CommandType) String() string { return []string{"System", "User", "MCP"}[c] }
2828
2929const (
30− sidebarCompactModeBreakpoint = 120
31− defaultCommandsDialogMaxHeight = 20
32− defaultCommandsDialogMaxWidth = 70
30+ sidebarCompactModeBreakpoint = 120
3331)
3432
3533const (
@@ -155,19 +153,17 @@ func (c *Commands) HandleMsg(msg tea.Msg) Action {
155153 c.list.Focus()
156154 if c.list.IsSelectedFirst() {
157155 c.list.SelectLast()
158− c.list.ScrollToBottom()
159− break
156+ } else {
157+ c.list.SelectPrev()
160158 }
161− c.list.SelectPrev()
162159 c.list.ScrollToSelected()
163160 case key.Matches(msg, c.keyMap.Next):
164161 c.list.Focus()
165162 if c.list.IsSelectedLast() {
166163 c.list.SelectFirst()
167− c.list.ScrollToTop()
168− break
164+ } else {
165+ c.list.SelectNext()
169166 }
170− c.list.SelectNext()
171167 c.list.ScrollToSelected()
172168 case key.Matches(msg, c.keyMap.Select):
173169 if selectedItem := c.list.SelectedItem(); selectedItem != nil {
@@ -240,8 +236,8 @@ func commandsRadioView(sty *styles.Styles, selected CommandType, hasUserCmds boo
240236// Draw implements [Dialog].
241237func (c *Commands) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
242238 t := c.com.Styles
243− width := max(0, min(defaultCommandsDialogMaxWidth, area.Dx()-t.Dialog.View.GetHorizontalBorderSize()))
244− height := max(0, min(defaultCommandsDialogMaxHeight, area.Dy()-t.Dialog.View.GetVerticalBorderSize()))
239+ width := max(0, min(defaultDialogMaxWidth, area.Dx()-t.Dialog.View.GetHorizontalBorderSize()))
240+ height := max(0, min(defaultDialogHeight, area.Dy()-t.Dialog.View.GetVerticalBorderSize()))
245241 if area.Dx() != c.windowWidth && c.selected == SystemCommands {
246242 c.windowWidth = area.Dx()
247243 // since some items in the list depend on width (e.g. toggle sidebar command),