Skip to content

fix: normalize physical iOS landscape taps - #1520

Merged
thymikee merged 3 commits into
mainfrom
agent/fix-ios-landscape-taps
Jul 31, 2026
Merged

fix: normalize physical iOS landscape taps#1520
thymikee merged 3 commits into
mainfrom
agent/fix-ios-landscape-taps

Conversation

@thymikee

@thymikee thymikee commented Jul 31, 2026

Copy link
Copy Markdown
Member

Summary

Fixes physical iOS taps in landscape (Closes #1511).

On physical iOS devices, XCUIScreen.main.screenshot() can retain portrait dimensions after the interface rotates while accessibility frames use logical landscape dimensions. Synthesized touch mapping therefore delivered taps in the wrong coordinate space. Selector taps also bypassed the synthesized touch path.

This change normalizes the synthesized reference frame from the active app orientation in both portrait and landscape, passes the active app through all synthesized gesture context builders, and routes every touch iOS selector tap through the same synthesized coordinate path as explicit taps. If private synthesis is unavailable, selector taps preserve the established XCTest activation/coordinate fallback. Landscape geometry tests, selector fallback coverage, and selector command-contract coverage were added.

Validation

  • Physical iPhone: Safari selector and explicit-coordinate taps passed in landscape-left and landscape-right; the session was closed afterward.
  • iOS runner production and unit-test-enabled builds passed.
  • Focused simulator XCTest passed: testOrientedSynthesizedScreenshotReferenceFrameUsesLandscapeLogicalDimensions and testSelectorTapFallsBackToXCTestCoordinateWhenPrivateSynthesisFails.
  • Focused TypeScript and provider integration tests passed; full provider integration previously passed with 42 files, 141 tests, and 19 skipped.
  • Static affected checks passed through format, lint, typecheck, layering, fallow, and build.
  • The affected coverage run timed out once on the known contention-shaped Metro doctor test; an immediate rerun hit the same timeout, while the doctor file passes in isolation (9/9). GitHub CI remains authoritative for the full matrix.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.91 MB 1.91 MB +28 B
JS gzip 612.7 kB 612.7 kB -2 B
npm tarball 730.3 kB 730.7 kB +410 B
npm unpacked 2.56 MB 2.56 MB +3.2 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 24.1 ms 24.4 ms +0.3 ms
CLI --help 50.6 ms 48.8 ms -1.9 ms

Top changed chunks: no changes in the largest emitted chunks.

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed exact head 414bd035742626867eefc4421cf832a20c226845 against #1511 and ADR 0011.

Changes requested — [P1] preserve the established XCTest fallback for synthesized selector taps. The new selector branch calls unsupportedResponse(for:) and returns UNSUPPORTED_OPERATION whenever private synthesizeTap is unavailable. That bypasses the existing selector activation/coordinate path even though the coordinateTap policy explicitly declares .xctestCoordinateAllowed; explicit coordinate taps already honor that policy by recording a fallback and continuing to tapAt. On an Xcode/iOS combination where the private bridge rejects synthesis, this changes every iOS selector click from a slower supported fallback into a hard failure. Let the selector branch fall through to its existing activateElement/tapAt path when synthesis is unsupported, record the fallback decision consistently, and add a runner regression proving the fallback executes.

The orientation normalization and the physical-device landscape-left/right evidence otherwise address #1511’s motivating failure. Exact-head static, coverage, integration, build, and release checks are green; three smoke jobs are still running.

@thymikee

Copy link
Copy Markdown
Member Author

Re-reviewed exact head 638177cd7b414a4a869a4c98e0f472ac20fefeef: the selector synthesis failure now falls through to the established XCTest activation/coordinate route with disclosed fallback metadata, and the swizzled runner regression fails against the prior hard-return. Active-app orientation propagation plus portrait, landscape-left/right, and unknown-orientation frame tests preserve the #1511 fix. No code findings; the physical landscape evidence is credible.

Not labeling yet because iOS Smoke remains red. Its failure is the unrelated delayed-alert RUNNER_BUSY AX-watchdog recovery flake, not this gesture path; rerun/disposition that check before readiness.

Residual risk: no separately authorized cross-vendor review was performed.

@thymikee
thymikee marked this pull request as ready for review July 31, 2026 13:36
@thymikee
thymikee merged commit 2e0ed0a into main Jul 31, 2026
31 of 32 checks passed
@thymikee
thymikee deleted the agent/fix-ios-landscape-taps branch July 31, 2026 13:36
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-31 13:37 UTC

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.

Physical iOS device: taps land in an unrotated coordinate space in landscape (AX rects rotate, touch injection does not)

1 participant