fix(mobile): wait for transitions before screen swipes
- Screen swipes in tests now honor the transition budget after the preceding action, including native alert dismissal.
- Share
waitOutTransition(operation, budget)with control transitions. Unchanged-control shortcuts and agent settling remain. A budget too short for the transition fails unsent, including an early timer wake.
flowchart LR
A[Last action returns] --> B[Wait within transition and action budgets]
B --> C{Cancelled or budget too short?}
C -->|Yes| D[No input]
C -->|No| E[Send screen swipe]
Issue
Fixes #1562.
Verified
Ran it locally: yes.
Public controlled CLI reproduction: main 1bbda5a fails, this branch f52bdc7 passes. All 505 mobile tests and pnpm check pass. The agent-origin regression fails if its wait is made unconditional; integer/fractional early-wake, cancellation, and sufficient-budget cases pass.
Native pacing cost is measurable. Fixture source/build and timing suite, reports, and clips are public. These are median test-body seconds from the official bench:ab harness on the same UIKit 40-row list binary, iPhone 15 Pro / iOS 27.0 Simulator, agent-device 0.21.36. Each budget has three measured pairs and one excluded warmup, one worker, zero retries. Both builds pass both cases with matching reported behavior/counters.
| Transition | Native case | Main 1bbda5a | PR f52bdc7 | Action API time, main → PR |
|---|---|---|---|---|
| 500 ms | Four consecutive swipes | 4.48 s | 6.35 s | 2.21 → 4.11 s |
| 500 ms | scrollUntilVisible, row 25 | 5.44 s | 6.53 s | 3.63 → 4.60 s |
| 1500 ms | Four consecutive swipes | 4.44 s | 10.32 s | 2.21 → 8.11 s |
| 1500 ms | scrollUntilVisible, row 25 | 5.69 s | 10.46 s | 3.70 → 8.56 s |
API time sums the four screen.swipe steps or the one scrollUntilVisible step. Test bodies also include app launch and assertions. Identical temporary fixture files were untracked in both prepared checkouts; production files matched the listed commits.
Waiting between consecutive test swipes is intentional: a swipe can itself start a scroll or pager animation, and a screen-root gesture has no target binding whose unchanged position proves readiness. Captures and assertions consume the budget before the next swipe. The configured budget is a heuristic, not proof that a native animation has completed.
These fixture runs measure pacing cost, not a failure-rate improvement or the entire Expo benchmark suite. One measured pair per budget is linked below. GitHub disallows uploading attachments to this upstream repository with this account's read access, so the clips are published on the public evidence branch.
| Transition | Main clip | PR clip |
|---|---|---|
| 500 ms | ||
| 1500 ms |