feat: add gesture command coverage#576
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 053d003033
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let target = interactionRoot(app: app) | ||
| switch direction { | ||
| case "up": | ||
| target.swipeUp() | ||
| case "down": |
There was a problem hiding this comment.
Execute fling using requested coordinates on iOS
This implementation ignores the command’s x/y/x2/y2 inputs and performs a generic swipe*() on the interaction root, so fling <direction> <x> <y> [distance] does not actually start from the requested point on iOS. In screens with multiple gesture regions (for example a carousel inside a scroll view), the fling can target the wrong container or trigger unrelated navigation even though the caller supplied explicit coordinates.
Useful? React with 👍 / 👎.
| private func performCoordinateRotateGesture(app: XCUIApplication, degrees: Double, x: Double?, y: Double?, velocity: Double) -> RunnerInteractionOutcome { | ||
| #if os(iOS) | ||
| let target = app.windows.firstMatch.exists ? app.windows.firstMatch : app | ||
| let radians = CGFloat(degrees * .pi / 180.0) | ||
| target.rotate(radians, withVelocity: CGFloat(velocity)) |
There was a problem hiding this comment.
Apply rotate-gesture center coordinates in runner
The rotate-gesture command validates and forwards optional center coordinates, but this code never uses x/y and always rotates the top window element. As a result, callers cannot control the gesture center, so rotations intended for off-center targets can affect the wrong UI region while still reporting success.
Useful? React with 👍 / 👎.
| fling: { | ||
| apple: { simulator: true, device: true }, | ||
| android: { emulator: true, device: true, unknown: true }, | ||
| linux: LINUX_NONE, |
There was a problem hiding this comment.
Restrict macOS fling capability to supported platforms
The capability matrix marks fling as supported for all Apple device kinds, which includes macOS sessions, but the runner implementation explicitly returns unsupported on macOS. This causes command admission to report support and then fail later at execution time, producing avoidable runtime errors and inconsistent platform capability behavior.
Useful? React with 👍 / 👎.
053d003 to
5ed3c06
Compare
5ed3c06 to
2d8d8dc
Compare
b62ccef to
222f753
Compare
222f753 to
9b592f6
Compare
Summary
Adds end-to-end gesture support and a React Native Gesture Handler test bed for pan, pinch, rotate, and fling gestures.
Details:
gesture <pan|fling|pinch|rotate>.pan,fling, androtate-gesturecommands; existingpinchcompatibility remains internal and undocumented.gesturecommand group.Validation
Verified earlier on iPhone 17 with Expo Go on Metro port 8082. The recorded proof sequence completed pinch in/out, pan left/right/up/down, rotate 145 degrees, rotate -215 degrees, and fling left/right/up/down. Final app metrics after the recorded run:
x 72, y 56, scale 0.60, rotate -69,fling 10.Current checks:
pnpm formatpnpm check:quickpnpm check:fallow --base origin/mainpnpm test:integration:progress:checkpnpm test:smoke(4 passed, 2 loopback-listener skips in this environment)pnpm exec vitest run src/core/__tests__/dispatch-interactions.test.ts src/core/__tests__/dispatch-pinch.test.ts src/utils/__tests__/args.test.ts test/integration/provider-scenarios/ios-lifecycle.test.ts test/integration/provider-scenarios/android-lifecycle.test.tspnpm exec vitest run src/utils/__tests__/args.test.ts src/replay/__tests__/script.test.ts src/core/__tests__/capabilities.test.ts src/core/__tests__/dispatch-interactions.test.ts test/integration/provider-scenarios/ios-lifecycle.test.ts test/integration/provider-scenarios/android-lifecycle.test.tspnpm check:unitwas also rerun. In sandbox it hit environment restrictions (listen EPERM, Swift/tooling failures). Escalated, it reduced to one unrelated failure insrc/utils/__tests__/video.test.tswhere the MP4 fallback assertion returned false.Proof video:
/private/tmp/agent-device-full-gesture-video/full-gesture-sequence.mp4Touched 40 files; scope stayed within gesture command support, runner execution, test-app coverage, and command/docs guidance.