gstack/ios-qa/docs
Ryan Stern bea2468494 fix(ios-qa): walker now sees SwiftUI elements, not just hosting shells
The /elements walker returned only top-level `_UIHostingView` /
`HostingView` shells on SwiftUI screens — three entries for a full
Dashboard, all with empty identifier/label and a 0,0,390,844 frame.
SwiftUI vends its AX leaves through the indexed accessor
(`accessibilityElementCount` + `accessibilityElement(at:)`) on the
hosting container, not through `accessibilityElements` (which returns
nil OR an empty array). The previous walker only fell through to the
indexed path on nil, not on empty — so SwiftUI leaves were silently
dropped.

Fix is three coordinated changes to ElementsBridgeImpl plus an opt-in
escape hatch:

1. Force materialization via `UIAccessibility.post(.layoutChanged, …)`
   before the walk. Public API, no-op when VoiceOver already populated
   the tree, doesn't speak.
2. Always run the indexed accessor when `accessibilityElements` is nil
   OR empty. This is the actual SwiftUI path.
3. Read identifier/label/value/traits/frame from synthetic AX elements
   via KVC over the documented `UIAccessibility` informal protocol
   property names — safe and version-independent across the private
   element classes (`_AXSnapshotElement`, `_UIAccessibilityElementMockView`, …).
4. New `.gstackProbe("identifier")` SwiftUI ViewModifier + thread-safe
   `GstackProbeRegistry` for views the AX tree refuses to surface
   (intentionally hidden, custom Canvas, decorative Shape stacks). Probe
   sets `.accessibilityIdentifier(_:)` AND registers (id, frame) in the
   registry; the walker merges these in as synthetic entries tagged
   `"source":"gstack-probe"`.

Also filters empty container synthetic nodes (no label/id/value/traits)
that were clogging the output before.

Docs in `ios-qa/docs/swiftui-accessibility.md` cover the root cause,
what the fix does/doesn't address, and when to reach for `.gstackProbe`
vs vision-based coordinate tapping.

Typechecks clean against iOS 16 + iOS 17 SDKs, Swift 6 strict
concurrency. Live-device validation pending — PR author will port to
downstream app + report new element count.
2026-05-27 11:30:35 -07:00
..
swiftui-accessibility.md fix(ios-qa): walker now sees SwiftUI elements, not just hosting shells 2026-05-27 11:30:35 -07:00
tailscale-acl-example.md v1.43.0.0 feat: iOS device-farm (5 skills, Mac daemon, Tailscale) (#1574) 2026-05-21 16:09:26 -07:00