detached 043bf2c

fix(css): Prevent duplicate provider initialization in workspace manager

commit
043bf2c04879c4ad77d5b1c51336e8dcf3a20734
author
Brice · · 2025-09-28 05:29 UTC
parent
d1f04b5
signature
unsigned
1 file · +18 -2
M internal/app/browser/workspace_css.go +18 -2
@@ -146,13 +146,29 @@ func (wm *WorkspaceManager) generateStackedPaneCSS() string {
146146 return wm.generateWorkspaceCSS()
147147 }
148148
149+// Global CSS provider tracking to prevent duplication
150+var (
151+ globalCSSInitialized bool
152+ globalCSSContent string
153+)
154+
149155 // ensureWorkspaceStyles ensures that CSS styles are applied for workspace panes
156+// Improved to prevent CSS provider duplication by using global CSS tracking
150157 func (wm *WorkspaceManager) ensureWorkspaceStyles() {
151- if wm == nil || wm.cssInitialized {
158+ if wm == nil {
152159 return
153160 }
161+
162+ // Generate CSS content
154163 workspaceCSS := wm.generateWorkspaceCSS()
155- webkit.AddCSSProvider(workspaceCSS)
164+
165+ // Only apply CSS if it hasn't been applied globally or if content changed
166+ if !globalCSSInitialized || globalCSSContent != workspaceCSS {
167+ webkit.AddCSSProvider(workspaceCSS)
168+ globalCSSInitialized = true
169+ globalCSSContent = workspaceCSS
170+ }
171+
156172 wm.cssInitialized = true
157173 }
158174
@@ -146,13 +146,29 @@ func (wm *WorkspaceManager) generateStackedPaneCSS() string {
146 return wm.generateWorkspaceCSS()146 return wm.generateWorkspaceCSS()
147 }147 }
148 148
149+// Global CSS provider tracking to prevent duplication
150+var (
151+ globalCSSInitialized bool
152+ globalCSSContent string
153+)
154+
149 // ensureWorkspaceStyles ensures that CSS styles are applied for workspace panes155 // ensureWorkspaceStyles ensures that CSS styles are applied for workspace panes
156+// Improved to prevent CSS provider duplication by using global CSS tracking
150 func (wm *WorkspaceManager) ensureWorkspaceStyles() {157 func (wm *WorkspaceManager) ensureWorkspaceStyles() {
151- if wm == nil || wm.cssInitialized {158+ if wm == nil {
152 return159 return
153 }160 }
161+
162+ // Generate CSS content
154 workspaceCSS := wm.generateWorkspaceCSS()163 workspaceCSS := wm.generateWorkspaceCSS()
155- webkit.AddCSSProvider(workspaceCSS)164+
165+ // Only apply CSS if it hasn't been applied globally or if content changed
166+ if !globalCSSInitialized || globalCSSContent != workspaceCSS {
167+ webkit.AddCSSProvider(workspaceCSS)
168+ globalCSSInitialized = true
169+ globalCSSContent = workspaceCSS
170+ }
171+
156 wm.cssInitialized = true172 wm.cssInitialized = true
157 }173 }
158 174

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