detached 56de592

fix(browser): fix quick wins - shortcuts, diagnostics, geometry validator

Fix shortcuts.go (3 errors):
- Add missing modifiers parameter (0) to RegisterKeyboardShortcut calls
- Fixes cmdorctrl+r, cmdorctrl+shift+r, and F5 reload shortcuts

Fix workspace_diagnostics.go (1 error):
- Change container != 0 to container != nil (gtk.Widgetter is interface)
- Change format from %#x to %p for pointer printing

Fix workspace_geometry_validator.go (2 errors):
- Change container == 0 to container == nil (gtk.Widgetter is interface)
- Fix WidgetGetAllocation call to unpack 4 return values (x, y, width, height)

Total: 6 quick-win errors fixed
commit
56de592475fb018939ec1ca7e76fa404edcbc7e3
author
bamen · · 2025-10-08 20:34 UTC
committer
bamen · · 2025-10-08 16:39 UTC
parent
173610c
signature
unsigned
3 files · +11 -11
M internal/app/browser/shortcuts.go +3 -3
@@ -67,7 +67,7 @@ func (s *ShortcutHandler) RegisterShortcuts() {
6767 // by WindowShortcutHandler at the window level to prevent duplicates
6868
6969 // Page refresh shortcuts
70- _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+r", func() {
70+ _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+r", 0, func() {
7171 if !s.isActivePane() {
7272 return
7373 }
@@ -75,7 +75,7 @@ func (s *ShortcutHandler) RegisterShortcuts() {
7575 _ = s.webView.Reload()
7676 })
7777
78- _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+shift+r", func() {
78+ _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+shift+r", 0, func() {
7979 if !s.isActivePane() {
8080 return
8181 }
@@ -83,7 +83,7 @@ func (s *ShortcutHandler) RegisterShortcuts() {
8383 _ = s.webView.ReloadBypassCache()
8484 })
8585
86- _ = s.webView.RegisterKeyboardShortcut("F5", func() {
86+ _ = s.webView.RegisterKeyboardShortcut("F5", 0, func() {
8787 if !s.isActivePane() {
8888 return
8989 }
@@ -67,7 +67,7 @@ func (s *ShortcutHandler) RegisterShortcuts() {
67 // by WindowShortcutHandler at the window level to prevent duplicates67 // by WindowShortcutHandler at the window level to prevent duplicates
68 68
69 // Page refresh shortcuts69 // Page refresh shortcuts
70- _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+r", func() {70+ _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+r", 0, func() {
71 if !s.isActivePane() {71 if !s.isActivePane() {
72 return72 return
73 }73 }
@@ -75,7 +75,7 @@ func (s *ShortcutHandler) RegisterShortcuts() {
75 _ = s.webView.Reload()75 _ = s.webView.Reload()
76 })76 })
77 77
78- _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+shift+r", func() {78+ _ = s.webView.RegisterKeyboardShortcut("cmdorctrl+shift+r", 0, func() {
79 if !s.isActivePane() {79 if !s.isActivePane() {
80 return80 return
81 }81 }
@@ -83,7 +83,7 @@ func (s *ShortcutHandler) RegisterShortcuts() {
83 _ = s.webView.ReloadBypassCache()83 _ = s.webView.ReloadBypassCache()
84 })84 })
85 85
86- _ = s.webView.RegisterKeyboardShortcut("F5", func() {86+ _ = s.webView.RegisterKeyboardShortcut("F5", 0, func() {
87 if !s.isActivePane() {87 if !s.isActivePane() {
88 return88 return
89 }89 }
M internal/app/browser/workspace_diagnostics.go +2 -2
@@ -134,8 +134,8 @@ func describePaneNode(node *paneNode) string {
134134 parts = append(parts, fmt.Sprintf("split orientation=%d", node.orientation))
135135 }
136136
137- if node.container != 0 {
138- parts = append(parts, fmt.Sprintf("widget=%#x", node.container))
137+ if node.container != nil {
138+ parts = append(parts, fmt.Sprintf("widget=%p", node.container))
139139 }
140140
141141 if node.parent != nil {
@@ -134,8 +134,8 @@ func describePaneNode(node *paneNode) string {
134 parts = append(parts, fmt.Sprintf("split orientation=%d", node.orientation))134 parts = append(parts, fmt.Sprintf("split orientation=%d", node.orientation))
135 }135 }
136 136
137- if node.container != 0 {137+ if node.container != nil {
138- parts = append(parts, fmt.Sprintf("widget=%#x", node.container))138+ parts = append(parts, fmt.Sprintf("widget=%p", node.container))
139 }139 }
140 140
141 if node.parent != nil {141 if node.parent != nil {
M internal/app/browser/workspace_geometry_validator.go +6 -6
@@ -50,7 +50,7 @@ func (gv *GeometryValidator) SetDebugMode(debug bool) {
5050 func (gv *GeometryValidator) GetPaneGeometry(node *paneNode) PaneGeometry {
5151 geometry := PaneGeometry{IsValid: false}
5252
53- if node == nil || node.container == 0 {
53+ if node == nil || node.container == nil {
5454 if gv.debugMode {
5555 log.Printf("[geometry] Invalid node or missing container")
5656 }
@@ -58,12 +58,12 @@ func (gv *GeometryValidator) GetPaneGeometry(node *paneNode) PaneGeometry {
5858 }
5959
6060 // Get widget allocation directly - GTK operations are always on main thread
61- allocation := webkit.WidgetGetAllocation(node.container)
61+ x, y, width, height := webkit.WidgetGetAllocation(node.container)
6262
63- geometry.X = allocation.X
64- geometry.Y = allocation.Y
65- geometry.Width = allocation.Width
66- geometry.Height = allocation.Height
63+ geometry.X = x
64+ geometry.Y = y
65+ geometry.Width = width
66+ geometry.Height = height
6767 geometry.IsValid = true
6868
6969 if gv.debugMode {
@@ -50,7 +50,7 @@ func (gv *GeometryValidator) SetDebugMode(debug bool) {
50 func (gv *GeometryValidator) GetPaneGeometry(node *paneNode) PaneGeometry {50 func (gv *GeometryValidator) GetPaneGeometry(node *paneNode) PaneGeometry {
51 geometry := PaneGeometry{IsValid: false}51 geometry := PaneGeometry{IsValid: false}
52 52
53- if node == nil || node.container == 0 {53+ if node == nil || node.container == nil {
54 if gv.debugMode {54 if gv.debugMode {
55 log.Printf("[geometry] Invalid node or missing container")55 log.Printf("[geometry] Invalid node or missing container")
56 }56 }
@@ -58,12 +58,12 @@ func (gv *GeometryValidator) GetPaneGeometry(node *paneNode) PaneGeometry {
58 }58 }
59 59
60 // Get widget allocation directly - GTK operations are always on main thread60 // Get widget allocation directly - GTK operations are always on main thread
61- allocation := webkit.WidgetGetAllocation(node.container)61+ x, y, width, height := webkit.WidgetGetAllocation(node.container)
62 62
63- geometry.X = allocation.X63+ geometry.X = x
64- geometry.Y = allocation.Y64+ geometry.Y = y
65- geometry.Width = allocation.Width65+ geometry.Width = width
66- geometry.Height = allocation.Height66+ geometry.Height = height
67 geometry.IsValid = true67 geometry.IsValid = true
68 68
69 if gv.debugMode {69 if gv.debugMode {

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