detached 56e959c

fix(omnibox): improve layout with max width constraint and consistent row heights

commit
56e959cc0ab0d652a72fac110ea9ff240ea81c2c
author
brice · · 2025-12-16 21:41 UTC
committer
brice · · 2025-12-16 21:51 UTC
parent
fa675ef
signature
unsigned
2 files · +8 -0
M internal/ui/component/omnibox.go +7 -0
@@ -20,6 +20,7 @@ import (
2020
2121 const (
2222 omniboxWidthPct = 0.8 // 80% of parent window width
23+ omniboxMaxWidth = 800 // Maximum width in pixels
2324 omniboxHeightPct = 0.6 // 60% of parent window height
2425 omniboxMaxResults = 10
2526 debounceDelayMs = 150
@@ -199,6 +200,9 @@ func (o *Omnibox) resizeAndCenter(rowCount int) {
199200 }
200201
201202 width := int(float64(parentWidth) * omniboxWidthPct)
203+ if width > omniboxMaxWidth {
204+ width = omniboxMaxWidth
205+ }
202206
203207 // Cap at max results
204208 if rowCount > omniboxMaxResults {
@@ -1134,6 +1138,9 @@ func (o *Omnibox) Show(ctx context.Context, query string) {
11341138 parentWidth := o.parentOverlay.GetAllocatedWidth()
11351139 parentHeight := o.parentOverlay.GetAllocatedHeight()
11361140 width := int(float64(parentWidth) * omniboxWidthPct)
1141+ if width > omniboxMaxWidth {
1142+ width = omniboxMaxWidth
1143+ }
11371144 marginTop := int(float64(parentHeight) * 0.20) // 20% from top
11381145
11391146 o.mainBox.SetSizeRequest(width, -1)
@@ -20,6 +20,7 @@ import (
20 20
21 const (21 const (
22 omniboxWidthPct = 0.8 // 80% of parent window width22 omniboxWidthPct = 0.8 // 80% of parent window width
23+ omniboxMaxWidth = 800 // Maximum width in pixels
23 omniboxHeightPct = 0.6 // 60% of parent window height24 omniboxHeightPct = 0.6 // 60% of parent window height
24 omniboxMaxResults = 1025 omniboxMaxResults = 10
25 debounceDelayMs = 15026 debounceDelayMs = 150
@@ -199,6 +200,9 @@ func (o *Omnibox) resizeAndCenter(rowCount int) {
199 }200 }
200 201
201 width := int(float64(parentWidth) * omniboxWidthPct)202 width := int(float64(parentWidth) * omniboxWidthPct)
203+ if width > omniboxMaxWidth {
204+ width = omniboxMaxWidth
205+ }
202 206
203 // Cap at max results207 // Cap at max results
204 if rowCount > omniboxMaxResults {208 if rowCount > omniboxMaxResults {
@@ -1134,6 +1138,9 @@ func (o *Omnibox) Show(ctx context.Context, query string) {
1134 parentWidth := o.parentOverlay.GetAllocatedWidth()1138 parentWidth := o.parentOverlay.GetAllocatedWidth()
1135 parentHeight := o.parentOverlay.GetAllocatedHeight()1139 parentHeight := o.parentOverlay.GetAllocatedHeight()
1136 width := int(float64(parentWidth) * omniboxWidthPct)1140 width := int(float64(parentWidth) * omniboxWidthPct)
1141+ if width > omniboxMaxWidth {
1142+ width = omniboxMaxWidth
1143+ }
1137 marginTop := int(float64(parentHeight) * 0.20) // 20% from top1144 marginTop := int(float64(parentHeight) * 0.20) // 20% from top
1138 1145
1139 o.mainBox.SetSizeRequest(width, -1)1146 o.mainBox.SetSizeRequest(width, -1)
M internal/ui/theme/css.go +1 -0
@@ -201,6 +201,7 @@ entry.omnibox-entry > *:focus-visible {
201201 border-left: 0.1875em solid transparent;
202202 border-bottom: 0.0625em solid alpha(var(--border), 0.5);
203203 transition: background-color 100ms ease-in-out, border-left-color 100ms ease-in-out;
204+ min-height: 2.75em;
204205 }
205206
206207 .omnibox-row:last-child {
@@ -201,6 +201,7 @@ entry.omnibox-entry > *:focus-visible {
201 border-left: 0.1875em solid transparent;201 border-left: 0.1875em solid transparent;
202 border-bottom: 0.0625em solid alpha(var(--border), 0.5);202 border-bottom: 0.0625em solid alpha(var(--border), 0.5);
203 transition: background-color 100ms ease-in-out, border-left-color 100ms ease-in-out;203 transition: background-color 100ms ease-in-out, border-left-color 100ms ease-in-out;
204+ min-height: 2.75em;
204 }205 }
205 206
206 .omnibox-row:last-child {207 .omnibox-row:last-child {

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