detached 9cc0239

fix(shortcuts): restore page reload shortcuts

Page reload shortcuts (Ctrl+R, Ctrl+Shift+R, F5, Ctrl+F5) were registered
in shortcuts.go using a stub method that did nothing. Moved them to the
window-level shortcut handler where they actually work.

- Ctrl+R / F5: Normal reload
- Ctrl+Shift+R / Ctrl+F5: Hard reload (bypass cache)

Both handlers target the active pane with proper locking and error handling.
commit
9cc0239007bcc7a17162ef4c1cc6f36528e3bb27
author
bnema · · 2025-11-16 18:24 UTC
committer
bnema · · 2025-11-16 19:14 UTC
parent
347686c
signature
unsigned
1 file · +37 -0
M internal/app/browser/window_shortcuts.go +37 -0
@@ -63,6 +63,11 @@ func (h *WindowShortcutHandler) registerGlobalShortcuts() error {
6363 {"ctrl+t", h.handleNewTab, "New tab (no-op)"},
6464 {"ctrl+w", h.handleClosePane, "Close current pane"},
6565 {"F12", h.handleDevTools, "Developer tools"},
66+ // Page reload shortcuts
67+ {"ctrl+r", h.handleReload, "Reload page"},
68+ {"ctrl+shift+r", h.handleHardReload, "Hard reload (bypass cache)"},
69+ {"F5", h.handleReload, "Reload page"},
70+ {"ctrl+F5", h.handleHardReload, "Hard reload (bypass cache)"},
6671 // Zoom shortcuts - global level for proper active pane targeting
6772 {"ctrl+plus", h.handleZoomIn, "Zoom in"},
6873 {"ctrl+equal", h.handleZoomIn, "Zoom in (=)"},
@@ -181,6 +186,38 @@ func (h *WindowShortcutHandler) handlePrint() {
181186 }
182187 }
183188
189+func (h *WindowShortcutHandler) handleReload() {
190+ h.mu.Lock()
191+ defer h.mu.Unlock()
192+
193+ if h.app.activePane == nil || h.app.activePane.webView == nil {
194+ log.Printf("[window-shortcuts] No active pane for reload")
195+ return
196+ }
197+
198+ log.Printf("[window-shortcuts] Reload page -> pane %p", h.app.activePane.webView)
199+
200+ if err := h.app.activePane.webView.Reload(); err != nil {
201+ log.Printf("[window-shortcuts] Failed to reload page: %v", err)
202+ }
203+}
204+
205+func (h *WindowShortcutHandler) handleHardReload() {
206+ h.mu.Lock()
207+ defer h.mu.Unlock()
208+
209+ if h.app.activePane == nil || h.app.activePane.webView == nil {
210+ log.Printf("[window-shortcuts] No active pane for hard reload")
211+ return
212+ }
213+
214+ log.Printf("[window-shortcuts] Hard reload (bypass cache) -> pane %p", h.app.activePane.webView)
215+
216+ if err := h.app.activePane.webView.ReloadBypassCache(); err != nil {
217+ log.Printf("[window-shortcuts] Failed to hard reload page: %v", err)
218+ }
219+}
220+
184221 // handleZoomIn increases zoom level by 10%
185222 func (h *WindowShortcutHandler) handleZoomIn() {
186223 h.handleZoom("in", 1.1)
@@ -63,6 +63,11 @@ func (h *WindowShortcutHandler) registerGlobalShortcuts() error {
63 {"ctrl+t", h.handleNewTab, "New tab (no-op)"},63 {"ctrl+t", h.handleNewTab, "New tab (no-op)"},
64 {"ctrl+w", h.handleClosePane, "Close current pane"},64 {"ctrl+w", h.handleClosePane, "Close current pane"},
65 {"F12", h.handleDevTools, "Developer tools"},65 {"F12", h.handleDevTools, "Developer tools"},
66+ // Page reload shortcuts
67+ {"ctrl+r", h.handleReload, "Reload page"},
68+ {"ctrl+shift+r", h.handleHardReload, "Hard reload (bypass cache)"},
69+ {"F5", h.handleReload, "Reload page"},
70+ {"ctrl+F5", h.handleHardReload, "Hard reload (bypass cache)"},
66 // Zoom shortcuts - global level for proper active pane targeting71 // Zoom shortcuts - global level for proper active pane targeting
67 {"ctrl+plus", h.handleZoomIn, "Zoom in"},72 {"ctrl+plus", h.handleZoomIn, "Zoom in"},
68 {"ctrl+equal", h.handleZoomIn, "Zoom in (=)"},73 {"ctrl+equal", h.handleZoomIn, "Zoom in (=)"},
@@ -181,6 +186,38 @@ func (h *WindowShortcutHandler) handlePrint() {
181 }186 }
182 }187 }
183 188
189+func (h *WindowShortcutHandler) handleReload() {
190+ h.mu.Lock()
191+ defer h.mu.Unlock()
192+
193+ if h.app.activePane == nil || h.app.activePane.webView == nil {
194+ log.Printf("[window-shortcuts] No active pane for reload")
195+ return
196+ }
197+
198+ log.Printf("[window-shortcuts] Reload page -> pane %p", h.app.activePane.webView)
199+
200+ if err := h.app.activePane.webView.Reload(); err != nil {
201+ log.Printf("[window-shortcuts] Failed to reload page: %v", err)
202+ }
203+}
204+
205+func (h *WindowShortcutHandler) handleHardReload() {
206+ h.mu.Lock()
207+ defer h.mu.Unlock()
208+
209+ if h.app.activePane == nil || h.app.activePane.webView == nil {
210+ log.Printf("[window-shortcuts] No active pane for hard reload")
211+ return
212+ }
213+
214+ log.Printf("[window-shortcuts] Hard reload (bypass cache) -> pane %p", h.app.activePane.webView)
215+
216+ if err := h.app.activePane.webView.ReloadBypassCache(); err != nil {
217+ log.Printf("[window-shortcuts] Failed to hard reload page: %v", err)
218+ }
219+}
220+
184 // handleZoomIn increases zoom level by 10%221 // handleZoomIn increases zoom level by 10%
185 func (h *WindowShortcutHandler) handleZoomIn() {222 func (h *WindowShortcutHandler) handleZoomIn() {
186 h.handleZoom("in", 1.1)223 h.handleZoom("in", 1.1)

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