Skip to content

fix: use background/section for bottom sheet in dark mode#28609

Draft
georgewrmarshall wants to merge 7 commits intomainfrom
bottomsheet-color-change-clean
Draft

fix: use background/section for bottom sheet in dark mode#28609
georgewrmarshall wants to merge 7 commits intomainfrom
bottomsheet-color-change-clean

Conversation

@georgewrmarshall
Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall commented Apr 9, 2026

Description

Updates the BottomSheet background color to improve dark mode visual hierarchy. Previously, all bottom sheets used background/default in both light and dark modes. This change uses background/section in dark mode to visually elevate the sheet surface above the page background.

Also removes redundant full-bleed backgroundColor overrides from content components rendered inside BottomSheets, which were conflicting with the sheet's background.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

```gherkin
Feature: BottomSheet dark mode background

Scenario: user opens any bottom sheet in dark mode
Given the app is in dark mode
When user triggers any bottom sheet (e.g. account options, network switcher, permissions)
Then the sheet surface should appear elevated using background/section
And content inside the sheet should not override the sheet background

Scenario: user opens any bottom sheet in light mode
Given the app is in light mode
When user triggers any bottom sheet
Then the sheet background should remain background/default (no visual change)
```

Screenshots/Recordings

Before

After

Pre-merge author checklist

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
Low risk visual-only changes to bottom sheet and sheet header backgrounds plus removal of nested content background overrides; main risk is unintended contrast/regression in dark-mode styling across affected screens.

Overview
Improves dark-mode visual hierarchy by switching BottomSheetDialog and SheetHeader surfaces to colors.background.section when themeAppearance is dark (keeping background.default in light mode).

Removes/conditions full-bleed backgroundColor styles inside components commonly rendered within bottom sheets (e.g., DeepLinkModal, NetworkVerificationInfo, PermissionsSummary, QRAccountDisplay, and the multichain learn-more sheet) so the sheet surface can show through; updates Jest snapshots accordingly.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

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.

@metamaskbot metamaskbot added the team-design-system All issues relating to design system in Mobile label Apr 9, 2026
@github-actions github-actions bot added the size-S label Apr 9, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

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.

Autofix Details

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

  • ✅ Fixed: PermissionsSummary loses background when rendered full-screen
    • Added conditional background.alternative to safeArea and mainContainer when not rendered as a BottomSheet to restore full-screen background.

Create PR

Or push these changes by commenting:

@cursor push f21433a123
Preview (f21433a123)
diff --git a/app/components/UI/PermissionsSummary/PermissionsSummary.styles.ts b/app/components/UI/PermissionsSummary/PermissionsSummary.styles.ts
--- a/app/components/UI/PermissionsSummary/PermissionsSummary.styles.ts
+++ b/app/components/UI/PermissionsSummary/PermissionsSummary.styles.ts
@@ -18,12 +18,23 @@
   const height = nonTabView ? tabHeight : bottomSheetHeight;
 
   return StyleSheet.create({
-    safeArea: {},
+    safeArea: {
+      // Provide background only when rendered as a full-screen view.
+      // BottomSheet supplies its own background.
+      backgroundColor: isRenderedAsBottomSheet
+        ? undefined
+        : colors.background.alternative,
+    },
     mainContainer: {
       paddingTop: 16,
       borderTopLeftRadius: 20,
       borderTopRightRadius: 20,
       height,
+      // Provide background only when rendered as a full-screen view.
+      // BottomSheet supplies its own background.
+      backgroundColor: isRenderedAsBottomSheet
+        ? undefined
+        : colors.background.alternative,
       justifyContent: isRenderedAsBottomSheet ? 'flex-start' : 'space-between',
     },
     contentContainer: {

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

@georgewrmarshall georgewrmarshall self-assigned this Apr 9, 2026
@georgewrmarshall georgewrmarshall force-pushed the bottomsheet-color-change-clean branch from 14723a5 to 1b4f862 Compare April 9, 2026 19:44
Copy link
Copy Markdown

@cursor cursor bot left a comment

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: Unused colors destructuring after removing its only usage
    • Removed the unused colors destructuring from LearnMoreBottomSheet.styles.ts.

Create PR

Or push these changes by commenting:

@cursor push 7f0aed32cc
Preview (7f0aed32cc)
diff --git a/app/components/Views/MultichainAccounts/IntroModal/LearnMoreBottomSheet.styles.ts b/app/components/Views/MultichainAccounts/IntroModal/LearnMoreBottomSheet.styles.ts
--- a/app/components/Views/MultichainAccounts/IntroModal/LearnMoreBottomSheet.styles.ts
+++ b/app/components/Views/MultichainAccounts/IntroModal/LearnMoreBottomSheet.styles.ts
@@ -3,7 +3,6 @@
 
 const styleSheet = (params: { theme: Theme }) => {
   const { theme } = params;
-  const { colors } = theme;
 
   return StyleSheet.create({
     container: {},

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

Reviewed by Cursor Bugbot for commit 1b4f862. Configure here.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.39%. Comparing base (0c26cf4) to head (1b4f862).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...UI/PermissionsSummary/PermissionsSummary.styles.ts 0.00% 0 Missing and 2 partials ⚠️
...tion/BottomSheetDialog/BottomSheetDialog.styles.ts 50.00% 0 Missing and 1 partial ⚠️
...components/Sheet/SheetHeader/SheetHeader.styles.ts 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main   #28609       +/-   ##
===========================================
- Coverage   82.13%   65.39%   -16.75%     
===========================================
  Files        4942     4942               
  Lines      129947   129966       +19     
  Branches    28977    28984        +7     
===========================================
- Hits       106732    84989    -21743     
- Misses      15917    38381    +22464     
+ Partials     7298     6596      -702     

☔ 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.

@georgewrmarshall georgewrmarshall force-pushed the bottomsheet-color-change-clean branch 2 times, most recently from fe752e9 to e172e70 Compare April 9, 2026 23:39
- Update BottomSheetDialog to use background.section in dark mode and background.default in light mode
- Apply same conditional logic to SheetHeader for consistency
- Remove redundant full-bleed backgroundColor overrides from PermissionsSummary, DeepLinkModal, LearnMoreBottomSheet, and NetworkVerificationInfo so sheet background shows through
- Remove bg-default from QRAccountDisplay root box so sheet background shows through
backgroundColor:
themeAppearance === AppThemeKey.dark
? colors.background.section
: colors.background.default,
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.

The bottom sheet shell now owns the background color, with a theme-aware split: dark mode gets background.section (a slightly elevated surface) while light mode keeps background.default. Centralizing this here means child components no longer need to redeclare a background color — the sheet itself is the single source of truth.

backgroundColor:
themeAppearance === AppThemeKey.dark
? colors.background.section
: colors.background.default,
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.

The sheet header mirrors the same dark/light split as the dialog container so its background stays visually flush with the sheet behind it. Without this, the header would show background.default on top of a background.section sheet in dark mode, creating an unintended contrast stripe.

backgroundColor: theme.colors.background.alternative,
...(!isRenderedAsBottomSheet && {
backgroundColor: theme.colors.background.alternative,
}),
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.

PermissionsSummary is used in two contexts: as a full-screen page and as a bottom sheet. In full-screen mode the component owns its background (background.alternative), but when rendered inside a BottomSheet it should be transparent so the sheet's own background shows through. The conditional spread achieves this without needing a separate style variant.

@@ -12,7 +12,6 @@ const styleSheet = (params: { theme: Theme }) => {

return StyleSheet.create({
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.

Removing the explicit background.default here lets the parent BottomSheetDialog surface its correctly themed background. Previously this hardcoded value would override the sheet's dark-mode background.section color, producing a mismatched inner panel in dark theme.


return (
<Box twClassName="bg-default items-center">
<Box twClassName="items-center">
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.

The bg-default Tailwind class was hardcoding a light-mode white background on the QR display container. Removing it allows the parent bottom sheet to provide the correct background for both themes rather than having this component override it.

@georgewrmarshall georgewrmarshall force-pushed the bottomsheet-color-change-clean branch from e172e70 to c57e411 Compare April 10, 2026 19:29
@github-actions github-actions bot added size-M and removed size-S labels Apr 10, 2026
Copy link
Copy Markdown
Contributor Author

@georgewrmarshall georgewrmarshall Apr 10, 2026

Choose a reason for hiding this comment

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

After — QRAccountDisplay

Light
Light modeDark mode

Screenshot 2026-04-10 at 12 35 07 PMScreenshot 2026-04-10 at 12 35 12 PM

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - draft PR

All E2E tests pre-selected.

View GitHub Actions results

Copy link
Copy Markdown
Contributor Author

@georgewrmarshall georgewrmarshall Apr 10, 2026

Choose a reason for hiding this comment

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

After — NetworkVerificationInfo

Light modeDark mode

Screenshot 2026-04-10 at 12 37 04 PMScreenshot 2026-04-10 at 12 37 11 PM

Copy link
Copy Markdown
Contributor Author

@georgewrmarshall georgewrmarshall Apr 10, 2026

Choose a reason for hiding this comment

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

After — LearnMoreBottomSheet

Light modeDark mode

flex: 1,
paddingHorizontal: 16,
alignItems: 'center',
backgroundColor: colors.background.default,
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.

Can't render the UI here but confident in the code changes when looking at where this color is applied

Image Image

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud
Copy link
Copy Markdown

...(!isRenderedAsBottomSheet && {
backgroundColor: theme.colors.background.alternative,
}),
paddingTop: 16,
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.

ImageImage
ImageImage

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants