feat(RevenueCatUI): arbitrate web_view drag gestures with the paywall scroll#3823
Conversation
ac5ad0d to
4f4b622
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4f4b622. Configure here.
5bf36f2 to
4d2f4ab
Compare
4d2f4ab to
e8ba929
Compare
e8ba929 to
0672256
Compare
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d3a11d4. Configure here.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ajpallares
left a comment
There was a problem hiding this comment.
Nice one! Two small comments, non-blocking at all
74832d1 to
d8b1a48
Compare
… scroll PaywallWebView decides, once per gesture, whether the web_view or the paywall scroll owns a drag, via requestDisallowInterceptTouchEvent (the only lever Compose honors). It claims only when the web_view should own the drag (Compose won't hand a gesture back, so no pre-claim/edge-chaining). The content verdict (supplied next) covers inner scrollers/maps; native canScrollVertically/Horizontally covers root scroll and is the sole signal on old WebViews.
…content Injects a web-standard document-start probe that, on each touchstart, reports whether the touched element consumes the drag: an inner overflow scroller, or an element declaring touch-action (a map) — the signals canScrollVertically can't see. Per-element, so a page-global listener can't make the whole view greedy. Reported over the same secure addWebMessageListener channel the bridge uses, and removed on release so a late verdict can't fire during teardown. No-ops on old WebViews.
…in, name JS node-type constant Fail closed instead of falling back to a wildcard origin when the bundle origin can't be resolved, matching shouldBlockWebViewNavigation's existing posture for that case. Also names the JS nodeType magic number. Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>
d8b1a48 to
ab663d1
Compare


Checklist
purchases-iosand hybridsMotivation
A
web_viewembedded in the paywall double-scrolls: dragging interactive or scrollable content (a map, an inner list) also scrolls the whole paywall.Description
PaywallWebViewdecides, once per drag, whether the web_view or the paywall scroll owns the gesture, viarequestDisallowInterceptTouchEvent(claim-once, since Compose won't hand a gesture back). The web_view claims only when its content consumes the drag:overflowscrollers andtouch-actionmaps — the signals native code can't see — over the existing secure message channel;canScrollVertically/Horizontallycovers root/page scroll;No-ops to native scrollability on old WebViews without the probe features. Verified on device (inner list, carousel, map) plus unit tests for the decision logic.
Note
Medium Risk
Touch handling and injected JS affect all paywall web_views; behavior degrades to native scroll-only on older WebViews, with edge cases where JS-only gesture blocking isn't detected.
Overview
Fixes double-scroll when dragging inside paywall
web_viewcontent (maps, inner lists, carousels) by deciding once per drag whether the WebView or the outer paywall scroll owns the gesture.Introduces
PaywallWebView, which callsrequestDisallowInterceptTouchEventonly whenshouldWebViewOwnGesturesays the WebView should own the drag (respecting touch slop and dominant axis). AWebViewGestureOwnershipProbeinjects document-start JS and usesWebMessageListenerto report per-touch whether inner scrollers or non-defaulttouch-actionneed the gesture; that verdict overrides native checks when it says "own," otherwise rootcanScrollVertically/Horizontallydecides.WebViewComponentViewswaps plainWebViewforPaywallWebView, wires install/teardown of the probe on release, anddisableTapHighlightno longer falls back to*when origin is unknown—it skips injection instead (tests updated). Unit tests cover arbitration rules and probe install behavior.Reviewed by Cursor Bugbot for commit ab663d1. Bugbot is set up for automated code reviews on this repo. Configure here.