Repository navigation
fix: admit keyboard input to sheet fields of the observed window - #9
Merged
Merged
Conversation
The exact focused-element receipt used before keyboard input, literal insertion and paste required the receiver's own AXWindow link to name the observed window. Sheet controls link to the sheet, and Open/Save panel fields can have no AXWindow at all (kAXErrorNoValue), so desktop_insert refused in a Save sheet. Resolve the owner through the shared resolver, track the attached sheet, and admit a sheet receiver only while that sheet is the key window.
This was referenced Oct 15, 2026
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.
Adds
peekaboo-sheet-focus.patchfor githubnext/ace#390: `desktop_insert` into a Save sheet's filename field refused with "Literal insertion could not establish its read-only preflight … focused element AXWindow failed with AX error -25212" ("Exact focused-element receipt is stale"). `desktop_type` (an AX value write) worked after #8.Cause. #8 routed the value/focus identity read through `AXWindowIDResolver.owningWindowID`, but keyboard input (literal insertion, paste, exact-window keys) validates a separate receipt in `DetachedExactWindowFocusReader.read(expected:phase:)`. That path read the receiver's own `AXWindow` attribute and required it to name the observed window. An Open/Save panel field has no AXWindow (-25212 is kAXErrorNoValue), and an in-process sheet control's AXWindow names the sheet, so the receipt was always stale. Behind that, the key-window gate required the app's focused window to be the observed window, but while a sheet is up the sheet is key, so it would refuse next.
Change.
Verification. `npm run check`. Full native build via `node dist/build.js --out … --scratch …` from a pristine Peekaboo checkout, applying the whole stack. `swift test` in PeekabooAutomationKit for `AXWindowIDResolverTests|DetachedExactWindowFocus*|UIAutomationExactWindowFocusTests|HotkeyServiceBackgroundPreparationTests|DetachedAXObservationWorker*|BackgroundInputDriver*`: all pass except `BackgroundInputDriverPositionalTargetTests` "positional value policy…" (focus/allowed), which fails on the AXFocused readback added by `peekaboo-point-focus.patch` and is unrelated to this diff. As in #8, the test target needed a local, uncommitted `default` case in `ClipboardPasteTransactionGateTests` to compile.
Not verified against a live Save sheet. The Mac was running a study and no GUI app could be opened. It assumes the app's AXFocusedWindow is the sheet while a sheet field has focus, which is the AppKit key-window behavior. If macOS instead reports the parent window, insertion still refuses before input ("keyboard focus is not on the target window") rather than typing.