Skip to content

fix(browser): keep the keys in the palette opened over a focused page - #1196

Merged
omartelo merged 1 commit into
mainfrom
fix/browser-pane-palette-focus
Nov 17, 2026
Merged

omartelo merged 1 commit into
mainfrom
fix/browser-pane-palette-focus

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

Summary

With a browser pane focused, opening the command palette (Ctrl+K) and typing piled every letter at the start of the field ("abc" came out as "cba").

browserInput took the focus back for the page on every frame the pane was focused, with no check for anything open over it. The palette refocuses its field each frame it lacks it, so the two traded focus every frame. Each FocusCmd resets the router's editor state, so the selection Gio's window types over (EditorInsert) stayed at 0.

The pane now asks terminalTakesKeys before taking the focus back, the same gate the terminal panes use (stage_layout.go). That also covers the worktree dialog, comment editing and the sidebar, dock and git panel fields over a page.

Test plan

  • TestAnOpenPaletteKeepsTheKeysFromAFocusedPane types "abc" into the palette over a focused pane the way Gio's EditorInsert does; it fails on main (the text goes to the page) and passes here.
  • TestTheClosingNoteKeepsTheKeysOfAFocusedPane: only its window fixture changed, since browserInput now reads the panels terminalTakesKeys asks.
  • native/: gofmt -l ., go vet ./..., go fix -diff ./..., go test ./... clean.

The browser pane took the focus back on every frame it was focused, so
the palette and the pane traded it each frame. Each trade reset the
selection Gio types over, and every letter landed at offset 0. The pane
now asks terminalTakesKeys first, as the terminal panes do.
@omartelo
omartelo merged commit d8f140f into main Nov 17, 2026
8 checks passed
@omartelo
omartelo deleted the fix/browser-pane-palette-focus branch November 17, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant