detached eac27b2

fix(workspace): improve popup handling and logging

Multiple small improvements:

- workspace_pane_ops.go: Don't exit app when closing popups. Popups
  aren't counted in app.panes, so remaining==1 check should exclude them.
- handler.go: Add webviewId to workspace event logs for better debugging
- workspace_hover.go: Fix formatting (gofmt spacing)

These changes improve popup lifecycle handling and make debugging easier.
commit
eac27b20b35daf05fb7d8fc6b38ea8e2de810241
author
bamen · · 2025-10-13 18:03 UTC
committer
bamen · · 2025-10-13 21:15 UTC
parent
4c6ae6a
signature
unsigned
3 files · +4 -3
M internal/app/browser/workspace_hover.go +1 -1
@@ -32,7 +32,7 @@ func (wm *WorkspaceManager) ensureHover(node *paneNode) {
3232
3333 // Debounce hover events to prevent rapid focus changes (minimum 150ms between hover-triggered focus changes)
3434 now := glib.GetMonotonicTime()
35- if node.lastHoverTime > 0 && (now - node.lastHoverTime) < 150000 { // 150ms in microseconds
35+ if node.lastHoverTime > 0 && (now-node.lastHoverTime) < 150000 { // 150ms in microseconds
3636 return
3737 }
3838 node.lastHoverTime = now
@@ -32,7 +32,7 @@ func (wm *WorkspaceManager) ensureHover(node *paneNode) {
32 32
33 // Debounce hover events to prevent rapid focus changes (minimum 150ms between hover-triggered focus changes)33 // Debounce hover events to prevent rapid focus changes (minimum 150ms between hover-triggered focus changes)
34 now := glib.GetMonotonicTime()34 now := glib.GetMonotonicTime()
35- if node.lastHoverTime > 0 && (now - node.lastHoverTime) < 150000 { // 150ms in microseconds35+ if node.lastHoverTime > 0 && (now-node.lastHoverTime) < 150000 { // 150ms in microseconds
36 return36 return
37 }37 }
38 node.lastHoverTime = now38 node.lastHoverTime = now
M internal/app/browser/workspace_pane_ops.go +2 -1
@@ -940,7 +940,8 @@ func (wm *WorkspaceManager) closePane(node *paneNode) (*paneNode, error) {
940940 wm.detachFocus(node)
941941
942942 // STEP 3: Handle trivial exit cases
943- if ctx.remaining == 1 {
943+ // Don't exit if closing a popup - popups aren't counted in app.panes
944+ if ctx.remaining == 1 && !node.isPopup {
944945 return wm.cleanupAndExit(node)
945946 }
946947 if node == wm.root {
@@ -940,7 +940,8 @@ func (wm *WorkspaceManager) closePane(node *paneNode) (*paneNode, error) {
940 wm.detachFocus(node)940 wm.detachFocus(node)
941 941
942 // STEP 3: Handle trivial exit cases942 // STEP 3: Handle trivial exit cases
943- if ctx.remaining == 1 {943+ // Don't exit if closing a popup - popups aren't counted in app.panes
944+ if ctx.remaining == 1 && !node.isPopup {
944 return wm.cleanupAndExit(node)945 return wm.cleanupAndExit(node)
945 }946 }
946 if node == wm.root {947 if node == wm.root {
M internal/app/messaging/handler.go +1 -1
@@ -172,7 +172,7 @@ func (h *Handler) handleWorkspace(msg Message) {
172172 log.Printf("[workspace] Ignoring workspace event %q: webview not attached", msg.Event)
173173 return
174174 }
175- log.Printf("[workspace] Forwarding workspace event: event=%s direction=%s action=%s", msg.Event, msg.Direction, msg.Action)
175+ log.Printf("[workspace] Forwarding workspace event: event=%s direction=%s action=%s webviewId=%s", msg.Event, msg.Direction, msg.Action, msg.WebViewID)
176176 h.workspaceObserver.OnWorkspaceMessage(h.webView, msg)
177177 }
178178
@@ -172,7 +172,7 @@ func (h *Handler) handleWorkspace(msg Message) {
172 log.Printf("[workspace] Ignoring workspace event %q: webview not attached", msg.Event)172 log.Printf("[workspace] Ignoring workspace event %q: webview not attached", msg.Event)
173 return173 return
174 }174 }
175- log.Printf("[workspace] Forwarding workspace event: event=%s direction=%s action=%s", msg.Event, msg.Direction, msg.Action)175+ log.Printf("[workspace] Forwarding workspace event: event=%s direction=%s action=%s webviewId=%s", msg.Event, msg.Direction, msg.Action, msg.WebViewID)
176 h.workspaceObserver.OnWorkspaceMessage(h.webView, msg)176 h.workspaceObserver.OnWorkspaceMessage(h.webView, msg)
177 }177 }
178 178

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