Skip to content

chore(pure-black): use background.section for bottom sheets that disappear against pure black#30411

Merged
vinnyhoward merged 11 commits into
mainfrom
chore-635-action-bottom-sheet
May 21, 2026
Merged

chore(pure-black): use background.section for bottom sheets that disappear against pure black#30411
vinnyhoward merged 11 commits into
mainfrom
chore-635-action-bottom-sheet

Conversation

@vinnyhoward

@vinnyhoward vinnyhoward commented May 19, 2026

Copy link
Copy Markdown
Contributor

Description

Part of an ongoing initiative to audit all app flows against pure black dark mode. Pure black is currently behind the MM_PURE_BLACK_PREVIEW feature flag (off by default) and is not yet user-facing — this work is being done ahead of the design-tokens package bump that will make pure black the default dark theme.

When the flag is enabled, background.default and background.alternative are both overridden to #000000, causing bottom sheet and action sheet surfaces to become invisible against the pure black screen background. This PR fixes the affected surfaces by replacing those tokens with background.section (#1c1d1f), which is intentionally not overridden by the flag and provides the correct elevated surface appearance per the Figma spec.

Components updated:

  • TradeWalletActions — action sheet container + list items
  • MoneyAddMoneySheet — bottom sheet background
  • NetworkManager — tab bar + sheet container
  • NetworkMultiSelector — list body + select-all cell
  • NetworkListBottomSheet — sheet background
  • FundActionMenu — sheet background
  • ListItemMultiSelectButton — unselected row background

Changelog

CHANGELOG entry:null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-635

Manual testing steps

Feature: Pure black dark mode surfaces

  Scenario: user opens action/bottom sheets with pure black flag enabled
    Given the app is in dark mode with MM_PURE_BLACK_PREVIEW=true
    When user opens Trade, Buy/Sell, Network, or Add Token sheets
    Then each sheet has a visible elevated dark surface (#1c1d1f) instead of blending into the black background

Screenshots/Recordings

Buy/Sell

Dark

Before After
Before After

Light (Unaffected)

Before After
Before After

Network Picker from Import Token

Dark

Before After
Before After

Light (Unaffected)

Before After
Before After

Web

Dark

Before After
Before After

Light (Unaffected)

Before After
Before After

Network Manager

Dark

Before After
Before After

Light (Unaffected)

Before After
Before After

Money

Dark

Before After
Before After

Light (Unaffected)

Before After
Before After

Main Trade Action

Dark

Before After
Before After

Light (Unaffected)

Before After
Before After

Before

~

After

~

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

For performance guidelines and tooling, see the Performance Guide.

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.

Note

Low Risk
Primarily visual/theming changes gated behind MM_PURE_BLACK_PREVIEW; risk is limited to UI regressions in sheet backgrounds and pressed states across several screens.

Overview
Introduces themeUtils helpers (getElevatedSurfaceColor, useElevatedSurface) to switch elevated surfaces to background.section in dark mode when MM_PURE_BLACK_PREVIEW is enabled.

Updates multiple bottom sheets/action sheets and list items to use these helpers (via twClassName/Tailwind classes or theme-derived colors), preventing sheet surfaces from blending into pure black backgrounds; also adjusts Tabs to avoid using background.alternative when pure black is enabled in dark mode.

Reviewed by Cursor Bugbot for commit ceb577c. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

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.

@metamaskbotv2 metamaskbotv2 Bot added the team-mobile-ux Mobile UX team label May 19, 2026
Comment thread app/component-library/components-temp/ActionListItem/ActionListItem.tsx Outdated
@vinnyhoward vinnyhoward marked this pull request as ready for review May 19, 2026 22:44
@vinnyhoward vinnyhoward requested review from a team as code owners May 19, 2026 22:44
Comment thread app/components/Views/TradeWalletActions/TradeWalletActions.tsx Outdated
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.02%. Comparing base (3ee5c69) to head (2cbd3a6).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...etworkMultiSelector/NetworkMultiSelector.styles.ts 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #30411      +/-   ##
==========================================
- Coverage   82.03%   82.02%   -0.01%     
==========================================
  Files        5454     5456       +2     
  Lines      145830   145859      +29     
  Branches    33411    33425      +14     
==========================================
+ Hits       119629   119647      +18     
- Misses      18016    18018       +2     
- Partials     8185     8194       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vinnyhoward vinnyhoward marked this pull request as draft May 20, 2026 16:22
Introduces useElevatedSurface() hook and getElevatedSurfaceColor() helper
to correctly resolve background colors for bottom sheets and action list
surfaces. Fixes invisibility caused by background.default being overridden
to #000000 when the pure black dark mode flag is enabled.
@vinnyhoward vinnyhoward added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label May 21, 2026
@vinnyhoward vinnyhoward marked this pull request as ready for review May 21, 2026 17:22

@georgewrmarshall georgewrmarshall 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.

LGTM!

@vinnyhoward vinnyhoward enabled auto-merge May 21, 2026 19:37
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmations, SmokeMoney, SmokeSwap, SmokeStake, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeMultiChainAPI, SmokeWalletPlatform, SmokePerps, SmokePredictions, SmokeBrowser, SmokeAccounts
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:

The PR introduces a new theme utility (themeUtils.ts) that provides "pure black" mode support via isPureBlackEnabled, getElevatedSurfaceColor(), and useElevatedSurface(). These utilities are applied across many UI components:

  1. BottomSheetDialog.styles.ts - The most impactful change: ALL bottom sheets in the app now use getElevatedSurfaceColor for their background. This affects every flow that uses a bottom sheet (confirmations, network selection, account selection, fund actions, etc.).

  2. TradeWalletActions.tsx - The trade wallet actions bottom sheet (entry point for Swap, Perps, Predict, Earn, Stake) uses elevated surface + action buttons get bg-transparent style. This affects SmokeSwap, SmokePerps, SmokePredictions, SmokeStake, SmokeWalletPlatform.

  3. FundActionMenu.tsx - Fund action menu (Buy/Sell/Receive) uses elevated surface. Affects SmokeMoney.

  4. MoneyAddMoneySheet.tsx - Money Add Money sheet uses elevated surface. Affects SmokeMoney.

  5. NetworkMultiSelector.tsx/.styles.ts and NetworkManager/index.styles.ts - Network selection UI uses elevated surface. Affects SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeMultiChainAPI.

  6. NetworkListBottomSheet.tsx - Network list bottom sheet for AddAsset uses elevated surface. Affects SmokeNetworkAbstractions.

  7. Tabs/index.js - Browser tabs background color changes based on pure black mode. Affects SmokeBrowser.

  8. ActionListItem.tsx and ListItemMultiSelectButton.styles.ts - Generic list components used across many flows.

Since the BottomSheetDialog change is pervasive (affects all bottom sheets), and the changes touch entry points for many major flows, broad test coverage is warranted. The changes are purely visual/styling (no logic changes), which reduces risk somewhat, but the wide surface area justifies running most test suites.

SmokeConfirmations is included because confirmations use bottom sheets extensively.
SmokeAccounts is included because account management uses bottom sheets and list items.
SmokeIdentity and SmokeSeedlessOnboarding are excluded as they are less directly impacted by these specific UI component changes.

Performance Test Selection:
The changes are purely visual/styling changes - applying theme colors to existing components. No logic changes, no data loading changes, no rendering performance impacts. The new themeUtils.ts functions are simple synchronous color lookups. No performance test tags are warranted.

View GitHub Actions results

@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 is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ceb577c. Configure here.

const colors = this.context.colors || mockTheme.colors;
return createStyles(colors);
const { themeAppearance } = this.context || mockTheme;
const isDark = themeAppearance === 'dark';

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.

Raw string literal used for theme comparison

Low Severity

The newly introduced comparison themeAppearance === 'dark' uses a raw string literal instead of the AppThemeKey.dark enum constant. The same file already imports from themeUtils (a TypeScript module), so importing AppThemeKey from ../../../util/theme/models is straightforward. The sibling utility themeUtils.ts correctly uses AppThemeKey.dark for the same check, making this inconsistent.

Fix in Cursor Fix in Web

Triggered by learned rule: Use enum constants for themeAppearance comparisons, not string literals

Reviewed by Cursor Bugbot for commit ceb577c. Configure here.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
65.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@vinnyhoward vinnyhoward added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit 5a429df May 21, 2026
222 of 247 checks passed
@vinnyhoward vinnyhoward deleted the chore-635-action-bottom-sheet branch May 21, 2026 22:51
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.80.0 Issue or pull request that will be included in release 7.80.0 label May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.80.0 Issue or pull request that will be included in release 7.80.0 size-S skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants