Skip to content

feat: Fix for Pull to Refresh IAB gesture bug#26373

Merged
weitingsun merged 2 commits into
mainfrom
bug/polymarket-login
Feb 20, 2026
Merged

feat: Fix for Pull to Refresh IAB gesture bug#26373
weitingsun merged 2 commits into
mainfrom
bug/polymarket-login

Conversation

@MarioAslau

@MarioAslau MarioAslau commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

Description

Pull-to-refresh gesture was intercepting taps on buttons near the top of the page (e.g., Polymarket "Sign Up" / "Log In" buttons). The gesture handler called stateManager.activate() immediately in onTouchesDown for the pull zone (y < 50px), stealing the touch from the WebView before knowing whether the user intended to tap or pull.

Changes

Deferred activation for pull-to-refresh: Instead of activating immediately, the gesture enters a pending_refresh state in onTouchesDown. New onTouchesMove and onTouchesUp handlers measure the movement delta:

  • Downward movement >10px → activate pull-to-refresh
  • Horizontal/upward movement >10px → fail and let WebView handle
  • Finger lifts with <10px movement (tap) → fail and let WebView handle

Gesture.Simultaneous instead of Gesture.Race: Deferred activation requires that the Native gesture (WebView scroll) does not cancel our Pan while it is deciding. Gesture.Simultaneous allows both to run independently — taps pass through to the WebView while our Pan stays in BEGAN state deciding, and when Pan activates for a real pull at the top of the page, the WebView has nothing to scroll so both coexist without visual conflict.

Why not other approaches

  • Gesture.Race + deferred activation: Native wins the race and cancels Pan before onTouchesMove fires
  • Gesture.Race + immediate activation + synthetic JS click replay: Pull-to-refresh works but synthetic events have isTrusted = false — React ignores them
  • Gesture.Exclusive + deferred activation: Blocks Native while Pan is in BEGAN — nothing works

Changelog

CHANGELOG entry: Fixed pull-to-refresh gesture intercepting taps on buttons near the top of the page in the in-app browser

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-352

Manual testing steps

Feature: Browser gesture tap passthrough

  Scenario: User taps a button near the top of a webpage
    Given the user is on polymarket.com in the in-app browser
    And the page is scrolled to the top (not scrolled at all)

    When user taps the "Log In" or "Sign Up" button
    Then the login/signup modal should appear

  Scenario: User pulls to refresh from the top of the page
    Given the user is on any webpage in the in-app browser
    And the page is scrolled to the top

    When user places finger near the top of the page and drags downward
    Then the refresh indicator should appear
    And the page should reload when pulled past the threshold

  Scenario: User swipes back from the left edge
    Given the user has navigated to at least one page in the in-app browser

    When user swipes from the left edge of the screen toward the right
    Then the browser should navigate back to the previous page

  Scenario: User swipes forward from the right edge
    Given the user has navigated back at least once in the in-app browser

    When user swipes from the right edge of the screen toward the left
    Then the browser should navigate forward

  Scenario: User scrolls normally in the center of the page
    Given the user is on any webpage in the in-app browser

    When user scrolls up or down in the center of the page
    Then the page should scroll normally without triggering any gestures

Screenshots/Recordings

Before

After

polymarketBugFix.mov

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Touches core in-app browser gesture coordination; a subtle change from Race to Simultaneous plus new activation heuristics could cause regressions in gesture priority/scroll behavior across platforms.

Overview
Fixes pull-to-refresh stealing taps near the top of the in-app browser by deferring pull activation: onTouchesDown now enters a pending_refresh state and only activates refresh after sufficient downward movement, otherwise failing on tap/horizontal/upward movement.

Updates gesture composition from Gesture.Race to Gesture.Simultaneous so the WebView’s native handler can still receive taps while the pan gesture decides, and introduces PULL_MOVE_ACTIVATION (10px) plus expanded unit tests covering the new onTouchesMove/onTouchesUp flow and edge cases.

Written by Cursor Bugbot for commit 59a6058. This will update automatically on new commits. Configure here.

@MarioAslau MarioAslau added Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing team-mobile-platform Mobile Platform team labels Feb 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@MarioAslau MarioAslau added type-bug Something isn't working release bug Issues that arise during regression testing that block release labels Feb 20, 2026
@MarioAslau MarioAslau marked this pull request as ready for review February 20, 2026 19:03
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmations, FlaskBuildTests, SmokeMultiChainAPI, SmokeNetworkExpansion, SmokeNetworkAbstractions, SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 80%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes modify the GestureWebViewWrapper component which handles gesture interactions (pull-to-refresh, swipe navigation) in the BrowserTab. Key changes include:

  1. Switching from Gesture.Race to Gesture.Simultaneous for gesture coordination
  2. Adding deferred activation for pull-to-refresh (pending_refresh state)
  3. New PULL_MOVE_ACTIVATION constant (10px threshold)
  4. New onTouchesMove and onTouchesUp handlers

The BrowserTab is a critical component used by many E2E tests that interact with dApps. While the changes are well-covered by unit tests, they fundamentally change how gestures are handled in the browser view. Tests that navigate to dApps and interact with them could be affected:

  • SmokeConfirmations: Uses browser for signature tests, dApp-initiated transactions
  • FlaskBuildTests: Uses browser for Snaps installation and interaction
  • SmokeMultiChainAPI: Uses browser for wallet_createSession and multichain dApp tests
  • SmokeNetworkExpansion: Uses browser for Solana wallet standard tests
  • SmokeNetworkAbstractions: Uses browser for network/chain permission tests
  • SmokeWalletPlatform: Uses browser for Trending/discovery tab

The risk is medium because while the changes are localized to gesture handling and have comprehensive unit tests, they affect a fundamental interaction pattern in the browser that many tests rely on.

Performance Test Selection:
The changes are to gesture handling logic in the BrowserTab component. While they modify how gestures are processed (switching from Race to Simultaneous, adding deferred activation), these changes are about gesture coordination and touch handling, not rendering performance or data loading. The changes don't affect UI rendering performance, list rendering, state management, or app startup. No performance tests are needed.

View GitHub Actions results

@MarioAslau MarioAslau changed the title bug: Fix for pull to refresh gesture bug feat: Fix for Pull to Refresh IAB gesture bug Feb 20, 2026
@sonarqubecloud

Copy link
Copy Markdown

@weitingsun weitingsun added this pull request to the merge queue Feb 20, 2026

@Cal-L Cal-L 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.

LGTM

Merged via the queue into main with commit 9b336fc Feb 20, 2026
121 of 124 checks passed
@weitingsun weitingsun deleted the bug/polymarket-login branch February 20, 2026 20:39
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 20, 2026
@metamaskbot metamaskbot added release-7.68.0 Issue or pull request that will be included in release 7.68.0 release-7.66.0 Issue or pull request that will be included in release 7.66.0 and removed release-7.68.0 Issue or pull request that will be included in release 7.68.0 labels Feb 20, 2026
@metamaskbot

Copy link
Copy Markdown
Collaborator

Missing release label release-7.66.0 on PR. Adding release label release-7.66.0 on PR and removing other release labels(release-7.68.0), as PR was cherry-picked in branch 7.66.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release bug Issues that arise during regression testing that block release release-7.66.0 Issue or pull request that will be included in release 7.66.0 Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing size-M team-mobile-platform Mobile Platform team type-bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants