Skip to content

fix: disable native stack animation for PayWithModal in Perps routes#30353

Merged
OGPoyraz merged 6 commits into
mainfrom
fix/pay-with-modal-animation
May 25, 2026
Merged

fix: disable native stack animation for PayWithModal in Perps routes#30353
OGPoyraz merged 6 commits into
mainfrom
fix/pay-with-modal-animation

Conversation

@OGPoyraz

@OGPoyraz OGPoyraz commented May 19, 2026

Copy link
Copy Markdown
Member

Description

The PayWithModal screen in the Perps native stack only had transparentModalScreenOptions (presentation: 'transparentModal') without clearNativeStackNavigatorOptions (animation: 'none'). This caused a double slide-up animation: the native stack animated the transparent screen from bottom to top, then the BottomSheet component inside it played its own slide-up animation.

Root Cause

transparentModalScreenOptions sets presentation: 'transparentModal' but does not set animation: 'none'. The default native modal animation kicks in, creating a visible slide of the transparent overlay before the BottomSheet animates.

Fix

Added ...clearNativeStackNavigatorOptions before ...transparentModalScreenOptions on the PayWithModal screen in the Perps native stack. This makes the screen appear instantly so only the BottomSheet's own animation plays.

The App.tsx JS stack registration was already correct — its parent navigator sets animationEnabled: false globally.

Before:

broken.background.mov

After:

fixed.background.mov

Changes

  • app/components/UI/Perps/routes/index.tsx — Added clearNativeStackNavigatorOptions to PayWithModal screen options

Note

Low Risk
Single navigation option change for one Perps screen; no auth, data, or business-logic impact.

Overview
Fixes a double slide-up when opening the pay-with token selector from the Perps native stack: the stack was animating the transparent modal while the inner BottomSheet also animated.

The CONFIRMATION_PAY_WITH_MODAL screen now spreads clearNativeStackNavigatorOptions (including animation: 'none') before transparentModalScreenOptions, matching the sibling CONFIRMATION_PAY_WITH_BOTTOM_SHEET screen and other Perps modal routes so only the bottom sheet animates.

Reviewed by Cursor Bugbot for commit 70eef9a. Bugbot is set up for automated code reviews on this repo. Configure here.

The PayWithModal screen in the Perps native stack only had
`transparentModalScreenOptions` (presentation: 'transparentModal')
without `clearNativeStackNavigatorOptions` (animation: 'none').
This caused a double slide-up: the native stack animated the
transparent screen from bottom, then the BottomSheet inside it
played its own slide-up animation.

Adding `clearNativeStackNavigatorOptions` makes the screen appear
instantly so only the BottomSheet's animation plays.
@OGPoyraz OGPoyraz requested a review from a team as a code owner May 19, 2026 08:03
@metamaskbotv2 metamaskbotv2 Bot added the team-confirmations Push issues to confirmations team label May 19, 2026
@OGPoyraz OGPoyraz enabled auto-merge May 19, 2026 08:17

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 fa4a826. Configure here.

component={PayWithModal}
options={{
headerShown: false,
...clearNativeStackNavigatorOptions,

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.

Redundant headerShown set before spread overwrites it

Low Severity

The explicit headerShown: false on the PayWithModal screen options is immediately overwritten by ...clearNativeStackNavigatorOptions, which also sets headerShown: false. The other modal screens in this file (e.g., CLOSE_POSITION_MODALS, MODALS.ROOT) omit the redundant explicit property. This isn't a behavioral bug, but it's inconsistent with the sibling pattern and adds minor confusion about whether an intentional override is happening.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fa4a826. Configure here.

@OGPoyraz OGPoyraz added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label May 25, 2026
@metamaskbotv2 metamaskbotv2 Bot added the INVALID-PR-TEMPLATE PR's body doesn't match template label May 25, 2026
@OGPoyraz OGPoyraz added this pull request to the merge queue May 25, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The change is a single-line addition of ...clearNativeStackNavigatorOptions to the PayWithModal screen options in the Perps navigation stack (app/components/UI/Perps/routes/index.tsx). This adds { headerShown: false, contentStyle: { backgroundColor: 'transparent' }, animation: 'none' } before ...transparentModalScreenOptions for the PayWithModal screen. The headerShown: false was already explicitly set, so the net new additions are animation: 'none' and contentStyle: { backgroundColor: 'transparent' }. This is a UI/navigation fix to ensure the PayWithModal in the Perps stack behaves consistently with other modal screens (e.g., PayWithBottomSheet already had clearNativeStackNavigatorOptions). The change is scoped to the Perps flow's PayWithModal presentation. Per tag descriptions: SmokePerps covers the Add Funds flow; SmokeWalletPlatform is always required alongside SmokePerps (Trending section); SmokeConfirmations is required because Add Funds deposits are on-chain transactions and PayWithModal is part of the confirmation/payment flow.

Performance Test Selection:
This is a minor navigation option change (adding animation: 'none' and transparent background to PayWithModal in Perps stack). While it technically affects animation behavior, it's a targeted fix to disable animation (which would improve rather than degrade performance), and does not warrant dedicated performance test runs.

View GitHub Actions results

@OGPoyraz OGPoyraz enabled auto-merge May 25, 2026 10:02
@sonarqubecloud

Copy link
Copy Markdown

@OGPoyraz OGPoyraz added this pull request to the merge queue May 25, 2026
Merged via the queue into main with commit 8df0757 May 25, 2026
198 of 200 checks passed
@OGPoyraz OGPoyraz deleted the fix/pay-with-modal-animation branch May 25, 2026 11:40
@github-actions github-actions Bot locked and limited conversation to collaborators May 25, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.80.0 Issue or pull request that will be included in release 7.80.0 label May 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.80.0 Issue or pull request that will be included in release 7.80.0 size-XS team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants