fix(perps): route deposit flow to redesigned confirmations with perps header cp-7.69.0#27106
Conversation
|
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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #27106 +/- ##
===========================================
- Coverage 81.51% 51.28% -30.24%
===========================================
Files 4627 4626 -1
Lines 121093 121269 +176
Branches 26453 26645 +192
===========================================
- Hits 98706 62187 -36519
- Misses 15480 53773 +38293
+ Partials 6907 5309 -1598 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| { | ||
| showPerpsHeader: true, | ||
| }, | ||
| ); |
There was a problem hiding this comment.
Hardcoded showPerpsHeader bypasses shared config constant
Low Severity
The showPerpsHeader value is hardcoded to true, but every other perps navigation path (PerpsOrderRedirect.tsx, usePerpsNavigation.ts) uses CONFIRMATION_HEADER_CONFIG.ShowPerpsHeaderForDepositAndTrade from the shared perpsConfig constants. Hardcoding the value here means this code path won't respect future changes to that configuration constant, creating an inconsistency across perps deposit/order flows.
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.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Per the tag rules:
No other areas (accounts, identity, network abstractions, snaps, ramps, card, swaps, predictions, multi-chain API) are affected by this hook change. Risk is medium because although the change is scoped to a UI hook, it affects financial balance filtering logic in a trading feature, which could indirectly impact user flows (e.g., incorrect token availability for deposits). Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|





Description
The perps deposit flow was using
navigateToConfirmation({ stack: Routes.PERPS.ROOT }), which did not correctly route users to the redesigned confirmations screen after initiating a deposit. Users could end up on the wrong confirmation stack or without the perps-specific header.This change updates the flow so that when the user taps the Perps balance token to deposit:
handleReject()fromuseApprovalRequest.depositWithConfirmation()runs to start the deposit flow.REDESIGNED_CONFIRMATIONSwithshowPerpsHeader: trueinstead of the previous PERPS.ROOT stack.Dependencies on
useConfirmNavigationare removed in favor ofuseNavigationanduseApprovalRequestso the deposit action and post-deposit navigation are explicit and aligned with the redesigned confirmations screen.Changelog
CHANGELOG entry: Fixed perps deposit flow so it routes to the redesigned confirmations screen with the perps header after a successful deposit.
Related issues
Fixes: https://consensys.slack.com/archives/C092T3GPHQD/p1772719051867319
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes the perps deposit tap-handler to dismiss the current approval and navigate to a different confirmation route, so regressions could strand users on the wrong screen or break the deposit flow sequencing.
Overview
Fixes the Perps “Add funds” action from the synthetic “Perps balance” token so it no longer uses
useConfirmNavigation/Routes.PERPS.ROOT.The handler now calls
useApprovalRequest().onReject()to dismiss the current approval, runsdepositWithConfirmation(), and then navigates via React Navigation toRoutes.FULL_SCREEN_CONFIRMATIONS.REDESIGNED_CONFIRMATIONSwithshowPerpsHeader: true. Tests were updated to mock the new hooks (useNavigation,useApprovalRequest) and assert the new call order/route usingwaitFor.Written by Cursor Bugbot for commit 48571b0. This will update automatically on new commits. Configure here.