fix(revyl): establish the iOS screen origin when the root frame matches the screen

Merged
KA
2d ago
+60-3

Summary

Since 0.21.37, every iOS tap by ref on Revyl fails with window-origin-unknown. assertSnapshotScreenOrigin accepts only a reported viewport, and resolveIosAxTreeViewport, whose only caller is the Revyl plugin, returned derived for any usable tree root. On a live iPhone 17 Pro Max the root was exactly the health screen, 0,0,440,956.

A root that is exactly the provider's screen at the origin is now reported: two independent reads agree that window space is screen space. Any other root stays derived, including one with width and height swapped. A CONSERVATIVE: note explains why: Revyl reads its screen once, and no landscape run has confirmed which coordinate space taps use after a rotation.

Found running e2e's @e2e-dev/revyl against 0.21.37 (e2e-inc/e2e#1708).

Validation

At the head commit:

  • check:affected --run --head passed every step through vitest-related.
  • unit: 19,766 passed and 2 failed. Both failures are -Werror Swift tests, which need the iphonesimulator SDK this Mac lacks.
  • capture-kit covers a root that matches the screen (reported), an offset root, a swapped root and a missing screen (all derived). The Revyl interactor test covers the plugin seam.
  • On a live Revyl iOS session, snapshot -i gave @e13 [radiobutton] "Fleet". press @e13 tapped (220, 904), and the next snapshot showed Fleet selected. The same flow fails with window-origin-unknown on the published 0.21.37.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.