Skip to content

fix(ios): deliver simulator edge swipes as screen-edge touches - #4211

Open
gronxb wants to merge 4 commits into
callstack:mainfrom
gronxb:fix/ios-simulator-edge-swipe
Open

gronxb wants to merge 4 commits into
callstack:mainfrom
gronxb:fix/ios-simulator-edge-swipe

Conversation

@gronxb

@gronxb gronxb commented Nov 4, 2026 •

Copy link
Copy Markdown

Summary

On iOS simulators, gesture swipe left-edge/right-edge never started edge recognizers or the navigation edge pop: XCTest touches carry no edge information, even at x = 0.

Edge presets now plan a screen-edge contact (contactOrigin). On an iOS simulator, the runner sends that plan as one HID touch the way a hand swipe arrives: SwipeLocked plus the native swipe direction on every frame, through the oldest touchscreen service of the app's display (the lit panel on a foldable). The contact eases in along the planned path, because a first move that leaves the edge region in one frame fails the recognizer on a wide panel. A frame whose HID event cannot be created fails the command, and an unreadable touchscreen service is skipped. Other gestures and physical devices keep their paths. The edge path does not keep endpoint-hold.

15 files. Fixes #4208.

Validation

Tested at c57133a40, base 035c2b6ca.

  • pnpm check:affected --run --head c57133a40: passed, exactCommit=true. Coverage, swift-runner-ios/macos, replay and web lanes are GitHub-authoritative.
  • New Swift tests and the request-field tests pass on an iOS 26.4 simulator (AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1).
  • Repro ./repro.sh:
Simulator Base Head
iPhone 16, iOS 26.4 0/3 3/3
iOS 27.2 (base on iPhone 17, head on iPhone 18 Pro) 0/3 3/3
iPhone Duo, iOS 27.1, open 0/3 3/3, twice
iPhone Duo, iOS 27.1, closed — 3/3, twice
  • In-page gesture swipe right and gesture pan still arrive as plain touches.

Open risk: physical devices are unchanged and untested.

XCTest synthesized touches carry no digitizer edge mask, so on an iOS
simulator gesture swipe left-edge and right-edge never started a
UIScreenEdgePanGestureRecognizer or the navigation edge pop gesture.

Edge swipe presets now plan a screen-edge contact. On an iOS simulator
the runner dispatches it as one HID touch with the edge mask, through
the touchscreen service of the app's display. Other gestures and
physical devices keep their current paths.

Fixes callstack#4208
@vercel

vercel Bot commented Nov 4, 2026

Copy link
Copy Markdown

@gronxb is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

A frame that failed to build was dropped while the gesture still
reported success. Fail before touch-down, lift early after a failed
move, and return the reason instead.
The edge recognizer on a rotated panel, such as the iPhone Duo inner
panel, never began: FromEdgeFlat/Tip touches carry no swipe direction,
and a fast first move left the edge region in one frame. A hand swipe
on the simulator carries SwipeLocked and the native swipe direction on
every frame and starts slowly.

Send the same mask, ease the contact in along the planned path, and use
the display's oldest touchscreen service when a window adds another.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

A service whose registry ID could not be read still counted as a match,
so a later valid service could leave the sender at 0.

This branch has not been deployed

No deployments
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.

iOS simulator edge swipes never start UIScreenEdgePanGestureRecognizer

1 participant