Add Cmd-W close shortcut on macOS#24
Open
dimifontaine wants to merge 1 commit into
Open
Conversation
Handle the standard macOS Cmd-W window-close shortcut in GlimpsePanel while preserving the existing key-equivalent behavior for editing shortcuts. Add an opt-in macOS keyboard integration test that sends Cmd-W through System Events and waits for the closed event.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds native macOS
⌘Whandling to close Glimpse windows.Why
I use Glimpse mostly as a lightweight viewer from a full-screen CLI workflow. It lets me preview web/content without feeling like I am switching environments, but closing the window currently requires reaching for the mouse because
⌘Wdoes not close the Glimpse window.On macOS,
⌘Wis the expected keyboard shortcut for closing the current window, so supporting it makes Glimpse feel more natural for keyboard-driven workflows.Implementation
The change is intentionally minimal:
⌘Wbranch inGlimpsePanel.performKeyEquivalent;close(), reusing the existing close/window lifecycle.Existing
⌘C,⌘V,⌘A,⌘Z, and⇧⌘Zbehavior is unchanged.Tests
npm run build:macosnpm testnpm run test:keyboardAlso manually tested opening a Glimpse window on macOS and closing it with
⌘W.