Skip to content

fix(TMCU-1045): Remove useElevatedSurface shim from Core UX bottom sheets#33162

Draft
georgewrmarshall wants to merge 5 commits into
mainfrom
cursor/remove-useelevatedsurface-shim-f603
Draft

fix(TMCU-1045): Remove useElevatedSurface shim from Core UX bottom sheets#33162
georgewrmarshall wants to merge 5 commits into
mainfrom
cursor/remove-useelevatedsurface-shim-f603

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

Removes the redundant useElevatedSurface() shim from Core UX MMDS BottomSheet callsites now that MMDS handles pure-black elevated surfaces internally.

The custom TradeWalletActions sheet is not an MMDS BottomSheet and is out of scope for this cleanup — it retains its existing elevated-surface and pure-black border styling.

Changelog

CHANGELOG entry: null

Related issues

Fixes: TMCU-1045

Manual testing steps

N/A — styling cleanup with existing unit test coverage. No user-facing behavior change when MM_PURE_BLACK_PREVIEW is off.

Screenshots/Recordings

N/A — internal theming cleanup; visual QA for pure-black trade menu should be done on device with MM_PURE_BLACK_PREVIEW enabled.

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Testing

yarn jest app/components/Views/TradeWalletActions/TradeWalletActions.test.tsx \
  app/components/Views/AddressSelector/AddressSelector.test.tsx \
  app/components/Views/NetworksManagement/components/DeleteNetworkModal.test.tsx \
  app/components/UI/FundActionMenu/FundActionMenu.test.tsx \
  app/components/UI/CustomNetworkSelector/CustomNetworkSelector.test.tsx \
  app/components/UI/NetworkMultiSelectorList/NetworkMultiSelectorList.test.tsx

All 6 test suites pass (108 tests).

Related

Open in Web Open in Cursor 

…eets

MMDS BottomSheet now handles pure-black elevated surfaces internally.
Remove redundant useElevatedSurface() calls and related pure-black border
workarounds from Core UX bottom sheet callsites.

- AddressSelector, DeleteNetworkModal, FundActionMenu: drop twClassName shim
- CustomNetworkSelector, NetworkMultiSelectorList: drop elevated cell styling
- TradeWalletActions: remove usePureBlack border workaround and simplify BottomShape

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@mm-token-exchange-service mm-token-exchange-service Bot added team-design-system All issues relating to design system in Mobile INVALID-PR-TEMPLATE PR's body doesn't match template labels Jul 10, 2026
@mm-token-exchange-service

mm-token-exchange-service Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Pre-merge author checklist has unchecked items (e.g. "I've tested on Android"). Every box must be consciously checked — see docs/readme/ready-for-review.md.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Trade menu loses elevated surface
    • Restored elevated-surface theming by using useElevatedSurface for backgrounds and getElevatedSurfaceColor for the BottomShape fill to preserve elevation under pure-black preview.

Create PR

Or push these changes by commenting:

@cursor push 575cbd9658
Preview (575cbd9658)
diff --git a/app/components/Views/TradeWalletActions/TradeWalletActions.tsx b/app/components/Views/TradeWalletActions/TradeWalletActions.tsx
--- a/app/components/Views/TradeWalletActions/TradeWalletActions.tsx
+++ b/app/components/Views/TradeWalletActions/TradeWalletActions.tsx
@@ -62,6 +62,10 @@
 import { isHardwareAccount } from '../../../util/address';
 import { getDecimalChainId } from '../../../util/networks';
 import {
+  getElevatedSurfaceColor,
+  useElevatedSurface,
+} from '../../../util/theme/themeUtils';
+import {
   SwapBridgeNavigationLocation,
   useSwapBridgeNavigation,
 } from '../../UI/Bridge/hooks/useSwapBridgeNavigation';
@@ -115,6 +119,7 @@
   const tw = useTailwind();
   const theme = useTheme();
   const { colors } = theme;
+  const surfaceClass = useElevatedSurface();
 
   const backdropOpacity = useSharedValue(0);
   const backdropAnimatedStyle = useAnimatedStyle(() => ({
@@ -382,23 +387,23 @@
       <View style={tw.style('px-4')}>
         <View
           testID={WalletActionsBottomSheetSelectorsIDs.MENU_CONTAINER}
-          style={tw.style('bg-default p-4 rounded-t-2xl px-0')}
+          style={tw.style(surfaceClass, 'p-4 rounded-t-2xl px-0')}
         >
           {actionList}
         </View>
         <View
           style={tw.style('flex-row mt-[-1px]', { height: bottomMaskHeight })}
         >
-          <View style={tw.style('bg-default flex-1 rounded-bl-2xl')} />
+          <View style={tw.style(surfaceClass, 'flex-1 rounded-bl-2xl')} />
           <BottomShape
             width={buttonLayout.width * 4}
             height={bottomMaskHeight}
             peakHeight={16}
             peakBezierLength={25}
             baseBezierLength={55}
-            fill={colors.background.default}
+            fill={getElevatedSurfaceColor(theme)}
           />
-          <View style={tw.style('bg-default flex-1 rounded-br-2xl')} />
+          <View style={tw.style(surfaceClass, 'flex-1 rounded-br-2xl')} />
         </View>
       </View>
     </Animated.View>

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 3fb3c08. Configure here.

/>
</View>
) : null}
<View style={tw.style('bg-default flex-1 rounded-br-2xl')} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trade menu loses elevated surface

Low Severity

The custom trade actions sheet is not an MMDS BottomSheet, but it now paints the menu container, side masks, and BottomShape fill with bg-default and colors.background.default instead of the elevated-surface helpers. With MM_PURE_BLACK_PREVIEW on in dark mode, the panel no longer uses the elevated alternative background it had before, so it can blend into the pure-black wallet backdrop.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3fb3c08. Configure here.

- Run Prettier on AddressSelector and TradeWalletActions
- Keep useElevatedSurface on custom TradeWalletActions sheet (not MMDS
  BottomSheet) while still removing the pure-black border workaround

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@mm-token-exchange-service mm-token-exchange-service Bot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Jul 10, 2026
<Path d={pathData} fill={fill} />
</Svg>
);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent revert the changes to this file

@cursor cursor Bot Jul 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted BottomShape.tsx to its original version from main, restoring the strokeOnly and pathProps support that was removed in the earlier cleanup.

Pushed in commit a8b92b9ee1 on the PR branch.

Open in Web Open in Cursor 

).toBeNull();
});

it('should render earn button if the stablecoin lending feature is enabled', () => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert the changes to this file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent Revert the changes to this file

@cursor cursor Bot Jul 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted TradeWalletActions.test.tsx to its original version from main, restoring:

  • The usePureBlack mock
  • The two pure-black bottom cutout stroke tests

Pushed in commit b47313245b.

Note: Those two tests will fail until the related changes are also reverted in:

  • TradeWalletActions.tsx (pure-black border rendering / MENU_BOTTOM_STROKE)
  • WalletActionsBottomSheet.testIds.ts (MENU_BOTTOM_STROKE test ID)

BottomShape.tsx was already reverted. Say the word if you want those two files restored as well.

Open in Web Open in Cursor 

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
/>
</View>
) : null}
<View style={tw.style(surfaceClass, 'flex-1 rounded-br-2xl')} />

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent revert the changes to this file

@cursor cursor Bot Jul 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted TradeWalletActions.tsx to its original version from main, restoring:

  • usePureBlack() and conditional border-muted styling
  • The MENU_BOTTOM_STROKE bottom cutout stroke rendering
  • elevatedSurfaceColor via getElevatedSurfaceColor()

Also restored MENU_BOTTOM_STROKE in WalletActionsBottomSheet.testIds.ts so the reverted tests compile and pass.

All 22 TradeWalletActions tests pass. Pushed in commit 6a83c1606b.

Open in Web Open in Cursor 

cursoragent and others added 2 commits July 11, 2026 17:51
…dback

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Also restore MENU_BOTTOM_STROKE test ID required by the reverted tests.

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@github-actions github-actions Bot added size-S and removed size-M labels Jul 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeNetworkAbstractions, SmokeMoney, SmokeConfirmations, SmokeNetworkExpansion, SmokeMultiChainAPI
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 5 changed files follow the same pattern: removing the useElevatedSurface hook (a stopgap theming helper for pure black preview) and its associated surfaceClass from BottomSheet/component styling props. This is a UI styling change, not a functional logic change.

Affected components and their test coverage:

  1. CustomNetworkSelector.tsx - Removes surfaceClass from network list items. Used in network selection flows → SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeMultiChainAPI

  2. NetworkMultiSelectorList.tsx - Removes surfaceClass from network list items. Used in multi-network selection → SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeMultiChainAPI

  3. DeleteNetworkModal.tsx - Removes twClassName={surfaceClass} from the delete network confirmation BottomSheet → SmokeNetworkAbstractions

  4. FundActionMenu.tsx - Removes twClassName={surfaceClass} from the fund action bottom sheet (buy/sell/ramps entry) → SmokeMoney

  5. AddressSelector.tsx - Removes twClassName={surfaceClass} from the address selection BottomSheet used in send flows → SmokeConfirmations

Risk assessment: Low risk. The useElevatedSurface hook only returns a Tailwind CSS background class (bg-default or bg-alternative). Removing it means these components will use their default background styling. The functional behavior of all components remains unchanged. However, since these components are part of real user flows, running the relevant smoke tests ensures the components still render and function correctly after the styling change.

Dependent tags: Per tag descriptions, SmokeMultiChainAPI requires SmokeNetworkAbstractions and SmokeNetworkExpansion (already included).

Performance Test Selection:
These changes only remove a CSS background class (useElevatedSurface hook) from UI components. There is no impact on app performance metrics like launch time, asset loading, login, or swap execution. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-S team-design-system All issues relating to design system in Mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants