detached 757e158

Remove pagination from slash command popup

Slash command list now renders every match at once; the (x/y) counter and page-window slicing only made sense when the popup was capped at a page. Subview pickers (login provider, jump turns, etc.) keep their pagination.
commit
757e158e8ef37076b7aae97ed83d18165119ef25
author
patriceckhart · · 2026-05-24 12:39 UTC
parent
cd4484d
signature
unsigned
refs
tag: v0.1.93
1 file · +1 -24
M internal/agent/modes/slash_suggest.go +1 -24
@@ -1,7 +1,6 @@
11 package modes
22
33 import (
4- "fmt"
54 "sort"
65 "strings"
76
@@ -370,24 +369,6 @@ func (s *slashSuggester) Selection(input string) string {
370369 return m[s.cursor].Name
371370 }
372371
373-func (s *slashSuggester) page(total int) (start, end int) {
374- if total <= slashSuggestPageSize {
375- return 0, total
376- }
377- if s.cursor < 0 {
378- s.cursor = 0
379- }
380- if s.cursor >= total {
381- s.cursor = total - 1
382- }
383- start = (s.cursor / slashSuggestPageSize) * slashSuggestPageSize
384- end = start + slashSuggestPageSize
385- if end > total {
386- end = total
387- }
388- return start, end
389-}
390-
391372 // Render returns the popup lines or nil.
392373 func (s *slashSuggester) Render(input string, th tui.Theme, width int) []string {
393374 m := s.matches(input)
@@ -418,9 +399,8 @@ func (s *slashSuggester) Render(input string, th tui.Theme, width int) []string
418399 nameWidth = n
419400 }
420401 }
421- start, end := s.page(len(m))
422402 var lines []string
423- for i := start; i < end; i++ {
403+ for i := 0; i < len(m); i++ {
424404 c := m[i]
425405 if c.Header {
426406 // Breathing room around group dividers — a blank row
@@ -446,9 +426,6 @@ func (s *slashSuggester) Render(input string, th tui.Theme, width int) []string
446426 lines = append(lines, th.FG256(th.Muted, plain))
447427 }
448428 }
449- if len(m) > slashSuggestPageSize {
450- lines = append(lines, th.FG256(th.Muted, fmt.Sprintf(" (%d/%d)", s.cursor+1, len(m))))
451- }
452429 // Blank row before the hint visually detaches it from the
453430 // command list and groups it with its trailing blank.
454431 lines = append(lines, "")
@@ -1,7 +1,6 @@
1 package modes1 package modes
2 2
3 import (3 import (
4- "fmt"
5 "sort"4 "sort"
6 "strings"5 "strings"
7 6
@@ -370,24 +369,6 @@ func (s *slashSuggester) Selection(input string) string {
370 return m[s.cursor].Name369 return m[s.cursor].Name
371 }370 }
372 371
373-func (s *slashSuggester) page(total int) (start, end int) {
374- if total <= slashSuggestPageSize {
375- return 0, total
376- }
377- if s.cursor < 0 {
378- s.cursor = 0
379- }
380- if s.cursor >= total {
381- s.cursor = total - 1
382- }
383- start = (s.cursor / slashSuggestPageSize) * slashSuggestPageSize
384- end = start + slashSuggestPageSize
385- if end > total {
386- end = total
387- }
388- return start, end
389-}
390-
391 // Render returns the popup lines or nil.372 // Render returns the popup lines or nil.
392 func (s *slashSuggester) Render(input string, th tui.Theme, width int) []string {373 func (s *slashSuggester) Render(input string, th tui.Theme, width int) []string {
393 m := s.matches(input)374 m := s.matches(input)
@@ -418,9 +399,8 @@ func (s *slashSuggester) Render(input string, th tui.Theme, width int) []string
418 nameWidth = n399 nameWidth = n
419 }400 }
420 }401 }
421- start, end := s.page(len(m))
422 var lines []string402 var lines []string
423- for i := start; i < end; i++ {403+ for i := 0; i < len(m); i++ {
424 c := m[i]404 c := m[i]
425 if c.Header {405 if c.Header {
426 // Breathing room around group dividers — a blank row406 // Breathing room around group dividers — a blank row
@@ -446,9 +426,6 @@ func (s *slashSuggester) Render(input string, th tui.Theme, width int) []string
446 lines = append(lines, th.FG256(th.Muted, plain))426 lines = append(lines, th.FG256(th.Muted, plain))
447 }427 }
448 }428 }
449- if len(m) > slashSuggestPageSize {
450- lines = append(lines, th.FG256(th.Muted, fmt.Sprintf(" (%d/%d)", s.cursor+1, len(m))))
451- }
452 // Blank row before the hint visually detaches it from the429 // Blank row before the hint visually detaches it from the
453 // command list and groups it with its trailing blank.430 // command list and groups it with its trailing blank.
454 lines = append(lines, "")431 lines = append(lines, "")

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close