Skip to content

iOS: HealthKit repro + snapshot frame normalization for cross-process sheets#3250

Open
simon-gilmurray wants to merge 7 commits intomainfrom
sg-healthkit-integration
Open

iOS: HealthKit repro + snapshot frame normalization for cross-process sheets#3250
simon-gilmurray wants to merge 7 commits intomainfrom
sg-healthkit-integration

Conversation

@simon-gilmurray
Copy link
Copy Markdown
Contributor

@simon-gilmurray simon-gilmurray commented May 1, 2026

Context

We've seen iOS modal / system-sheet style UI where taps land wrong: hierarchy still exposes the controls, but frame-based coordinates don't match on-screen placement.

This branch adds HealthKit-backed UI in the Flutter demo app to reproduce the issue, plus a Maestro flow that asserts we can authorize and dismiss cleanly.

Screenshot (repro):
Screenshot 2026-05-01 at 12 13 08


Changes

Demo app & E2E

  • demo_app: Flow to exercise Health AccessTurn On AllAllow and assert dismissal.
  • fail_health_access.yaml: Assert Turn On All is gone (avoids confusing "Health Access" chrome elsewhere on screen).

iOS XCTest runner (MaestroDriver)

Cross-process subtrees stitched into XCUIApplication snapshots sometimes report frame in window-local coords while taps use screen coords. visibleFrame can diverge at the stitching boundary; descendants often still show visibleFrame == frame, so we don't fix this by using visibleFrame on every node — we take visibleFrame.origin − frame.origin at guarded boundaries, require windowContextID transition + remote subtree (isRemote), and inherit that offset to descendants.

  • ViewHierarchyHandler: Recursive walk + offset inheritance + docs.
  • AXElement (runner UITests Models): frameOverride when building from dictionaryRepresentation.

Bundled Simulator driver artifacts

Simulator driver zips under maestro-ios-driver rebuilt from runner sources.


Testing

  • Demo app feature (iOS)
  • fail_health_access.yaml passes with driver fix
  • Builds / runs locally; Simulator driver zips updated

@Fishbowler
Copy link
Copy Markdown
Contributor

Annoyingly, our CI doesn't run the demo_app tests on iOS right now

Comment thread e2e/demo_app/.maestro/fail_health_access.yaml Outdated
When a host app snapshot merges a remote window (e.g. HealthKit authorization), descendant frames stay in window-local coords while taps use screen coords. Traverse the XCTest snapshot, detect windowContextID boundaries whose subtree contains remote elements, and apply visibleFrame − frame origin as an inherited offset. AXElement accepts an optional frame override from the walker.

Update the failing HealthKit e2e flow to assert dismissal via "Turn On All" rather than ambiguous "Health Access" text.

Rebuild checked-in Simulator driver zips.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Leland-Takamine Leland-Takamine changed the title demo_app iOS HealthKit integration to launch modal bottom sheet and associated Maestro E2E test iOS: HealthKit repro + snapshot frame normalization for cross-process sheets May 1, 2026
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.

3 participants