Repository navigation
fix(macos): close quick tools popup on first Escape while input is focused - #7454
Merged
Merged
Conversation
…cused When the Quick Tools popup (a Window with kind=popup / closeOnEscape) had focus in its search input, pressing Escape was consumed twice: first to blur/clear the text field, then a second time to close the window. Change the macOS platform layer to let Escape pass through the keymap and navigation text-field handling so that a popup with closeOnEscape closes on the first Escape press, regardless of input focus or content.
Generated-by: Codex
…im redundant test cases
M4n5ter
approved these changes
Nov 30, 2026
M4n5ter
left a comment
Member
There was a problem hiding this comment.
Refactored focused Escape to pass window root explicitly without mutating input's event_root and trimmed redundant test cases; all 6 native AppKit window_escape cases verified locally.
|
No description provided. |
5 of 8 tasks
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
Quick Tools required two Escape presses when its native search input had focus. AppKit's
cancelOperation:handler consumed the first press by blurring the field, so the window's close-on-Escape policy was never reached.Route native input cancellation through the editor's actual window and share the dismissal order with unused Escape events from hosted views. For a window with
closeOnEscape, inner modals/stacks handle Escape before the window closes. Composition and application key bindings retain priority;closeOnEscape=falsekeeps the existing field-blur behavior.Verification
On a Mac mini running macOS 27.0.1:
closeOnEscape=false, an inner modal, and a custom Escape binding. All pass. The first-Escape assertion fails on the previous PR headec5852c22e.NSH_WINDOW_ESCAPE_CHECK_ONLY=1 cargo test --manifest-path third-party/nsh/Cargo.toml --locked -p nsh-platform-macos --no-default-features --features js,terminal --test native -- --ignoredNSH_SELECTION_KEYS_CHECK_ONLY=1checks pass. Scoped Rust formatting, staged ASF-header checks, andgit diff --checkpass.NSH_FOCUS_SELECTION_CHECK_ONLY=1fails its same-turn tap-to-click selection assertion (1..1instead of0..5) on both this change and a freshly rebuilt, unmodifiedec5852c22e.ALTER TABLE agent_recall_messages DROP COLUMN foldedreturningSQLITE_FULL); the migration rolls back. The local trial therefore pairs this client with the previously installed Host. This is not a claim that the full Host upgrade passes. The eight native cases above cover Escape; a physical global-shortcut product check remains manual.AI use
Codex helped implement the correction, add the native regression tests, and revise this description. The follow-up commit includes
Generated-by: Codex.Checklist
Does this PR entail a breaking change or persisted-data migration?
Does this PR entail a change in behavior?