detached 3cd9d2e

fix: clear ghost text on position timeout instead of forcing bad placement

commit
3cd9d2ea65d158fb5181636fdb654f0acf16801d
author
brice · · 2026-01-26 05:56 UTC
parent
d8bf31c
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
refs
tag: v0.26.2
1 file · +18 -4
M internal/ui/component/omnibox.go +18 -4
@@ -871,15 +871,29 @@ func (o *Omnibox) shouldSkipGhostUpdate(originalInput string) bool {
871871 }
872872
873873 func (o *Omnibox) ghostPositionReady(attempt int) bool {
874- if attempt >= ghostPositionMaxAttempts {
875- return true
876- }
877874 entryWidth := o.entry.GetAllocatedWidth()
878875 overlayWidth := 0
879876 if o.entryOverlay != nil {
880877 overlayWidth = o.entryOverlay.GetAllocatedWidth()
881878 }
882- return entryWidth > 0 && overlayWidth > 0
879+
880+ if entryWidth > 0 && overlayWidth > 0 {
881+ return true
882+ }
883+
884+ // Max attempts reached but widgets still not allocated - give up
885+ if attempt >= ghostPositionMaxAttempts {
886+ log := logging.FromContext(o.ctx)
887+ log.Debug().
888+ Int("attempt", attempt).
889+ Int("entryWidth", entryWidth).
890+ Int("overlayWidth", overlayWidth).
891+ Msg("ghost position timeout, clearing ghost text")
892+ o.clearGhostText()
893+ return false
894+ }
895+
896+ return false
883897 }
884898
885899 func (o *Omnibox) retryGhostPosition(originalInput, suffix string, attempt int) {
@@ -871,15 +871,29 @@ func (o *Omnibox) shouldSkipGhostUpdate(originalInput string) bool {
871 }871 }
872 872
873 func (o *Omnibox) ghostPositionReady(attempt int) bool {873 func (o *Omnibox) ghostPositionReady(attempt int) bool {
874- if attempt >= ghostPositionMaxAttempts {
875- return true
876- }
877 entryWidth := o.entry.GetAllocatedWidth()874 entryWidth := o.entry.GetAllocatedWidth()
878 overlayWidth := 0875 overlayWidth := 0
879 if o.entryOverlay != nil {876 if o.entryOverlay != nil {
880 overlayWidth = o.entryOverlay.GetAllocatedWidth()877 overlayWidth = o.entryOverlay.GetAllocatedWidth()
881 }878 }
882- return entryWidth > 0 && overlayWidth > 0879+
880+ if entryWidth > 0 && overlayWidth > 0 {
881+ return true
882+ }
883+
884+ // Max attempts reached but widgets still not allocated - give up
885+ if attempt >= ghostPositionMaxAttempts {
886+ log := logging.FromContext(o.ctx)
887+ log.Debug().
888+ Int("attempt", attempt).
889+ Int("entryWidth", entryWidth).
890+ Int("overlayWidth", overlayWidth).
891+ Msg("ghost position timeout, clearing ghost text")
892+ o.clearGhostText()
893+ return false
894+ }
895+
896+ return false
883 }897 }
884 898
885 func (o *Omnibox) retryGhostPosition(originalInput, suffix string, attempt int) {899 func (o *Omnibox) retryGhostPosition(originalInput, suffix string, attempt int) {

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