detached 79b3471

fix: apply theme background early for webviews

commit
79b3471de7538e82556ff392b6623115f6f71287
author
bnema · · 2025-12-28 11:59 UTC
committer
bnema · · 2025-12-28 11:59 UTC
parent
ddb81a0
signature
GPG Unverified2B82207D370127A0 The key is unknown
2 files · +13 -0
M internal/bootstrap/webkit_stack.go +3 -0
@@ -111,6 +111,9 @@ func BuildWebKitStack(
111111 poolCfg.PrewarmCount = cfg.Performance.WebViewPoolPrewarmCount
112112 }
113113 pool := webkit.NewWebViewPool(ctx, wkCtx, settings, poolCfg, injector, messageRouter)
114+ // Ensure prewarmed WebViews pick up the theme background color.
115+ bgR, bgG, bgB, bgA := themeManager.GetBackgroundRGBA()
116+ pool.SetBackgroundColor(bgR, bgG, bgB, bgA)
114117
115118 if filterManager != nil {
116119 pool.SetFilterApplier(filterManager)
@@ -111,6 +111,9 @@ func BuildWebKitStack(
111 poolCfg.PrewarmCount = cfg.Performance.WebViewPoolPrewarmCount111 poolCfg.PrewarmCount = cfg.Performance.WebViewPoolPrewarmCount
112 }112 }
113 pool := webkit.NewWebViewPool(ctx, wkCtx, settings, poolCfg, injector, messageRouter)113 pool := webkit.NewWebViewPool(ctx, wkCtx, settings, poolCfg, injector, messageRouter)
114+ // Ensure prewarmed WebViews pick up the theme background color.
115+ bgR, bgG, bgB, bgA := themeManager.GetBackgroundRGBA()
116+ pool.SetBackgroundColor(bgR, bgG, bgB, bgA)
114 117
115 if filterManager != nil {118 if filterManager != nil {
116 pool.SetFilterApplier(filterManager)119 pool.SetFilterApplier(filterManager)
M internal/infrastructure/webkit/pool.go +10 -0
@@ -126,6 +126,16 @@ func (p *WebViewPool) Acquire(ctx context.Context) (*WebView, error) {
126126 select {
127127 case wv := <-p.pool:
128128 if wv != nil && !wv.IsDestroyed() {
129+ p.bgMu.RLock()
130+ r, g, b, a := p.bgR, p.bgG, p.bgB, p.bgA
131+ p.bgMu.RUnlock()
132+ if a > 0 {
133+ wv.SetBackgroundColor(r, g, b, a)
134+ }
135+ wv.inner.AddCssClass("webview-themed")
136+ // Keep pooled WebViews hidden until we explicitly reveal them.
137+ wv.inner.SetVisible(false)
138+
129139 // Ensure frontend is attached even if this WebView was pooled before injection was configured.
130140 _ = wv.AttachFrontend(ctx, p.injector, p.router)
131141 // Apply filters if available (may not have been applied during prewarm)
@@ -126,6 +126,16 @@ func (p *WebViewPool) Acquire(ctx context.Context) (*WebView, error) {
126 select {126 select {
127 case wv := <-p.pool:127 case wv := <-p.pool:
128 if wv != nil && !wv.IsDestroyed() {128 if wv != nil && !wv.IsDestroyed() {
129+ p.bgMu.RLock()
130+ r, g, b, a := p.bgR, p.bgG, p.bgB, p.bgA
131+ p.bgMu.RUnlock()
132+ if a > 0 {
133+ wv.SetBackgroundColor(r, g, b, a)
134+ }
135+ wv.inner.AddCssClass("webview-themed")
136+ // Keep pooled WebViews hidden until we explicitly reveal them.
137+ wv.inner.SetVisible(false)
138+
129 // Ensure frontend is attached even if this WebView was pooled before injection was configured.139 // Ensure frontend is attached even if this WebView was pooled before injection was configured.
130 _ = wv.AttachFrontend(ctx, p.injector, p.router)140 _ = wv.AttachFrontend(ctx, p.injector, p.router)
131 // Apply filters if available (may not have been applied during prewarm)141 // Apply filters if available (may not have been applied during prewarm)

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