refactor(perps): migrate Cancel All Orders sheet to MMDS#33358
refactor(perps): migrate Cancel All Orders sheet to MMDS#33358brianacnguyen wants to merge 6 commits into
Conversation
Use design-system BottomSheet, Header, Footer, and Text so the sheet matches MMDS patterns and Confirm loading uses isLoading. Co-authored-by: Cursor <cursoragent@cursor.com>
|
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. |
Add pt-6 on BottomSheetFooter so content-to-button gap matches other Perps MMDS bottom sheets. Co-authored-by: Cursor <cursoragent@cursor.com>
🧪 Flaky unit test detection✅ All previously detected unit test flakiness issues in this PR have been fixed. This check is informational only and does not block merging. |
Co-authored-by: Cursor <cursoragent@cursor.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
The changes are a UI/design system migration with no logic changes to core perps functionality, making this medium risk. Performance Test Selection: |
|
⚡ Performance Test Results
✅ All tests passed · 2 tests · 1 device 📱 Devices tested (1)Android: Google Pixel 8 Pro (v14.0) ✅ Passed Tests (2)
Branch: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #33358 +/- ##
=======================================
Coverage 84.40% 84.41%
=======================================
Files 6132 6133 +1
Lines 163836 163803 -33
Branches 39995 39986 -9
=======================================
- Hits 138288 138268 -20
+ Misses 16053 16046 -7
+ Partials 9495 9489 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|


Description
Migrates the Perps Cancel All Orders bottom sheet from component-library BottomSheet primitives to MetaMask Design System (
@metamask/design-system-react-native) so it matches MMDS patterns used elsewhere in the app.What changed:
BottomSheet,BottomSheetHeader,BottomSheetFooter, andTextwith MMDS equivalents (Box, design-systemText, etc.)isLoadingwhile canceling instead of swapping the body for anActivityIndicator/ “canceling” copyPerpsCancelAllOrdersView.styles.tsin favor of MMDS layout utilitiesPerpsHomeViewto use the MMDSBottomSheetReftype for the cancel-all sheetChangelog
CHANGELOG entry: Updated the Perps cancel all orders sheet to use the design system and show loading on the Confirm button
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TAT-3562
Manual testing steps
Unit tests:
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
Low Risk
UI and bottom-sheet wiring only; cancel-all logic still goes through existing Perps hooks with no auth or payment changes.
Overview
Migrates the Perps Cancel All Orders bottom sheet from component-library primitives to
@metamask/design-system-react-native, droppingPerpsCancelAllOrdersView.styles.tsin favor of MMDSBoxand footer layout props.Cancel-in-progress UX no longer replaces the body with a spinner and “canceling” copy; the description stays visible and Confirm uses footer
isLoadingwhile both actions stay disabled. Sheet dismissal uses MMDSgoBackwhen standalone and keeps overlay behavior when an externalsheetRefis passed (header close getstestID: 'header-close').PerpsHomeViewtypes the cancel-all overlay ref as MMDSBottomSheetRef. Unit tests swap component-library mocks for design-system/tailwind mocks and assert the new loading and close/navigation behavior.Reviewed by Cursor Bugbot for commit ecbab46. Bugbot is set up for automated code reviews on this repo. Configure here.