Skip to content

fix(desktop): resolve Save sheet controls to their parent window - #382

Merged
iamnbutler merged 2 commits into
mainfrom
sheet-window
Oct 15, 2026
Merged

iamnbutler merged 2 commits into
mainfrom
sheet-window

Conversation

@iamnbutler

Copy link
Copy Markdown
Contributor

Fixes #378. Pins @githubnext/desktop-tools to ccb4750 (githubnext/desktop-tools#8). That commit adds peekaboo-sheet-window.patch.

Cause. Before a focus or value write, Peekaboo's ActionInputDriver.observationTarget reads the element's identity through DetachedExactWindowFocusReader. That read took its CGWindowID only from the element's AXWindow link, and any failure there produced "The native Accessibility target could not be revalidated before mutation." A Save sheet is its own WindowServer window but is missing from TextEdit's AXWindows, so the observation reaches it only through the document window's tree. The sheet's controls link to the sheet. An Open or Save panel's controls resolve to the Open and Save Panel Service's own window: trycua/cua#4507 recorded the chain button → service window 173, AXSheet 172, parent AXWindow 167. Neither can be resolved to the observed document window, so every click and type on the sheet was refused before dispatch.

Change (in desktop-tools). AXWindowIDResolver.owningWindowID accepts the AXWindow link only when it is a same-process AXWindow. Otherwise it follows a bounded AXParent chain to the nearest same-process AXWindow. An element with no such ancestor keeps its direct window identity. The detached reader uses the same helper within its deadline, so element identity, exact-window click receipts and post-write observation all name the same window. Sibling windows are still refused.

Verification. Done: bun types, bun run ci, the native desktop-tools build run the way apps/desktop/scripts/helper.ts runs it (the old stack prefix plus the new patch applied and built), desktop-tools CI (unsigned macOS build), and the updated Peekaboo unit tests AXWindowIDResolverTests and DetachedExactWindowFocusMetadataTests, which use injected fakes and no live AX.

Unverified against a live Save sheet. This Mac was running a study, so no GUI app could be opened. The study lead will rerun scenario 20 step 3. If it still refuses, the next suspect is the reader's 50 ms per-call AX messaging cap on the panel's remote elements.

Built in Ace

No — built with Claude Code outside Ace by an overnight issue watcher, because this Mac's Ace Canary is a participant in the running two-person study (#218); dogfooding gap tracked in #5.

Pin desktop-tools ccb4750, which adds peekaboo-sheet-window.patch. Sheet
controls link to the sheet (or, for Open/Save panels, the Open and Save
Panel Service's window), so the identity read before focus and value
writes found no observed window and refused every mutation. Their owner
is now the nearest same-process AXWindow.

Fixes #378

Why: package.json | desktop-tools must stay at or after ccb4750 so sheet controls resolve to the AXWindow the sheet is attached to; older pins refuse every mutation on Save/Open sheets (#378)
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.

Desktop tools can't operate a Save sheet: target could not be revalidated before mutation

1 participant