detached 1d14237

Polish migration review fixes

commit
1d1423765af723b4426074815739663c2d502508
author
brice · · 2026-04-29 20:27 UTC
parent
c3e55f7
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +20 -15
M internal/infrastructure/cef/cef2gtk_adapter.go +5 -4
@@ -173,10 +173,11 @@ func (a *Cef2gtkAdapter) Diagnostics() cef2gtk.Diagnostics {
173173 }
174174
175175 // Destroy releases GL resources owned by purego-cef2gtk and disconnects GTK
176-// signal handlers. Must be called on the GTK main thread. Not safe for
177-// concurrent use; callers must ensure no concurrent adapter reads are in flight.
178-// After Destroy, the adapter is marked destroyed and all subsequent operations
179-// return ErrAdapterDestroyed.
176+// signal handlers. Must be called on the GTK main thread. The atomic destroyed
177+// flag only communicates lifecycle state; accesses to view are not otherwise
178+// synchronized, so callers must ensure no concurrent adapter method is using the
179+// view while Destroy runs. After Destroy, operations return ErrAdapterDestroyed
180+// or a zero-value result.
180181 func (a *Cef2gtkAdapter) Destroy() error {
181182 if a == nil {
182183 return ErrAdapterDestroyed
@@ -173,10 +173,11 @@ func (a *Cef2gtkAdapter) Diagnostics() cef2gtk.Diagnostics {
173 }173 }
174 174
175 // Destroy releases GL resources owned by purego-cef2gtk and disconnects GTK175 // Destroy releases GL resources owned by purego-cef2gtk and disconnects GTK
176-// signal handlers. Must be called on the GTK main thread. Not safe for176+// signal handlers. Must be called on the GTK main thread. The atomic destroyed
177-// concurrent use; callers must ensure no concurrent adapter reads are in flight.177+// flag only communicates lifecycle state; accesses to view are not otherwise
178-// After Destroy, the adapter is marked destroyed and all subsequent operations178+// synchronized, so callers must ensure no concurrent adapter method is using the
179-// return ErrAdapterDestroyed.179+// view while Destroy runs. After Destroy, operations return ErrAdapterDestroyed
180+// or a zero-value result.
180 func (a *Cef2gtkAdapter) Destroy() error {181 func (a *Cef2gtkAdapter) Destroy() error {
181 if a == nil {182 if a == nil {
182 return ErrAdapterDestroyed183 return ErrAdapterDestroyed
M internal/infrastructure/cef/cef2gtk_boundary_test.go +10 -6
@@ -27,7 +27,11 @@ func TestCEF2GTKImportStaysInInfrastructureCEF(t *testing.T) {
2727 if filepath.Ext(path) != ".go" || strings.HasSuffix(path, "_test.go") {
2828 return nil
2929 }
30- if !importsCEF2GTK(path) {
30+ importsBridge, err := importsCEF2GTK(path)
31+ if err != nil {
32+ return err
33+ }
34+ if !importsBridge {
3135 return nil
3236 }
3337 rel, err := filepath.Rel(root, path)
@@ -44,18 +48,18 @@ func TestCEF2GTKImportStaysInInfrastructureCEF(t *testing.T) {
4448 }
4549 }
4650
47-func importsCEF2GTK(path string) bool {
51+func importsCEF2GTK(path string) (bool, error) {
4852 file, err := parser.ParseFile(token.NewFileSet(), path, nil, parser.ImportsOnly)
4953 if err != nil {
50- return false
54+ return false, err
5155 }
5256 for _, spec := range file.Imports {
5357 importPath, err := strconv.Unquote(spec.Path.Value)
54- if err == nil && importPath == "github.com/bnema/purego-cef2gtk" {
55- return true
58+ if err == nil && strings.HasPrefix(importPath, "github.com/bnema/purego-cef2gtk") {
59+ return true, nil
5660 }
5761 }
58- return false
62+ return false, nil
5963 }
6064
6165 func repoRoot(t *testing.T) string {
@@ -27,7 +27,11 @@ func TestCEF2GTKImportStaysInInfrastructureCEF(t *testing.T) {
27 if filepath.Ext(path) != ".go" || strings.HasSuffix(path, "_test.go") {27 if filepath.Ext(path) != ".go" || strings.HasSuffix(path, "_test.go") {
28 return nil28 return nil
29 }29 }
30- if !importsCEF2GTK(path) {30+ importsBridge, err := importsCEF2GTK(path)
31+ if err != nil {
32+ return err
33+ }
34+ if !importsBridge {
31 return nil35 return nil
32 }36 }
33 rel, err := filepath.Rel(root, path)37 rel, err := filepath.Rel(root, path)
@@ -44,18 +48,18 @@ func TestCEF2GTKImportStaysInInfrastructureCEF(t *testing.T) {
44 }48 }
45 }49 }
46 50
47-func importsCEF2GTK(path string) bool {51+func importsCEF2GTK(path string) (bool, error) {
48 file, err := parser.ParseFile(token.NewFileSet(), path, nil, parser.ImportsOnly)52 file, err := parser.ParseFile(token.NewFileSet(), path, nil, parser.ImportsOnly)
49 if err != nil {53 if err != nil {
50- return false54+ return false, err
51 }55 }
52 for _, spec := range file.Imports {56 for _, spec := range file.Imports {
53 importPath, err := strconv.Unquote(spec.Path.Value)57 importPath, err := strconv.Unquote(spec.Path.Value)
54- if err == nil && importPath == "github.com/bnema/purego-cef2gtk" {58+ if err == nil && strings.HasPrefix(importPath, "github.com/bnema/purego-cef2gtk") {
55- return true59+ return true, nil
56 }60 }
57 }61 }
58- return false62+ return false, nil
59 }63 }
60 64
61 func repoRoot(t *testing.T) string {65 func repoRoot(t *testing.T) string {
M internal/infrastructure/cef/render_handler_adapter.go +5 -5
@@ -8,14 +8,17 @@ import (
88 )
99
1010 func newDumberRenderHandler(wv *WebView) purecef.RenderHandler {
11+ if wv == nil || wv.viewBridge == nil {
12+ return nil
13+ }
1114 hooks := cef2gtk.Hooks{
1215 OnUnsupportedPaint: func() {
13- if wv != nil && wv.ctx != nil {
16+ if wv.ctx != nil {
1417 logging.FromContext(wv.ctx).Warn().Msg("cef: unsupported CPU paint from accelerated bridge")
1518 }
1619 },
1720 OnError: func(err error) {
18- if wv != nil && wv.ctx != nil {
21+ if wv.ctx != nil {
1922 logging.FromContext(wv.ctx).Warn().Err(err).Msg("cef: accelerated render bridge error")
2023 }
2124 },
@@ -23,9 +26,6 @@ func newDumberRenderHandler(wv *WebView) purecef.RenderHandler {
2326 handleRenderTextSelectionChanged(wv, selectedText)
2427 },
2528 }
26- if wv == nil || wv.viewBridge == nil {
27- return nil
28- }
2929 return wv.viewBridge.RenderHandler(hooks)
3030 }
3131
@@ -8,14 +8,17 @@ import (
8 )8 )
9 9
10 func newDumberRenderHandler(wv *WebView) purecef.RenderHandler {10 func newDumberRenderHandler(wv *WebView) purecef.RenderHandler {
11+ if wv == nil || wv.viewBridge == nil {
12+ return nil
13+ }
11 hooks := cef2gtk.Hooks{14 hooks := cef2gtk.Hooks{
12 OnUnsupportedPaint: func() {15 OnUnsupportedPaint: func() {
13- if wv != nil && wv.ctx != nil {16+ if wv.ctx != nil {
14 logging.FromContext(wv.ctx).Warn().Msg("cef: unsupported CPU paint from accelerated bridge")17 logging.FromContext(wv.ctx).Warn().Msg("cef: unsupported CPU paint from accelerated bridge")
15 }18 }
16 },19 },
17 OnError: func(err error) {20 OnError: func(err error) {
18- if wv != nil && wv.ctx != nil {21+ if wv.ctx != nil {
19 logging.FromContext(wv.ctx).Warn().Err(err).Msg("cef: accelerated render bridge error")22 logging.FromContext(wv.ctx).Warn().Err(err).Msg("cef: accelerated render bridge error")
20 }23 }
21 },24 },
@@ -23,9 +26,6 @@ func newDumberRenderHandler(wv *WebView) purecef.RenderHandler {
23 handleRenderTextSelectionChanged(wv, selectedText)26 handleRenderTextSelectionChanged(wv, selectedText)
24 },27 },
25 }28 }
26- if wv == nil || wv.viewBridge == nil {
27- return nil
28- }
29 return wv.viewBridge.RenderHandler(hooks)29 return wv.viewBridge.RenderHandler(hooks)
30 }30 }
31 31

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