detached 00b3d9d

fix(tui): align slash popup descriptions across built-in + extension commands

The slash-command popup padded every command name to 10 chars. Any
command longer than 10 (/reload-ext at 11, /clear-notes at 12)
skipped the padding entirely, so its description started further
right than the others, breaking column alignment between the
built-in section and the extension section.

Fix: compute the widest name across the whole match list (both
groups) and pad every row to that width. Minimum 10 so short lists
don't look cramped. Both sections now share one description
column x-position.
commit
00b3d9dc76278e1964bd068a1ffda3ff390dac70
author
patriceckhart · · 2026-04-19 17:34 UTC
parent
1303e18
signature
unsigned
refs
tag: v0.0.46
1 file · +15 -2
M internal/agent/modes/slash_suggest.go +15 -2
@@ -316,6 +316,19 @@ func (s *slashSuggester) Render(input string, th tui.Theme, width int) []string
316316 }
317317 }
318318 }
319+ // Compute the widest command name across the whole match list
320+ // (built-ins + extension-contributed) so every row's description
321+ // starts at the same x-position. A minimum keeps short lists
322+ // from collapsing the descriptions into the name column.
323+ nameWidth := 10
324+ for _, c := range m {
325+ if c.Header {
326+ continue
327+ }
328+ if n := len(c.Name); n > nameWidth {
329+ nameWidth = n
330+ }
331+ }
319332 var lines []string
320333 for i, c := range m {
321334 if c.Header {
@@ -332,8 +345,8 @@ func (s *slashSuggester) Render(input string, th tui.Theme, width int) []string
332345 continue
333346 }
334347 name := c.Name
335- if len(name) < 10 {
336- name = name + strings.Repeat(" ", 10-len(name))
348+ if len(name) < nameWidth {
349+ name = name + strings.Repeat(" ", nameWidth-len(name))
337350 }
338351 plain := " " + name + " " + c.Desc
339352 if i == s.cursor {
@@ -316,6 +316,19 @@ func (s *slashSuggester) Render(input string, th tui.Theme, width int) []string
316 }316 }
317 }317 }
318 }318 }
319+ // Compute the widest command name across the whole match list
320+ // (built-ins + extension-contributed) so every row's description
321+ // starts at the same x-position. A minimum keeps short lists
322+ // from collapsing the descriptions into the name column.
323+ nameWidth := 10
324+ for _, c := range m {
325+ if c.Header {
326+ continue
327+ }
328+ if n := len(c.Name); n > nameWidth {
329+ nameWidth = n
330+ }
331+ }
319 var lines []string332 var lines []string
320 for i, c := range m {333 for i, c := range m {
321 if c.Header {334 if c.Header {
@@ -332,8 +345,8 @@ func (s *slashSuggester) Render(input string, th tui.Theme, width int) []string
332 continue345 continue
333 }346 }
334 name := c.Name347 name := c.Name
335- if len(name) < 10 {348+ if len(name) < nameWidth {
336- name = name + strings.Repeat(" ", 10-len(name))349+ name = name + strings.Repeat(" ", nameWidth-len(name))
337 }350 }
338 plain := " " + name + " " + c.Desc351 plain := " " + name + " " + c.Desc
339 if i == s.cursor {352 if i == s.cursor {

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