Fix activation source window selection - #57
Conversation
Use the Accessibility focused window to disambiguate same-process layer-zero windows so transient helpers cannot invalidate selections. Preserve the permission fallback while failing closed on trusted lookup ambiguity.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a focused-window accessibility query and uses its resolution state to select among macOS on-screen window candidates, with fallback, failure, uniqueness, and frame-tolerance tests. ChangesFocused window selection
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MacOSActivationSourceCapturer
participant SystemMacOSAccessibilityClient
participant WindowCandidates
MacOSActivationSourceCapturer->>WindowCandidates: collect on-screen candidates
MacOSActivationSourceCapturer->>SystemMacOSAccessibilityClient: resolve focused window
SystemMacOSAccessibilityClient-->>MacOSActivationSourceCapturer: resolution state and frame
MacOSActivationSourceCapturer->>WindowCandidates: select first or uniquely matching candidate
WindowCandidates-->>MacOSActivationSourceCapturer: selected window or nil
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Why
A real TextEdit E2E exposed a transient
66×20layer-0 helper window ahead of the document in the CG window list. Selecting the first layer-0 window bound the activation to that helper, while Accessibility correctly reported the document as focused, so GridSelect failed closed withSource changed.The production fix does not filter by size, title, or area. It selects the unique CG candidate matching the AX focused window within the existing ±1pt tolerance.
Validation
git diff --check: PASS16037, CG and AX preflight checks true[0,5), columns[17,24)0267f5dda6750d3d85dda92d356e8d91c2dec3cc83e1f06a2f5a729d5b4295fd, exact expected outputLocal
swift build/swift testremain blocked before repository compilation by the installed Command Line Tools compiler/SDK/PackageDescription mismatch. GitHub Actions is the required official SwiftPM validation.No release or merge action is included.
Summary by CodeRabbit
Bug Fixes
Tests