feat: implement Pay With Perps section#30124
Conversation
…nfig and adjust renderTrailing function
…sk/metamask-mobile into vs/pay-with-bottom-sheet-skeleton
…ed on transaction metadata
…ability in transaction selection
|
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. |
ff8e22d to
58870a6
Compare
…th Pay With bottom sheet enabled
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The changes are feature-flag gated ( Performance Test Selection: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 8663914. Configure here.
| isFullscreen | ||
| ref={bottomSheetRef} | ||
| keyboardAvoidingViewEnabled={false} | ||
| shouldNavigateBack={dismissOnSelectCount <= 1} |
There was a problem hiding this comment.
X button fails to dismiss modal when dismissOnSelectCount exceeds one
Medium Severity
When dismissOnSelectCount is greater than 1 (i.e. when opened from "Other assets" in the new PayWithBottomSheet), shouldNavigateBack is false, which prevents the BottomSheet from calling goBack() on any dismiss action. Token selection works because the onClosed callback dispatches StackActions.pop(N). However, the X-button close handler calls close() without a callback, so after the close animation completes, no navigation occurs — the PayWithModal screen stays in the navigation stack invisibly, causing stack pollution and potential navigation issues on subsequent interactions.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 8663914. Configure here.
|
The committed fixture schema is out of date. To update, comment: |





Description
Adds the Perps section to the redesigned Pay with bottom sheet. On
perpsDepositAndOrderconfirmations, a Perps account row now renders above the Crypto section with an inline Add button that routes to the standalone Perps deposit confirmation. Visibility mirrors the existing legacy-modal rule (perpsDepositAndOrderonly —perpsDepositis filtered out to avoid a recursive "deposit to deposit" loop).The Perps row is an Add CTA, not a selection row. Payment-source state for perps flows lives in a dual-state machinery (
PerpsController.selectedPaymentTokenfor the UX choice +TransactionPayController.payTokenfor the real on-chain funding source) that the legacy modal already orchestrates — there is no on-row "selected token" to display.All changes are dark-launched behind
MM_DEV_PAY_WITH_BOTTOM_SHEETand have no effect in production.Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1362
Manual testing steps
Screenshots/Recordings
WhatsApp.Video.2026-05-15.at.16.56.55.mp4
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes payment-selection and navigation dismissal behavior across the redesigned Pay With UX, including Perps-specific routing and multi-pop handling; issues here could strand users on the wrong screen or select the wrong funding source.
Overview
Adds a new Perps section to the redesigned
PayWithBottomSheetforperpsDepositAndOrder, showing aPerps accountrow with an inlineAddCTA that kicks off the Perps deposit confirmation flow.Updates perps payment selection to support the new sheet:
PerpsPayRowroutes to the bottom sheet when enabled;usePerpsBalanceTokenFilterstops injecting the legacy synthetic Perps-balance row under the new sheet; andusePayWithCryptoSectionavoids showing misleading crypto checkmarks/rows when Perps balance (or fiat) implicitly owns the selection, while routing selection taps throughusePerpsPaymentTokenfor perps flows.Hardens modal/sheet navigation:
PayWithModaladdsdismissOnSelectCountto atomicallypop(N)when launched from the bottom sheet’s “Other assets”, anduseDismissOnPaymentChangenow guards onnavigation.isFocused()to avoid overlapping-route dismissal races. Also wiresPayWithBottomSheetinto the Perps navigator and adds new i18n strings for the Perps section.Reviewed by Cursor Bugbot for commit 8663914. Bugbot is set up for automated code reviews on this repo. Configure here.