detached d2baffa

fix(zoom): suppress toast during browser initialization

commit
d2baffaee440ec7562962bf159ae102eb2c12beb
author
bnema · · 2025-11-29 10:02 UTC
parent
227825f
signature
GPG Unverified2B82207D370127A0 The key is unknown
1 file · +6 -2
M internal/app/control/zoom.go +6 -2
@@ -17,6 +17,7 @@ type ZoomController struct {
1717 programmaticTimer *time.Timer
1818 browserService *services.BrowserService
1919 webView *webkit.WebView
20+ initializing bool // true until first load completes, suppresses toasts
2021 }
2122
2223 // WebViewInterface defines the interface for WebView zoom operations
@@ -35,6 +36,7 @@ func NewZoomController(browserService *services.BrowserService, webView *webkit.
3536 currentURL: "dumb://homepage",
3637 browserService: browserService,
3738 webView: webView,
39+ initializing: true,
3840 }
3941 }
4042
@@ -56,6 +58,8 @@ func (z *ZoomController) handleLoadCommitted(url string) {
5658 if url == "" {
5759 return
5860 }
61+ // First load complete, allow toasts from now on
62+ z.initializing = false
5963 currentDomain := services.ZoomKeyForLog(url)
6064 z.loadZoomLevelAsync(url, currentDomain, false)
6165 }
@@ -77,8 +81,8 @@ func (z *ZoomController) handleZoomChange(level float64) {
7781 log.Printf("[zoom] saved %.2f for %s", level, key)
7882 }(url, level)
7983
80- // Only show toast for user-initiated zoom changes, not programmatic ones
81- if !z.programmaticChange {
84+ // Only show toast for user-initiated zoom changes, not during init or programmatic changes
85+ if !z.programmaticChange && !z.initializing {
8286 z.showZoomToast(level)
8387 }
8488 }
@@ -17,6 +17,7 @@ type ZoomController struct {
17 programmaticTimer *time.Timer17 programmaticTimer *time.Timer
18 browserService *services.BrowserService18 browserService *services.BrowserService
19 webView *webkit.WebView19 webView *webkit.WebView
20+ initializing bool // true until first load completes, suppresses toasts
20 }21 }
21 22
22 // WebViewInterface defines the interface for WebView zoom operations23 // WebViewInterface defines the interface for WebView zoom operations
@@ -35,6 +36,7 @@ func NewZoomController(browserService *services.BrowserService, webView *webkit.
35 currentURL: "dumb://homepage",36 currentURL: "dumb://homepage",
36 browserService: browserService,37 browserService: browserService,
37 webView: webView,38 webView: webView,
39+ initializing: true,
38 }40 }
39 }41 }
40 42
@@ -56,6 +58,8 @@ func (z *ZoomController) handleLoadCommitted(url string) {
56 if url == "" {58 if url == "" {
57 return59 return
58 }60 }
61+ // First load complete, allow toasts from now on
62+ z.initializing = false
59 currentDomain := services.ZoomKeyForLog(url)63 currentDomain := services.ZoomKeyForLog(url)
60 z.loadZoomLevelAsync(url, currentDomain, false)64 z.loadZoomLevelAsync(url, currentDomain, false)
61 }65 }
@@ -77,8 +81,8 @@ func (z *ZoomController) handleZoomChange(level float64) {
77 log.Printf("[zoom] saved %.2f for %s", level, key)81 log.Printf("[zoom] saved %.2f for %s", level, key)
78 }(url, level)82 }(url, level)
79 83
80- // Only show toast for user-initiated zoom changes, not programmatic ones84+ // Only show toast for user-initiated zoom changes, not during init or programmatic changes
81- if !z.programmaticChange {85+ if !z.programmaticChange && !z.initializing {
82 z.showZoomToast(level)86 z.showZoomToast(level)
83 }87 }
84 }88 }

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