detached 9591200

fix: restore async webview pool prewarming lost during engine abstraction

PrewarmAsync was not exposed through the port.WebViewPool interface,
causing app.go to fall back to synchronous Prewarm which blocked the
GTK main thread at cold start.
commit
9591200a482fb5ba54a0b902aa8ad663bc153987
author
brice · · 2026-03-17 13:30 UTC
parent
1dcf50c
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +12 -3
M internal/application/port/webview.go +6 -1
@@ -275,10 +275,15 @@ type WebViewPool interface {
275275 // If the pool is full, the WebView will be destroyed.
276276 Release(wv WebView)
277277
278- // Prewarm creates WebViews in the background to populate the pool.
278+ // Prewarm creates WebViews synchronously to populate the pool.
279279 // Pass count <= 0 to use the default prewarm count.
280280 Prewarm(count int)
281281
282+ // PrewarmAsync schedules WebView creation on the toolkit idle loop,
283+ // avoiding blocking startup while still warming up WebViews.
284+ // Pass count <= 0 to use the default prewarm count.
285+ PrewarmAsync(ctx context.Context, count int)
286+
282287 // Size returns the current number of available WebViews in the pool.
283288 Size() int
284289
@@ -275,10 +275,15 @@ type WebViewPool interface {
275 // If the pool is full, the WebView will be destroyed.275 // If the pool is full, the WebView will be destroyed.
276 Release(wv WebView)276 Release(wv WebView)
277 277
278- // Prewarm creates WebViews in the background to populate the pool.278+ // Prewarm creates WebViews synchronously to populate the pool.
279 // Pass count <= 0 to use the default prewarm count.279 // Pass count <= 0 to use the default prewarm count.
280 Prewarm(count int)280 Prewarm(count int)
281 281
282+ // PrewarmAsync schedules WebView creation on the toolkit idle loop,
283+ // avoiding blocking startup while still warming up WebViews.
284+ // Pass count <= 0 to use the default prewarm count.
285+ PrewarmAsync(ctx context.Context, count int)
286+
282 // Size returns the current number of available WebViews in the pool.287 // Size returns the current number of available WebViews in the pool.
283 Size() int288 Size() int
284 289
M internal/infrastructure/webkit/engine_adapters.go +4 -0
@@ -72,6 +72,10 @@ func (a *webViewPoolAdapter) Prewarm(count int) {
7272 a.pool.Prewarm(a.ctx, count)
7373 }
7474
75+func (a *webViewPoolAdapter) PrewarmAsync(ctx context.Context, count int) {
76+ a.pool.PrewarmAsync(ctx, count)
77+}
78+
7579 func (a *webViewPoolAdapter) Size() int {
7680 return a.pool.Size()
7781 }
@@ -72,6 +72,10 @@ func (a *webViewPoolAdapter) Prewarm(count int) {
72 a.pool.Prewarm(a.ctx, count)72 a.pool.Prewarm(a.ctx, count)
73 }73 }
74 74
75+func (a *webViewPoolAdapter) PrewarmAsync(ctx context.Context, count int) {
76+ a.pool.PrewarmAsync(ctx, count)
77+}
78+
75 func (a *webViewPoolAdapter) Size() int {79 func (a *webViewPoolAdapter) Size() int {
76 return a.pool.Size()80 return a.pool.Size()
77 }81 }
M internal/ui/app.go +2 -2
@@ -359,7 +359,7 @@ func (a *App) setupPoolBackgroundColor(ctx context.Context) {
359359 log.Debug().Msg("configured webview pool background color")
360360 }
361361
362-func (a *App) prewarmWebViewPoolAsync(_ context.Context) {
362+func (a *App) prewarmWebViewPoolAsync(ctx context.Context) {
363363 if a.engine == nil {
364364 return
365365 }
@@ -367,7 +367,7 @@ func (a *App) prewarmWebViewPoolAsync(_ context.Context) {
367367 if pool == nil {
368368 return
369369 }
370- pool.Prewarm(0)
370+ pool.PrewarmAsync(ctx, 0)
371371 }
372372
373373 func (a *App) createMainWindow(ctx context.Context) error {
@@ -359,7 +359,7 @@ func (a *App) setupPoolBackgroundColor(ctx context.Context) {
359 log.Debug().Msg("configured webview pool background color")359 log.Debug().Msg("configured webview pool background color")
360 }360 }
361 361
362-func (a *App) prewarmWebViewPoolAsync(_ context.Context) {362+func (a *App) prewarmWebViewPoolAsync(ctx context.Context) {
363 if a.engine == nil {363 if a.engine == nil {
364 return364 return
365 }365 }
@@ -367,7 +367,7 @@ func (a *App) prewarmWebViewPoolAsync(_ context.Context) {
367 if pool == nil {367 if pool == nil {
368 return368 return
369 }369 }
370- pool.Prewarm(0)370+ pool.PrewarmAsync(ctx, 0)
371 }371 }
372 372
373 func (a *App) createMainWindow(ctx context.Context) error {373 func (a *App) createMainWindow(ctx context.Context) error {

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