detached e09e4cf

fix(workspace): implement dynamic theme-aware border and background colors

- Add PrefersDarkTheme() function to webkit package for GTK theme detection
- Update workspace CSS generation to use theme-specific colors:
  * Dark mode: #333333 borders, #2b2b2b backgrounds
  * Light mode: #dddddd borders, #ffffff backgrounds
- Apply dynamic colors to both single panes and multi-pane workspaces
- Add GTK window-level background styling to prevent white bleeding
- Resolves white border issue on inactive panes in dark mode
commit
e09e4cff3c55f7ca4f67f1a2cadb4088946a0f03
author
Brice · · 2025-09-22 19:33 UTC
parent
03656a2
signature
unsigned
3 files · +40 -3
M CHANGELOG.md +4 -0
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
55 ## [Unreleased]
66
7+### Fixed
8+- **Workspace theme integration**: Fixed white borders on inactive panes by implementing dynamic border colors based on GTK theme preference (dark mode: #333333 borders, light mode: #dddddd borders)
9+- **GTK window background**: Added theme-aware window and pane background colors to prevent white bleeding through transparent elements
10+
711 ## [0.9.0] - 2025-09-22
812
913 ### Added
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4 4
5 ## [Unreleased]5 ## [Unreleased]
6 6
7+### Fixed
8+- **Workspace theme integration**: Fixed white borders on inactive panes by implementing dynamic border colors based on GTK theme preference (dark mode: #333333 borders, light mode: #dddddd borders)
9+- **GTK window background**: Added theme-aware window and pane background colors to prevent white bleeding through transparent elements
10+
7 ## [0.9.0] - 2025-09-2211 ## [0.9.0] - 2025-09-22
8 12
9 ### Added13 ### Added
M internal/app/browser/workspace_manager.go +31 -3
@@ -485,27 +485,55 @@ func (wm *WorkspaceManager) generateActivePaneCSS() string {
485485 cfg := config.Get()
486486 styling := cfg.Workspace.Styling
487487
488- return fmt.Sprintf(`.workspace-pane {
489- border: %dpx solid transparent;
488+ // Get appropriate border colors based on GTK theme preference
489+ var inactiveBorderColor, windowBackgroundColor string
490+ isDark := webkit.PrefersDarkTheme()
491+ if isDark {
492+ inactiveBorderColor = "#333333" // Dark border for dark theme
493+ windowBackgroundColor = "#2b2b2b" // Dark window background
494+ } else {
495+ inactiveBorderColor = "#dddddd" // Light border for light theme
496+ windowBackgroundColor = "#ffffff" // Light window background
497+ }
498+
499+ // Log the border color values for debugging
500+ log.Printf("[workspace] GTK prefers dark: %v, inactive border color: %s", isDark, inactiveBorderColor)
501+
502+ css := fmt.Sprintf(`window {
503+ background-color: %s;
504+ }
505+
506+ .workspace-pane {
507+ background-color: %s;
508+ border: %dpx solid %s;
490509 transition: border-color %dms ease-in-out;
491510 border-radius: %dpx;
492511 }
493512
494513 .workspace-pane.workspace-multi-pane {
495- border: %dpx solid transparent;
514+ border: %dpx solid %s;
496515 border-radius: %dpx;
497516 }
498517
499518 .workspace-pane.workspace-multi-pane.workspace-pane-active {
500519 border-color: %s;
501520 }`,
521+ windowBackgroundColor,
522+ windowBackgroundColor,
502523 styling.BorderWidth,
524+ inactiveBorderColor,
503525 styling.TransitionDuration,
504526 styling.BorderRadius,
505527 styling.BorderWidth,
528+ inactiveBorderColor,
506529 styling.BorderRadius,
507530 styling.BorderColor,
508531 )
532+
533+ // Log the actual CSS being generated
534+ log.Printf("[workspace] Generated CSS: %s", css)
535+
536+ return css
509537 }
510538
511539 func (wm *WorkspaceManager) ensureStyles() {
@@ -485,27 +485,55 @@ func (wm *WorkspaceManager) generateActivePaneCSS() string {
485 cfg := config.Get()485 cfg := config.Get()
486 styling := cfg.Workspace.Styling486 styling := cfg.Workspace.Styling
487 487
488- return fmt.Sprintf(`.workspace-pane {488+ // Get appropriate border colors based on GTK theme preference
489- border: %dpx solid transparent;489+ var inactiveBorderColor, windowBackgroundColor string
490+ isDark := webkit.PrefersDarkTheme()
491+ if isDark {
492+ inactiveBorderColor = "#333333" // Dark border for dark theme
493+ windowBackgroundColor = "#2b2b2b" // Dark window background
494+ } else {
495+ inactiveBorderColor = "#dddddd" // Light border for light theme
496+ windowBackgroundColor = "#ffffff" // Light window background
497+ }
498+
499+ // Log the border color values for debugging
500+ log.Printf("[workspace] GTK prefers dark: %v, inactive border color: %s", isDark, inactiveBorderColor)
501+
502+ css := fmt.Sprintf(`window {
503+ background-color: %s;
504+ }
505+
506+ .workspace-pane {
507+ background-color: %s;
508+ border: %dpx solid %s;
490 transition: border-color %dms ease-in-out;509 transition: border-color %dms ease-in-out;
491 border-radius: %dpx;510 border-radius: %dpx;
492 }511 }
493 512
494 .workspace-pane.workspace-multi-pane {513 .workspace-pane.workspace-multi-pane {
495- border: %dpx solid transparent;514+ border: %dpx solid %s;
496 border-radius: %dpx;515 border-radius: %dpx;
497 }516 }
498 517
499 .workspace-pane.workspace-multi-pane.workspace-pane-active {518 .workspace-pane.workspace-multi-pane.workspace-pane-active {
500 border-color: %s;519 border-color: %s;
501 }`,520 }`,
521+ windowBackgroundColor,
522+ windowBackgroundColor,
502 styling.BorderWidth,523 styling.BorderWidth,
524+ inactiveBorderColor,
503 styling.TransitionDuration,525 styling.TransitionDuration,
504 styling.BorderRadius,526 styling.BorderRadius,
505 styling.BorderWidth,527 styling.BorderWidth,
528+ inactiveBorderColor,
506 styling.BorderRadius,529 styling.BorderRadius,
507 styling.BorderColor,530 styling.BorderColor,
508 )531 )
532+
533+ // Log the actual CSS being generated
534+ log.Printf("[workspace] Generated CSS: %s", css)
535+
536+ return css
509 }537 }
510 538
511 func (wm *WorkspaceManager) ensureStyles() {539 func (wm *WorkspaceManager) ensureStyles() {
M pkg/webkit/webview_cgo.go +5 -0
@@ -2579,3 +2579,8 @@ func (w *WebView) ID() string {
25792579 }
25802580 return strconv.FormatUint(uint64(w.id), 10)
25812581 }
2582+
2583+// PrefersDarkTheme returns true if GTK is configured to prefer dark theme
2584+func PrefersDarkTheme() bool {
2585+ return C.gtk_prefers_dark() != 0
2586+}
@@ -2579,3 +2579,8 @@ func (w *WebView) ID() string {
2579 }2579 }
2580 return strconv.FormatUint(uint64(w.id), 10)2580 return strconv.FormatUint(uint64(w.id), 10)
2581 }2581 }
2582+
2583+// PrefersDarkTheme returns true if GTK is configured to prefer dark theme
2584+func PrefersDarkTheme() bool {
2585+ return C.gtk_prefers_dark() != 0
2586+}

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