refactor(perps): migrate Cancel All Orders sheet to MMDS#33358
refactor(perps): migrate Cancel All Orders sheet to MMDS#33358brianacnguyen wants to merge 10 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>
⚡ 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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #33358 +/- ##
==========================================
+ Coverage 84.42% 84.48% +0.05%
==========================================
Files 6139 6158 +19
Lines 164072 164671 +599
Branches 40080 40253 +173
==========================================
+ Hits 138523 139120 +597
+ Misses 16054 16042 -12
- Partials 9495 9509 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Move cancel-all toast configs into usePerpsToasts and unify BottomSheet rendering to clear Sonar duplicated-lines findings. Co-authored-by: Cursor <cursoragent@cursor.com>
Raise new-code coverage for the quality gate by exercising cancel-all success, partial success, error, and overlay close flows. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Tag selection rationale:
No performance tags needed: changes are purely UI refactoring within the Perps feature with no impact on app launch, login, onboarding, asset loading, or other performance-sensitive flows. Performance Test Selection: |
|



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
Medium Risk
Changes real order-cancellation UI, dismissal paths (navigation vs overlay), and user-visible loading/toast behavior, though cancel logic remains in hooks and coverage is strong.
Overview
Migrates the Perps Cancel All Orders bottom sheet from component-library primitives to MetaMask Design System (
BottomSheet,BottomSheetHeader,BottomSheetFooter,Box,Text), drops the dedicatedStyleSheetfile, and alignsPerpsHomeView’s cancel-all ref with the MMDSBottomSheetRef.UX: While canceling, the sheet keeps the description and Confirm label visible and drives progress via the footer primary button’s
isLoading/ disabled state instead of replacing the body with a spinner and “canceling” copy. Empty and non-empty states share one sheet (no orders copy in the body; footer actions only when orders exist).Feedback: Cancel-all success, partial success, and failure toasts are centralized in
usePerpsToasts(cancelAllSuccess,cancelAllPartialSuccess,cancelAllFailed) instead of inline theme-based toast builders in the view. Overlay mode still closes the sheet on success when an externalsheetRefis provided.Tests are expanded for MMDS mocks, overlay vs standalone close/keep behavior, and toast callbacks.
Reviewed by Cursor Bugbot for commit db52e62. Bugbot is set up for automated code reviews on this repo. Configure here.