refactor(perps): migrate perps modal routes to native stack#30486
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: This affects:
The risk is medium because while this is a refactoring (equivalent functionality), switching from JS stack to native stack navigator can have subtle behavioral differences in modal presentation, transparency, and animation on both iOS and Android. The Perps flows that use these modal screens need validation. Tag selection rationale:
Performance Test Selection: |
|



Description
Migrates the Perps modal navigators (
PerpsModalStackandPerpsClosePositionBottomSheetStack) from@react-navigation/stack(JS stack) to@react-navigation/native-stack, matching the existing nativePerpsScreenStack.Why: The Perps screen stack is already native — the nested modal stacks were the last JS-stack holdouts inside
app/components/UI/Perps/routes/index.tsx. Native stack uses platform navigators, which gives better performance, gesture handling, and a single consistent navigator API across the Perps surface. This also removes a few JS-stack-only workarounds (the zero-opacitycardStyleInterpolatortrick on the tooltip stack, redundant per-screencardStyletransparency).What:
ModalStack = createStackNavigator()→createNativeStackNavigator()clearStackNavigatorOptions+presentation: 'transparentModal'forclearNativeStackNavigatorOptions+transparentModalScreenOptionsPerpsClosePositionBottomSheetStackdrops itspresentation: 'modal'+cardStyleInterpolatoroverlay-clear hack in favor of the same native presets (semantically equivalent: transparent, non-dimming overlay)cardStyle: { backgroundColor: 'transparent' }(navigator-levelcontentStylenow covers it)@react-navigation/stackimport from this fileMainNavigator's outer registration ofRoutes.PERPS.MODALS.ROOTis unchanged — the parent stack there is still JS-stack and continues to mountPerpsModalStackWithErrorGateviatransparentModal.Changelog
CHANGELOG entry:null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
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
Moderate risk because it changes navigation stack implementation and screen options for Perps modals, which could affect modal presentation/gestures and overlay behavior across key trading flows.
Overview
Migrates the Perps modal navigators in
app/components/UI/Perps/routes/index.tsxfrom the JS stack (@react-navigation/stack) tocreateNativeStackNavigator, aligning them with the existing native Perps screen stack.Updates modal/tooltip navigator
screenOptionsto useclearNativeStackNavigatorOptions+transparentModalScreenOptions, and removes JS-stack-only transparency/overlay workarounds (per-screen transparentcardStyleand the tooltip stack’s zero-opacity overlay interpolator).Reviewed by Cursor Bugbot for commit 2e6c012. Bugbot is set up for automated code reviews on this repo. Configure here.