detached c3e55f7

Address CodeRabbit migration feedback

commit
c3e55f7ffc338d4bea4b42cedfba8bdf6213c206
author
brice · · 2026-04-29 20:23 UTC
parent
7297a70
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
5 files · +15 -19
M internal/infrastructure/cef/cef2gtk_adapter.go +1 -2
@@ -181,13 +181,12 @@ func (a *Cef2gtkAdapter) Destroy() error {
181181 if a == nil {
182182 return ErrAdapterDestroyed
183183 }
184+ a.destroyed.Store(true)
184185 if a.view == nil {
185- a.destroyed.Store(true)
186186 return ErrAdapterDestroyed
187187 }
188188 err := a.view.Destroy()
189189 a.view = nil
190- a.destroyed.Store(true)
191190 return err
192191 }
193192
@@ -181,13 +181,12 @@ func (a *Cef2gtkAdapter) Destroy() error {
181 if a == nil {181 if a == nil {
182 return ErrAdapterDestroyed182 return ErrAdapterDestroyed
183 }183 }
184+ a.destroyed.Store(true)
184 if a.view == nil {185 if a.view == nil {
185- a.destroyed.Store(true)
186 return ErrAdapterDestroyed186 return ErrAdapterDestroyed
187 }187 }
188 err := a.view.Destroy()188 err := a.view.Destroy()
189 a.view = nil189 a.view = nil
190- a.destroyed.Store(true)
191 return err190 return err
192 }191 }
193 192
M internal/infrastructure/cef/focus_bridge.go +6 -2
@@ -6,7 +6,11 @@ func syncWindowlessBrowserFocus(host purecef.BrowserHost) {
66 if host == nil {
77 return
88 }
9- host.WasHidden(0)
10- host.SetFocus(1)
9+ const (
10+ cefFalse = 0
11+ cefTrue = 1
12+ )
13+ host.WasHidden(cefFalse) // visible
14+ host.SetFocus(cefTrue) // focused
1115 host.Invalidate(purecef.PaintElementTypePetView)
1216 }
@@ -6,7 +6,11 @@ func syncWindowlessBrowserFocus(host purecef.BrowserHost) {
6 if host == nil {6 if host == nil {
7 return7 return
8 }8 }
9- host.WasHidden(0)9+ const (
10- host.SetFocus(1)10+ cefFalse = 0
11+ cefTrue = 1
12+ )
13+ host.WasHidden(cefFalse) // visible
14+ host.SetFocus(cefTrue) // focused
11 host.Invalidate(purecef.PaintElementTypePetView)15 host.Invalidate(purecef.PaintElementTypePetView)
12 }16 }
M internal/infrastructure/cef/render_handler_adapter.go +1 -2
@@ -24,8 +24,7 @@ func newDumberRenderHandler(wv *WebView) purecef.RenderHandler {
2424 },
2525 }
2626 if wv == nil || wv.viewBridge == nil {
27- var view *cef2gtk.View
28- return view.RenderHandler(hooks)
27+ return nil
2928 }
3029 return wv.viewBridge.RenderHandler(hooks)
3130 }
@@ -24,8 +24,7 @@ func newDumberRenderHandler(wv *WebView) purecef.RenderHandler {
24 },24 },
25 }25 }
26 if wv == nil || wv.viewBridge == nil {26 if wv == nil || wv.viewBridge == nil {
27- var view *cef2gtk.View27+ return nil
28- return view.RenderHandler(hooks)
29 }28 }
30 return wv.viewBridge.RenderHandler(hooks)29 return wv.viewBridge.RenderHandler(hooks)
31 }30 }
M internal/infrastructure/cef/webview.go +3 -7
@@ -1020,18 +1020,14 @@ func (wv *WebView) Destroy() {
10201020 } else {
10211021 wv.runCloseCallbacks()
10221022 }
1023- if wv.viewBridge != nil {
1023+ if bridge := wv.viewBridge; bridge != nil {
10241024 wv.runOnGTKSync(func() {
10251025 if wv.removeSizeObserver != nil {
10261026 wv.removeSizeObserver()
10271027 wv.removeSizeObserver = nil
10281028 }
1029- bridge := wv.viewBridge
1030- wv.viewBridge = nil
1031- if bridge != nil {
1032- _ = bridge.DetachInput()
1033- _ = bridge.Destroy()
1034- }
1029+ _ = bridge.DetachInput()
1030+ _ = bridge.Destroy()
10351031 })
10361032 }
10371033 }
@@ -1020,18 +1020,14 @@ func (wv *WebView) Destroy() {
1020 } else {1020 } else {
1021 wv.runCloseCallbacks()1021 wv.runCloseCallbacks()
1022 }1022 }
1023- if wv.viewBridge != nil {1023+ if bridge := wv.viewBridge; bridge != nil {
1024 wv.runOnGTKSync(func() {1024 wv.runOnGTKSync(func() {
1025 if wv.removeSizeObserver != nil {1025 if wv.removeSizeObserver != nil {
1026 wv.removeSizeObserver()1026 wv.removeSizeObserver()
1027 wv.removeSizeObserver = nil1027 wv.removeSizeObserver = nil
1028 }1028 }
1029- bridge := wv.viewBridge1029+ _ = bridge.DetachInput()
1030- wv.viewBridge = nil1030+ _ = bridge.Destroy()
1031- if bridge != nil {
1032- _ = bridge.DetachInput()
1033- _ = bridge.Destroy()
1034- }
1035 })1031 })
1036 }1032 }
1037 }1033 }
M internal/infrastructure/cef/webview_handlers_test.go +4 -6
@@ -500,17 +500,15 @@ func TestOptionalHandlersAreAlwaysEnabled(t *testing.T) {
500500 // AudioHandler is always enabled (required for media decoding).
501501 require.Same(t, h, h.GetAudioHandler())
502502 require.Same(t, h, h.GetContextMenuHandler())
503- require.NotSame(t, h, h.GetRenderHandler())
503+ require.Nil(t, h.GetRenderHandler())
504504 }
505505
506-func TestGetRenderHandlerPreservesTextSelectionCallback(t *testing.T) {
506+func TestRenderTextSelectionHookPreservesWebViewState(t *testing.T) {
507507 wv := &WebView{ctx: context.Background()}
508- h := &handlerSet{wv: wv}
509508
510- rh := h.GetRenderHandler()
511- rh.OnTextSelectionChanged(nil, "selected via client", nil)
509+ handleRenderTextSelectionChanged(wv, "selected via hook")
512510
513- require.Equal(t, "selected via client", wv.selectedTextSnapshot())
511+ require.Equal(t, "selected via hook", wv.selectedTextSnapshot())
514512 }
515513
516514 func TestGetDownloadHandler_EnabledWhenEngineConfigured(t *testing.T) {
@@ -500,17 +500,15 @@ func TestOptionalHandlersAreAlwaysEnabled(t *testing.T) {
500 // AudioHandler is always enabled (required for media decoding).500 // AudioHandler is always enabled (required for media decoding).
501 require.Same(t, h, h.GetAudioHandler())501 require.Same(t, h, h.GetAudioHandler())
502 require.Same(t, h, h.GetContextMenuHandler())502 require.Same(t, h, h.GetContextMenuHandler())
503- require.NotSame(t, h, h.GetRenderHandler())503+ require.Nil(t, h.GetRenderHandler())
504 }504 }
505 505
506-func TestGetRenderHandlerPreservesTextSelectionCallback(t *testing.T) {506+func TestRenderTextSelectionHookPreservesWebViewState(t *testing.T) {
507 wv := &WebView{ctx: context.Background()}507 wv := &WebView{ctx: context.Background()}
508- h := &handlerSet{wv: wv}
509 508
510- rh := h.GetRenderHandler()509+ handleRenderTextSelectionChanged(wv, "selected via hook")
511- rh.OnTextSelectionChanged(nil, "selected via client", nil)
512 510
513- require.Equal(t, "selected via client", wv.selectedTextSnapshot())511+ require.Equal(t, "selected via hook", wv.selectedTextSnapshot())
514 }512 }
515 513
516 func TestGetDownloadHandler_EnabledWhenEngineConfigured(t *testing.T) {514 func TestGetDownloadHandler_EnabledWhenEngineConfigured(t *testing.T) {

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