detached 7a529eb

fix(webview): reset background to white for external pages to prevent dark bleeding

commit
7a529eb9c51fe22cb1d7bf828c917508a93242f4
author
brice · · 2026-01-24 04:59 UTC
committer
brice · · 2026-01-24 05:14 UTC
parent
8ea382a
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +29 -0
M internal/infrastructure/webkit/webview.go +6 -0
@@ -905,6 +905,12 @@ func (wv *WebView) SetBackgroundColor(r, g, b, a float32) {
905905 wv.inner.SetBackgroundColor(rgba)
906906 }
907907
908+// ResetBackgroundToDefault sets WebView background to white (browser default).
909+// Used for external pages to prevent dark background from bleeding through.
910+func (wv *WebView) ResetBackgroundToDefault() {
911+ wv.SetBackgroundColor(1.0, 1.0, 1.0, 1.0)
912+}
913+
908914 // Show makes the WebView widget visible.
909915 // This should be called after the WebView is ready to be displayed.
910916 func (wv *WebView) Show() {
@@ -905,6 +905,12 @@ func (wv *WebView) SetBackgroundColor(r, g, b, a float32) {
905 wv.inner.SetBackgroundColor(rgba)905 wv.inner.SetBackgroundColor(rgba)
906 }906 }
907 907
908+// ResetBackgroundToDefault sets WebView background to white (browser default).
909+// Used for external pages to prevent dark background from bleeding through.
910+func (wv *WebView) ResetBackgroundToDefault() {
911+ wv.SetBackgroundColor(1.0, 1.0, 1.0, 1.0)
912+}
913+
908 // Show makes the WebView widget visible.914 // Show makes the WebView widget visible.
909 // This should be called after the WebView is ready to be displayed.915 // This should be called after the WebView is ready to be displayed.
910 func (wv *WebView) Show() {916 func (wv *WebView) Show() {
M internal/ui/coordinator/content.go +23 -0
@@ -24,6 +24,12 @@ import (
2424 const (
2525 aboutBlankURI = "about:blank"
2626 logURLMaxLen = 80
27+
28+ // Dark theme background color (#0a0a0b) as float32 RGBA values
29+ darkBgR = 0.039
30+ darkBgG = 0.039
31+ darkBgB = 0.043
32+ darkBgA = 1.0
2733 )
2834
2935 // ContentCoordinator manages WebView lifecycle, title tracking, and content attachment.
@@ -936,6 +942,23 @@ func (c *ContentCoordinator) onLoadCommitted(ctx context.Context, paneID entity.
936942 return
937943 }
938944
945+ // Set appropriate background color based on page type to prevent dark background bleeding.
946+ switch {
947+ case strings.HasPrefix(url, "dumb://"):
948+ // Internal pages: apply themed background
949+ theme, ok := c.getCurrentTheme()
950+ if ok && theme.prefersDark {
951+ wv.SetBackgroundColor(darkBgR, darkBgG, darkBgB, darkBgA)
952+ } else {
953+ wv.ResetBackgroundToDefault()
954+ }
955+ case strings.HasPrefix(url, "about:"):
956+ // Keep pool background (no action)
957+ default:
958+ // External pages: white background
959+ wv.ResetBackgroundToDefault()
960+ }
961+
939962 // Show the WebView now that content is being painted
940963 // (WebViews are hidden on creation to avoid white flash)
941964 // Skip showing if this is about:blank but the pane is loading a different URL
@@ -24,6 +24,12 @@ import (
24 const (24 const (
25 aboutBlankURI = "about:blank"25 aboutBlankURI = "about:blank"
26 logURLMaxLen = 8026 logURLMaxLen = 80
27+
28+ // Dark theme background color (#0a0a0b) as float32 RGBA values
29+ darkBgR = 0.039
30+ darkBgG = 0.039
31+ darkBgB = 0.043
32+ darkBgA = 1.0
27 )33 )
28 34
29 // ContentCoordinator manages WebView lifecycle, title tracking, and content attachment.35 // ContentCoordinator manages WebView lifecycle, title tracking, and content attachment.
@@ -936,6 +942,23 @@ func (c *ContentCoordinator) onLoadCommitted(ctx context.Context, paneID entity.
936 return942 return
937 }943 }
938 944
945+ // Set appropriate background color based on page type to prevent dark background bleeding.
946+ switch {
947+ case strings.HasPrefix(url, "dumb://"):
948+ // Internal pages: apply themed background
949+ theme, ok := c.getCurrentTheme()
950+ if ok && theme.prefersDark {
951+ wv.SetBackgroundColor(darkBgR, darkBgG, darkBgB, darkBgA)
952+ } else {
953+ wv.ResetBackgroundToDefault()
954+ }
955+ case strings.HasPrefix(url, "about:"):
956+ // Keep pool background (no action)
957+ default:
958+ // External pages: white background
959+ wv.ResetBackgroundToDefault()
960+ }
961+
939 // Show the WebView now that content is being painted962 // Show the WebView now that content is being painted
940 // (WebViews are hidden on creation to avoid white flash)963 // (WebViews are hidden on creation to avoid white flash)
941 // Skip showing if this is about:blank but the pane is loading a different URL964 // Skip showing if this is about:blank but the pane is loading a different URL

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