detached aaa4919

chore(logging): trace async webview prewarm

Add debug logs around pool background color setup and async prewarm scheduling/completion for easier startup diagnostics.
commit
aaa4919e62d25bfddb0d78f9d3e1da6dfe386723
author
brice · · 2025-12-27 08:33 UTC
parent
0c81a22
signature
unsigned
2 files · +22 -4
M internal/infrastructure/webkit/pool.go +9 -1
@@ -212,12 +212,19 @@ func (p *WebViewPool) Prewarm(ctx context.Context, count int) {
212212 // This avoids blocking startup (especially cold-start navigation) while still
213213 // warming up WebViews for subsequent tab creation.
214214 func (p *WebViewPool) PrewarmAsync(ctx context.Context, count int) {
215+ log := logging.FromContext(ctx)
216+
215217 if count <= 0 {
216218 count = p.config.PrewarmCount
217219 }
218- if count <= 0 || p.closed.Load() {
220+ if count <= 0 {
219221 return
220222 }
223+ if p.closed.Load() {
224+ return
225+ }
226+
227+ log.Debug().Int("count", count).Int("pool_size", len(p.pool)).Msg("scheduling async webview pool prewarm")
221228
222229 p.wg.Add(1)
223230 var doneOnce sync.Once
@@ -254,6 +261,7 @@ func (p *WebViewPool) PrewarmAsync(ctx context.Context, count int) {
254261
255262 remaining--
256263 if remaining <= 0 {
264+ log.Debug().Int("pool_size", len(p.pool)).Msg("async webview pool prewarm complete")
257265 doneOnce.Do(p.wg.Done)
258266 return false
259267 }
@@ -212,12 +212,19 @@ func (p *WebViewPool) Prewarm(ctx context.Context, count int) {
212 // This avoids blocking startup (especially cold-start navigation) while still212 // This avoids blocking startup (especially cold-start navigation) while still
213 // warming up WebViews for subsequent tab creation.213 // warming up WebViews for subsequent tab creation.
214 func (p *WebViewPool) PrewarmAsync(ctx context.Context, count int) {214 func (p *WebViewPool) PrewarmAsync(ctx context.Context, count int) {
215+ log := logging.FromContext(ctx)
216+
215 if count <= 0 {217 if count <= 0 {
216 count = p.config.PrewarmCount218 count = p.config.PrewarmCount
217 }219 }
218- if count <= 0 || p.closed.Load() {220+ if count <= 0 {
219 return221 return
220 }222 }
223+ if p.closed.Load() {
224+ return
225+ }
226+
227+ log.Debug().Int("count", count).Int("pool_size", len(p.pool)).Msg("scheduling async webview pool prewarm")
221 228
222 p.wg.Add(1)229 p.wg.Add(1)
223 var doneOnce sync.Once230 var doneOnce sync.Once
@@ -254,6 +261,7 @@ func (p *WebViewPool) PrewarmAsync(ctx context.Context, count int) {
254 261
255 remaining--262 remaining--
256 if remaining <= 0 {263 if remaining <= 0 {
264+ log.Debug().Int("pool_size", len(p.pool)).Msg("async webview pool prewarm complete")
257 doneOnce.Do(p.wg.Done)265 doneOnce.Do(p.wg.Done)
258 return false266 return false
259 }267 }
M internal/ui/app.go +13 -3
@@ -228,12 +228,22 @@ func (a *App) applyGTKColorSchemePreference(ctx context.Context) {
228228 }
229229
230230 func (a *App) setupPoolBackgroundColor(ctx context.Context) {
231+ log := logging.FromContext(ctx)
232+
231233 // Set theme background color on pool to eliminate white flash.
232234 // Must be done before any WebView creation so WebViews get the correct color.
233- if a.pool != nil && a.deps != nil && a.deps.Theme != nil {
234- r, g, b, alpha := a.deps.Theme.GetBackgroundRGBA()
235- a.pool.SetBackgroundColor(r, g, b, alpha)
235+ if a.pool == nil {
236+ log.Debug().Msg("webview pool not available; skipping background color setup")
237+ return
236238 }
239+ if a.deps == nil || a.deps.Theme == nil {
240+ log.Debug().Msg("theme not available; skipping webview pool background color setup")
241+ return
242+ }
243+
244+ r, g, b, alpha := a.deps.Theme.GetBackgroundRGBA()
245+ a.pool.SetBackgroundColor(r, g, b, alpha)
246+ log.Debug().Msg("configured webview pool background color")
237247 }
238248
239249 func (a *App) prewarmWebViewPoolAsync(ctx context.Context) {
@@ -228,12 +228,22 @@ func (a *App) applyGTKColorSchemePreference(ctx context.Context) {
228 }228 }
229 229
230 func (a *App) setupPoolBackgroundColor(ctx context.Context) {230 func (a *App) setupPoolBackgroundColor(ctx context.Context) {
231+ log := logging.FromContext(ctx)
232+
231 // Set theme background color on pool to eliminate white flash.233 // Set theme background color on pool to eliminate white flash.
232 // Must be done before any WebView creation so WebViews get the correct color.234 // Must be done before any WebView creation so WebViews get the correct color.
233- if a.pool != nil && a.deps != nil && a.deps.Theme != nil {235+ if a.pool == nil {
234- r, g, b, alpha := a.deps.Theme.GetBackgroundRGBA()236+ log.Debug().Msg("webview pool not available; skipping background color setup")
235- a.pool.SetBackgroundColor(r, g, b, alpha)237+ return
236 }238 }
239+ if a.deps == nil || a.deps.Theme == nil {
240+ log.Debug().Msg("theme not available; skipping webview pool background color setup")
241+ return
242+ }
243+
244+ r, g, b, alpha := a.deps.Theme.GetBackgroundRGBA()
245+ a.pool.SetBackgroundColor(r, g, b, alpha)
246+ log.Debug().Msg("configured webview pool background color")
237 }247 }
238 248
239 func (a *App) prewarmWebViewPoolAsync(ctx context.Context) {249 func (a *App) prewarmWebViewPoolAsync(ctx context.Context) {

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