fix(macos-helper): skip the window-sharing indicator when choosing the front window
Summary
With AGENT_DEVICE_MACOS_APP_BACKEND=native, scroll refused with no scroll area with a settable scroll bar under the window center for an app whose window was being shared, and screenshot returned a 132x40 image.
While a ScreenCaptureKit stream captures an app window, macOS 27 adds a 66x20 layer-0 window in front of it. That window's only child is a button titled WindowSharingSessionButton. frontWindow picked this indicator, so scroll hit-tested its center and screenshot captured it. Now, when the app has more than one eligible window, frontWindow skips a front candidate whose accessibility window is that indicator. The probe is bounded: 0.1 s per element, 0.5 s in total. A lone window never triggers an accessibility read.
Not the #3888 shape: unshared ScrollView, Form, and NavigationSplitView pages scroll on base.
4 files. Related: #3213.
Validation
Head 497da48a2, base 45125d717.
pnpm check:affected --run --head 497da48a2passed (exactCommit: true).macos-helperis GitHub-authoritative.swift testinapple/macos-helper: 22 passed.
Live runs on macOS 27.0, with the indicator window present:
| Target | Helper | scroll | screenshot |
|---|---|---|---|
| Hosted Stim Desktop on a second Mac (its streamed window) | base | no-scroll-bar | 132x40 |
head 497da48a2 | scrolled, referenceHeight: 772 | 1800x1544 | |
Local SwiftUI fixture, shared via SCStream | base | no-scroll-bar | 132x40 |
335b2f104 | scrolled | 3840x1936 |
The fixture run predates the probe-bounding commits; the hosted run covers the head.