detached 72ad164

fix(workspace): setup popup handling for all pane creation paths

Fixes OAuth popups not functioning correctly in stacked panes and split operations.
The `setupPopupHandling()` call was missing in several pane creation code paths,
causing popup windows to not properly register their handlers.

Added setupPopupHandling() calls in:
- finalizeStackCreation: When creating new stacked panes
- CloseStackedPane: When converting last stacked pane back to regular pane
- splitNode: When creating new panes via split operations

This ensures all panes have proper popup lifecycle management regardless of
how they were created (direct, stacked, or split).
commit
72ad1649f0670dedc060561e5cfb90bbbc0ee799
author
bnema · · 2025-11-17 19:27 UTC
committer
bnema · · 2025-11-17 19:18 UTC
parent
ff83895
signature
unsigned
3 files · +4 -0
M internal/app/browser/stacked_panes.go +2 -0
@@ -343,6 +343,7 @@ func (spm *StackedPaneManager) reattachToParent(container gtk.Widgetter, target
343343 func (spm *StackedPaneManager) finalizeStackCreation(stackNode, newLeaf *paneNode, insertIndex int) (*paneNode, error) {
344344 // Update workspace state first
345345 spm.wm.viewToNode[newLeaf.pane.webView] = newLeaf
346+ spm.wm.setupPopupHandling(newLeaf.pane.webView, newLeaf)
346347 spm.wm.ensureHover(newLeaf)
347348 spm.wm.app.panes = append(spm.wm.app.panes, newLeaf.pane)
348349 if newLeaf.pane.zoomController != nil {
@@ -876,6 +877,7 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error {
876877 lastPane.stackedPanes = nil
877878 lastPane.titleBar = nil
878879 spm.wm.viewToNode[lastPane.pane.webView] = lastPane
880+ spm.wm.setupPopupHandling(lastPane.pane.webView, lastPane)
879881
880882 generation := spm.wm.nextCleanupGeneration()
881883 spm.wm.cleanupPane(node, generation)
@@ -343,6 +343,7 @@ func (spm *StackedPaneManager) reattachToParent(container gtk.Widgetter, target
343 func (spm *StackedPaneManager) finalizeStackCreation(stackNode, newLeaf *paneNode, insertIndex int) (*paneNode, error) {343 func (spm *StackedPaneManager) finalizeStackCreation(stackNode, newLeaf *paneNode, insertIndex int) (*paneNode, error) {
344 // Update workspace state first344 // Update workspace state first
345 spm.wm.viewToNode[newLeaf.pane.webView] = newLeaf345 spm.wm.viewToNode[newLeaf.pane.webView] = newLeaf
346+ spm.wm.setupPopupHandling(newLeaf.pane.webView, newLeaf)
346 spm.wm.ensureHover(newLeaf)347 spm.wm.ensureHover(newLeaf)
347 spm.wm.app.panes = append(spm.wm.app.panes, newLeaf.pane)348 spm.wm.app.panes = append(spm.wm.app.panes, newLeaf.pane)
348 if newLeaf.pane.zoomController != nil {349 if newLeaf.pane.zoomController != nil {
@@ -876,6 +877,7 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error {
876 lastPane.stackedPanes = nil877 lastPane.stackedPanes = nil
877 lastPane.titleBar = nil878 lastPane.titleBar = nil
878 spm.wm.viewToNode[lastPane.pane.webView] = lastPane879 spm.wm.viewToNode[lastPane.pane.webView] = lastPane
880+ spm.wm.setupPopupHandling(lastPane.pane.webView, lastPane)
879 881
880 generation := spm.wm.nextCleanupGeneration()882 generation := spm.wm.nextCleanupGeneration()
881 spm.wm.cleanupPane(node, generation)883 spm.wm.cleanupPane(node, generation)
M internal/app/browser/workspace_manager.go +1 -0
@@ -171,6 +171,7 @@ func NewWorkspaceManager(app *BrowserApp, rootPane *BrowserPane) *WorkspaceManag
171171 manager.root = root
172172 manager.mainPane = root
173173 manager.viewToNode[rootPane.webView] = root
174+ manager.setupPopupHandling(rootPane.webView, root)
174175 manager.ensureHover(root)
175176
176177 if handler := rootPane.MessageHandler(); handler != nil {
@@ -171,6 +171,7 @@ func NewWorkspaceManager(app *BrowserApp, rootPane *BrowserPane) *WorkspaceManag
171 manager.root = root171 manager.root = root
172 manager.mainPane = root172 manager.mainPane = root
173 manager.viewToNode[rootPane.webView] = root173 manager.viewToNode[rootPane.webView] = root
174+ manager.setupPopupHandling(rootPane.webView, root)
174 manager.ensureHover(root)175 manager.ensureHover(root)
175 176
176 if handler := rootPane.MessageHandler(); handler != nil {177 if handler := rootPane.MessageHandler(); handler != nil {
M internal/app/browser/workspace_pane_ops.go +1 -0
@@ -602,6 +602,7 @@ func (wm *WorkspaceManager) splitNode(target *paneNode, direction string, existi
602602 // GTK4 automatically handles widget rendering after reparenting - no manual updates needed
603603
604604 wm.viewToNode[newPane.webView] = newLeaf
605+ wm.setupPopupHandling(newPane.webView, newLeaf)
605606 wm.ensureHover(newLeaf)
606607
607608 // Don't ensure hover on originalTarget when splitting from stack - it competes with new pane focus
@@ -602,6 +602,7 @@ func (wm *WorkspaceManager) splitNode(target *paneNode, direction string, existi
602 // GTK4 automatically handles widget rendering after reparenting - no manual updates needed602 // GTK4 automatically handles widget rendering after reparenting - no manual updates needed
603 603
604 wm.viewToNode[newPane.webView] = newLeaf604 wm.viewToNode[newPane.webView] = newLeaf
605+ wm.setupPopupHandling(newPane.webView, newLeaf)
605 wm.ensureHover(newLeaf)606 wm.ensureHover(newLeaf)
606 607
607 // Don't ensure hover on originalTarget when splitting from stack - it competes with new pane focus608 // Don't ensure hover on originalTarget when splitting from stack - it competes with new pane focus

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