detached 162a4b9

fix: address review follow-ups for omnibox, webkit, updater, and config

commit
162a4b977c1fad6499dd8801127b3352879cfba3
author
brice · · 2026-02-07 08:31 UTC
parent
83a2b1b
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
4 files · +15 -2
M internal/infrastructure/config/loader.go +2 -0
@@ -274,6 +274,8 @@ func normalizePerformanceProfile(config *Config) {
274274 config.Performance.Profile = ProfileMax
275275 case string(ProfileCustom):
276276 config.Performance.Profile = ProfileCustom
277+ default:
278+ config.Performance.Profile = ProfileDefault
277279 }
278280 }
279281
@@ -274,6 +274,8 @@ func normalizePerformanceProfile(config *Config) {
274 config.Performance.Profile = ProfileMax274 config.Performance.Profile = ProfileMax
275 case string(ProfileCustom):275 case string(ProfileCustom):
276 config.Performance.Profile = ProfileCustom276 config.Performance.Profile = ProfileCustom
277+ default:
278+ config.Performance.Profile = ProfileDefault
277 }279 }
278 }280 }
279 281
M internal/infrastructure/updater/github.go +4 -0
@@ -311,6 +311,10 @@ func retryDelayForAttempt(attempt int, randInt63 func(n int64) int64) time.Durat
311311 return delay
312312 }
313313
314+// doRequestWithRetryHelper retries the same request instance across attempts.
315+// It assumes req.Body is non-consumable (for example http.NoBody); it does not clone
316+// the request or rewind req.Body. Callers needing retries with a real body must provide
317+// a fresh cloned request per attempt or use a rewindable body implementation.
314318 func doRequestWithRetryHelper(
315319 ctx context.Context,
316320 client *http.Client,
@@ -311,6 +311,10 @@ func retryDelayForAttempt(attempt int, randInt63 func(n int64) int64) time.Durat
311 return delay311 return delay
312 }312 }
313 313
314+// doRequestWithRetryHelper retries the same request instance across attempts.
315+// It assumes req.Body is non-consumable (for example http.NoBody); it does not clone
316+// the request or rewind req.Body. Callers needing retries with a real body must provide
317+// a fresh cloned request per attempt or use a rewindable body implementation.
314 func doRequestWithRetryHelper(318 func doRequestWithRetryHelper(
315 ctx context.Context,319 ctx context.Context,
316 client *http.Client,320 client *http.Client,
M internal/infrastructure/webkit/webview.go +2 -1
@@ -1486,8 +1486,9 @@ func shouldTerminateWebProcess(policy string, isRelated, navigationActive bool)
14861486 }
14871487
14881488 func classifyRunJSEvaluateError(err error) (nonFatal bool, signature string) {
1489+ // Defensive guard: callers should only pass non-nil errors, but tolerate nil safely.
14891490 if err == nil {
1490- return false, "evaluate_error"
1491+ return true, ""
14911492 }
14921493 msg := strings.ToLower(strings.TrimSpace(err.Error()))
14931494 signature = "evaluate_error:" + normalizeRunJSErrorSignature(msg)
@@ -1486,8 +1486,9 @@ func shouldTerminateWebProcess(policy string, isRelated, navigationActive bool)
1486 }1486 }
1487 1487
1488 func classifyRunJSEvaluateError(err error) (nonFatal bool, signature string) {1488 func classifyRunJSEvaluateError(err error) (nonFatal bool, signature string) {
1489+ // Defensive guard: callers should only pass non-nil errors, but tolerate nil safely.
1489 if err == nil {1490 if err == nil {
1490- return false, "evaluate_error"1491+ return true, ""
1491 }1492 }
1492 msg := strings.ToLower(strings.TrimSpace(err.Error()))1493 msg := strings.ToLower(strings.TrimSpace(err.Error()))
1493 signature = "evaluate_error:" + normalizeRunJSErrorSignature(msg)1494 signature = "evaluate_error:" + normalizeRunJSErrorSignature(msg)
M internal/ui/component/omnibox.go +7 -1
@@ -876,6 +876,7 @@ func (o *Omnibox) setGhostText(originalInput, suffix, fullText string) {
876876 o.ghostSuffix = suffix
877877 o.ghostFullText = fullText
878878 o.hasGhostText = true
879+ capturedToken := o.ghostToken
879880 o.mu.Unlock()
880881
881882 var cb glib.SourceFunc = func(uintptr) bool {
@@ -885,10 +886,14 @@ func (o *Omnibox) setGhostText(originalInput, suffix, fullText string) {
885886
886887 o.mu.RLock()
887888 currentInput := o.realInput
889+ currentToken := o.ghostToken
888890 o.mu.RUnlock()
889891 if currentInput != originalInput {
890892 return false
891893 }
894+ if capturedToken != currentToken {
895+ return false
896+ }
892897 o.mu.Lock()
893898 o.isAcceptingGhost = true
894899 o.mu.Unlock()
@@ -1962,6 +1967,7 @@ func (o *Omnibox) toggleFavorite() {
19621967 log.Debug().Msg("remove favorite: invalid ID")
19631968 return
19641969 }
1970+ entryText := o.entry.GetText()
19651971
19661972 go func() {
19671973 ctx := o.ctx
@@ -1989,7 +1995,7 @@ func (o *Omnibox) toggleFavorite() {
19891995 o.mu.RLock()
19901996 currentToken := o.searchToken
19911997 o.mu.RUnlock()
1992- o.loadFavorites(o.entry.GetText(), currentToken)
1998+ o.loadFavorites(entryText, currentToken)
19931999 if o.onToast != nil {
19942000 cb := glib.SourceFunc(func(_ uintptr) bool {
19952001 o.onToast(ctx, "Favorite removed", ToastSuccess)
@@ -876,6 +876,7 @@ func (o *Omnibox) setGhostText(originalInput, suffix, fullText string) {
876 o.ghostSuffix = suffix876 o.ghostSuffix = suffix
877 o.ghostFullText = fullText877 o.ghostFullText = fullText
878 o.hasGhostText = true878 o.hasGhostText = true
879+ capturedToken := o.ghostToken
879 o.mu.Unlock()880 o.mu.Unlock()
880 881
881 var cb glib.SourceFunc = func(uintptr) bool {882 var cb glib.SourceFunc = func(uintptr) bool {
@@ -885,10 +886,14 @@ func (o *Omnibox) setGhostText(originalInput, suffix, fullText string) {
885 886
886 o.mu.RLock()887 o.mu.RLock()
887 currentInput := o.realInput888 currentInput := o.realInput
889+ currentToken := o.ghostToken
888 o.mu.RUnlock()890 o.mu.RUnlock()
889 if currentInput != originalInput {891 if currentInput != originalInput {
890 return false892 return false
891 }893 }
894+ if capturedToken != currentToken {
895+ return false
896+ }
892 o.mu.Lock()897 o.mu.Lock()
893 o.isAcceptingGhost = true898 o.isAcceptingGhost = true
894 o.mu.Unlock()899 o.mu.Unlock()
@@ -1962,6 +1967,7 @@ func (o *Omnibox) toggleFavorite() {
1962 log.Debug().Msg("remove favorite: invalid ID")1967 log.Debug().Msg("remove favorite: invalid ID")
1963 return1968 return
1964 }1969 }
1970+ entryText := o.entry.GetText()
1965 1971
1966 go func() {1972 go func() {
1967 ctx := o.ctx1973 ctx := o.ctx
@@ -1989,7 +1995,7 @@ func (o *Omnibox) toggleFavorite() {
1989 o.mu.RLock()1995 o.mu.RLock()
1990 currentToken := o.searchToken1996 currentToken := o.searchToken
1991 o.mu.RUnlock()1997 o.mu.RUnlock()
1992- o.loadFavorites(o.entry.GetText(), currentToken)1998+ o.loadFavorites(entryText, currentToken)
1993 if o.onToast != nil {1999 if o.onToast != nil {
1994 cb := glib.SourceFunc(func(_ uintptr) bool {2000 cb := glib.SourceFunc(func(_ uintptr) bool {
1995 o.onToast(ctx, "Favorite removed", ToastSuccess)2001 o.onToast(ctx, "Favorite removed", ToastSuccess)

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