detached 293ffa3

fix(omnibox): log applied top margin and tighten result limit tests

commit
293ffa33635de40597d4ac6d61ec387c86eb39fb
author
brice · · 2026-10-10 01:07 UTC
parent
36bf68a
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +5 -5
M internal/ui/component/omnibox.go +3 -3
@@ -2814,6 +2814,9 @@ func (o *Omnibox) Show(ctx context.Context, query string) {
28142814 parentHeight = o.parentOverlay.GetAllocatedHeight()
28152815 }
28162816 width, marginTop := o.requestedDimensions()
2817+ if omniboxValign(o.sizeCfg) == gtk.AlignCenterValue {
2818+ marginTop = 0 // centered by GTK; a margin would push it off-center
2819+ }
28172820 log.Debug().
28182821 Int("parentWidth", parentWidth).
28192822 Int("parentHeight", parentHeight).
@@ -2827,9 +2830,6 @@ func (o *Omnibox) Show(ctx context.Context, query string) {
28272830 Msg("omnibox geometry decision")
28282831
28292832 o.mainBox.SetSizeRequest(width, -1)
2830- if omniboxValign(o.sizeCfg) == gtk.AlignCenterValue {
2831- marginTop = 0 // centered by GTK; a margin would push it off-center
2832- }
28332833 o.outerBox.SetMarginTop(marginTop)
28342834
28352835 // Show the omnibox
@@ -2814,6 +2814,9 @@ func (o *Omnibox) Show(ctx context.Context, query string) {
2814 parentHeight = o.parentOverlay.GetAllocatedHeight()2814 parentHeight = o.parentOverlay.GetAllocatedHeight()
2815 }2815 }
2816 width, marginTop := o.requestedDimensions()2816 width, marginTop := o.requestedDimensions()
2817+ if omniboxValign(o.sizeCfg) == gtk.AlignCenterValue {
2818+ marginTop = 0 // centered by GTK; a margin would push it off-center
2819+ }
2817 log.Debug().2820 log.Debug().
2818 Int("parentWidth", parentWidth).2821 Int("parentWidth", parentWidth).
2819 Int("parentHeight", parentHeight).2822 Int("parentHeight", parentHeight).
@@ -2827,9 +2830,6 @@ func (o *Omnibox) Show(ctx context.Context, query string) {
2827 Msg("omnibox geometry decision")2830 Msg("omnibox geometry decision")
2828 2831
2829 o.mainBox.SetSizeRequest(width, -1)2832 o.mainBox.SetSizeRequest(width, -1)
2830- if omniboxValign(o.sizeCfg) == gtk.AlignCenterValue {
2831- marginTop = 0 // centered by GTK; a margin would push it off-center
2832- }
2833 o.outerBox.SetMarginTop(marginTop)2833 o.outerBox.SetMarginTop(marginTop)
2834 2834
2835 // Show the omnibox2835 // Show the omnibox
M internal/ui/component/omnibox_navigation_state_test.go +1 -1
@@ -360,7 +360,7 @@ func TestVisibleGhostSuggestion(t *testing.T) {
360360 }
361361 }
362362
363-func TestVisibleGhostSuggestionRespectsVisibleLimit(t *testing.T) {
363+func TestVisibleGhostSuggestionRespectsResultLimit(t *testing.T) {
364364 suggestions := []Suggestion{
365365 {URL: "https://github.com/bnema/dumber"},
366366 {URL: "https://gitlab.com/team/project"},
@@ -360,7 +360,7 @@ func TestVisibleGhostSuggestion(t *testing.T) {
360 }360 }
361 }361 }
362 362
363-func TestVisibleGhostSuggestionRespectsVisibleLimit(t *testing.T) {363+func TestVisibleGhostSuggestionRespectsResultLimit(t *testing.T) {
364 suggestions := []Suggestion{364 suggestions := []Suggestion{
365 {URL: "https://github.com/bnema/dumber"},365 {URL: "https://github.com/bnema/dumber"},
366 {URL: "https://gitlab.com/team/project"},366 {URL: "https://gitlab.com/team/project"},
M internal/ui/component/omnibox_suggestions_test.go +1 -1
@@ -79,7 +79,7 @@ func TestNavigableCount(t *testing.T) {
7979 bangs, suggestions, favorites int
8080 want int
8181 }{
82- {"history beyond visible rows", false, ViewModeHistory, 0, limit, 30, limit},
82+ {"history capped at results limit", false, ViewModeHistory, 0, limit + 5, 30, limit},
8383 {"favorites capped at results limit", false, ViewModeFavorites, 0, 3, 30, limit},
8484 {"bangs win over view mode", true, ViewModeHistory, 2, 8, 0, 2},
8585 {"empty list", false, ViewModeFavorites, 4, 4, 0, 0},
@@ -79,7 +79,7 @@ func TestNavigableCount(t *testing.T) {
79 bangs, suggestions, favorites int79 bangs, suggestions, favorites int
80 want int80 want int
81 }{81 }{
82- {"history beyond visible rows", false, ViewModeHistory, 0, limit, 30, limit},82+ {"history capped at results limit", false, ViewModeHistory, 0, limit + 5, 30, limit},
83 {"favorites capped at results limit", false, ViewModeFavorites, 0, 3, 30, limit},83 {"favorites capped at results limit", false, ViewModeFavorites, 0, 3, 30, limit},
84 {"bangs win over view mode", true, ViewModeHistory, 2, 8, 0, 2},84 {"bangs win over view mode", true, ViewModeHistory, 2, 8, 0, 2},
85 {"empty list", false, ViewModeFavorites, 4, 4, 0, 0},85 {"empty list", false, ViewModeFavorites, 4, 4, 0, 0},

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 8

Tags 42

↑↓ moveenter openesc close