Skip to content

fix(little-window): close the focused panel with Command-W - #532

Merged
Alexays merged 2 commits into
Alexays:mainfrom
espetro:upstream/little-window-close
Dec 2, 2026
Merged

Alexays merged 2 commits into
Alexays:mainfrom
espetro:upstream/little-window-close

Conversation

@espetro

@espetro espetro commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Keep Little windows out of the active browser window's floating-panel keyboard monitor, so Command-W reaches the focused panel instead of being claimed as tab.close for the browser window behind it.
  • Cover the regression in LittleWindowTests: the monitor leaves the key to the panel, the panel's existing close action closes it, and the tab in the browser window behind stays open.

Fixes #531

Why and measured impact

  • Before: one Command-W in a focused Little window closed one tab in the browser window behind and zero Little windows. After: zero browser tabs close and the one focused Little window closes.
  • Runtime cost is one LittlePanel type check in the existing key-event monitor; there is no idle work and no new timer or observer.
  • Validation: make ui-lint ui-test site-check site-test docs-check docs-test hooks-test bootstrap-test perf-summary-test check-summary-test agent-eval-test ext-bridge-test swiftlint release-status ui-build ext-bridge-build test-build passed locally. Measured totals in that run include 688 UI tests, 587 extension bridge tests, SwiftLint with 0 violations in 335 files, and a clean build-for-testing compile. Swift runtime tests are left to CI because they open windows and take keyboard focus.
  • Honest limit: no screenshots. This changes keyboard routing only, with no visible chrome or motion.

Test plan

  • Non-Swift validation checks and make test-build pass locally
  • Focus a Little window and press Command-W: the Little window closes, and the browser tab behind it remains open
  • Focus a Little window and choose File > Close Tab: same result

@espetro
espetro requested a review from Alexays as a code owner December 2, 2026 20:02
…load to the panel

Excluding Little windows from the browser window's key monitor left Cmd-T, Cmd-1..9, Ctrl-Tab and extension commands dead there, and let a page swallow Cmd-W. The monitor sees the panel's keys again and sends the shortcuts the panel answers itself (close tab, close window, open location, reload, copy URL) to it.
@Alexays
Alexays merged commit 5583b82 into Alexays:main Dec 2, 2026
3 checks passed
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.

[Bug] Command-W in a Little window closes a tab in the browser window behind it

2 participants