fix(ios): report keyboard focus from the private-AX snapshot bridge

Merged
TH
8h ago
+108-3

Summary

The private-AX bridge (RunnerAXSnapshotBridge.m) set focused from hasFocus only. A text input under the software keyboard holds hasKeyboardFocus, so it snapshotted as unfocused whenever the XCTest channel was penalized and every snapshot came from private AX. The bridge now reads hasKeyboardFocus || hasFocus, the same rule as the XCTest producers' focusBool (#2925).

A new shared fixture, contracts/fixtures/ios-focus-witness.json, and one runner unit test drive focusBool and the bridge (snapshotTree) from the same cases. The stale focusBool comment that said the bridge reads hasFocus alone is updated.

4 files. Fixes #4112

Validation

  • Before the fix, the new test failed with 2 failures: "keyboard focus alone" and "focus key absent" on the private-AX bridge. After the fix it passes (macOS host lane, -only-testing), together with the existing focusBool test.
  • Live, iPhone Air simulator (iOS 27.0), Settings search field focused: snapshot -i --actions --json reports backend: private-ax (requested-backend) and focused: true on the SearchField.
  • pnpm check:affected --run --head 9b4d3c6c98: passed, exactCommit=true.
  • CI: the macOS host XCTest lane runs the new test.

šŸ¤– Generated with Claude Code