Skip to content

fix(pure-black): align Advanced details Expandable sheet with other elevated sheets#33152

Merged
georgewrmarshall merged 3 commits into
mainfrom
cursor/advanced-details-bottomsheet-7f9d
Jul 14, 2026
Merged

fix(pure-black): align Advanced details Expandable sheet with other elevated sheets#33152
georgewrmarshall merged 3 commits into
mainfrom
cursor/advanced-details-bottomsheet-7f9d

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

Aligns the confirmations Advanced details stacked sheet (ExpandableBottomModal) with other pure black elevated sheets.

In pure black dark mode, modalContent was using the wrong surface color (bg-section). This is not as severe as the bg-default banding issue elsewhere, but it made this sheet look inconsistent with other elevated bottom sheets. This PR updates expandable.styles.ts only:

  • backgroundColor uses getElevatedSurfaceColor() so the sheet resolves to bg-alternative in pure black dark mode (unchanged when the preview flag is off)
  • border.muted is applied only when pure black preview is on in dark mode, matching other elevated-surface stopgaps (SelectComponent, ModalConfirmation)

expandable.tsx is unchanged — still uses legacy BottomModal for stacking on the confirmation sheet. We plan to replace this with MMDS BottomSheet in a follow-up; this is a style-only stopgap until then.

modalContent is shared by all Expandable consumers in confirmations (Advanced details, signature Message, and account Details rows).

Changelog

CHANGELOG entry: Fixed Advanced details bottom sheet surface color in Pure Black to match other elevated sheets (style-only change).

Related issues

Refs: TMCU-622
Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-1095

Manual testing steps

Feature: Advanced details sheet matches other pure black elevated sheets

  Scenario: Open Advanced details from a dapp-initiated transfer
    Given dark mode is enabled and MM_PURE_BLACK_PREVIEW=true
    And the wallet is connected to https://metamask.github.io/test-dapp
    When the user taps "Send EIP-1559 Transaction"
    And scrolls to and taps the "Advanced details" row (testID: advanced-details)
    Then a stacked bottom sheet opens titled "Advanced details"
    And the sheet surface color matches other elevated bottom sheets
    And nonce / interacting-with / data content is unchanged
    And the sheet dismisses via the close button or swipe down

Screenshots/Recordings

Before

Screenshot 2026-07-13 at 9 43 32 PM

After

Screenshot 2026-07-13 at 9 43 36 PM

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs and Coding Standards
  • I've completed the PR template to the best of my ability
  • I've included tests if applicable
  • I've documented my code using JSDoc format if applicable
  • I've applied the right labels on the PR (internal only)

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 the linked power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

Slack Thread

Open in Web Open in Cursor 

…apply bg-alternative surface when Pure Black is enabled; remove legacy BottomModal usage

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@metamask-ci metamask-ci 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
@metamask-ci

metamask-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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

Warnings — informational, address before merging:

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

@cursor cursor Bot changed the title Pure Black: switch confirmations Expandable to MMDS BottomSheet (uses bg-alternative) fix(pure-black): switch confirmations Expandable to MMDS BottomSheet (uses bg-alternative) Jul 10, 2026
@georgewrmarshall

Copy link
Copy Markdown
Contributor Author

@cursoragent revert the refactor changes and lets just chagne the styles to use background alternative if pure black is true

@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Done. I reverted the Expandable refactor and made a style-only fix:

  • Reverted Expandable to use the existing BottomModal (no component migration).
  • Updated expandable.styles.ts to use the elevated surface color, which resolves to bg-alternative when Pure Black is enabled.
  • Pushed commit and updated the PR body to reflect “style-only” change.

This keeps behavior unchanged and fixes the Pure Black background for the Advanced details sheet.

Open in Web Open in Cursor 

…lementation

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@github-actions github-actions Bot added size-XS and removed size-S labels Jul 10, 2026
Gate border.muted on the Expandable BottomModal surface when pure black
preview is enabled in dark mode, matching other elevated surface stopgaps.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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.

@github-actions github-actions Bot added size-S and removed size-XS labels Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
The only changed file is app/components/Views/confirmations/components/UI/expandable/expandable.styles.ts. The diff shows purely visual/styling changes:

  1. The backgroundColor of modalContent is updated from theme.colors.background.section to getElevatedSurfaceColor(theme) - a visual-only change
  2. A borderWidth and borderColor are added conditionally for pure black dark mode - also visual-only

These changes only affect the appearance of the expandable component in confirmations when using the pure black dark theme. There are no functional logic changes, no user flow changes, no API changes, and no behavioral changes. This falls under cosmetic/visual styling changes that do not warrant E2E test execution.

Per the COSMETIC CHANGES guidance: changes that only affect visual styling (colors, borders, backgrounds) have zero functional impact and must NOT trigger additional test selection on their own.

Performance Test Selection:
The change is purely a visual styling update to the expandable component's stylesheet in confirmations. It adjusts background color and adds a border for pure black dark mode. There is no performance-sensitive code changed - no rendering logic, no data fetching, no state management, no component lifecycle changes. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

// Drop getElevatedSurfaceColor, isPureBlackEnabled, and AppThemeKey checks.
modalContent: {
backgroundColor: theme.colors.background.section,
backgroundColor: getElevatedSurfaceColor(theme),

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.

Replaces bg-section on modalContent with getElevatedSurfaceColor so the stacked Advanced details BottomModal reads as an elevated surface on the pure black confirmation backdrop. When MM_PURE_BLACK_PREVIEW is off this still resolves to bg-default, so existing dark and light users should see no surface change.

const { isCompact } = vars;
const { colors } = theme;
const isPureBlackDark =
isPureBlackEnabled && theme.themeAppearance === AppThemeKey.dark;

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.

isPureBlackDark follows the same gated border pattern as SelectComponent and ModalConfirmation: border.muted only when MM_PURE_BLACK_PREVIEW is on in dark mode. That keeps legacy sheet chrome unchanged outside the preview rollout.

},
// TODO(Pure Black): Remove once MMDS ships pure-black-aware surface tokens.
// Drop getElevatedSurfaceColor, isPureBlackEnabled, and AppThemeKey checks.
modalContent: {

@georgewrmarshall georgewrmarshall Jul 14, 2026

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.

modalContent is shared by every Expandable consumer in confirmations (Advanced details, signature Message, and account Details rows), so this style-only change fixes pure black colors on all stacked BottomModal sheets from this component, not just the Advanced details entry point.

modalContent: {
backgroundColor: theme.colors.background.section,
backgroundColor: getElevatedSurfaceColor(theme),
borderWidth: isPureBlackDark ? 1 : 0,

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.

Net diff vs main is styles only; expandable.tsx still uses legacy BottomModal for stacking on the confirmation sheet. MMDS BottomSheet migration is deferred per confirmations team direction and issue 12656.

@georgewrmarshall georgewrmarshall changed the title fix(pure-black): switch confirmations Expandable to MMDS BottomSheet (uses bg-alternative) fix(pure-black): elevate Advanced details Expandable sheet surface Jul 14, 2026
@georgewrmarshall georgewrmarshall self-assigned this Jul 14, 2026
@georgewrmarshall georgewrmarshall changed the title fix(pure-black): elevate Advanced details Expandable sheet surface fix(pure-black): align Advanced details Expandable sheet with other elevated sheets Jul 14, 2026
@georgewrmarshall georgewrmarshall marked this pull request as ready for review July 14, 2026 04:49
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner July 14, 2026 04:49
@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jul 14, 2026
@georgewrmarshall georgewrmarshall added this pull request to the merge queue Jul 14, 2026
Merged via the queue into main with commit 025842a Jul 14, 2026
228 checks passed
@georgewrmarshall georgewrmarshall deleted the cursor/advanced-details-bottomsheet-7f9d branch July 14, 2026 11:41
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 14, 2026
@metamask-ci metamask-ci Bot added the release-8.4.0 Issue or pull request that will be included in release 8.4.0 label Jul 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-8.4.0 Issue or pull request that will be included in release 8.4.0 risk:low AI analysis: low risk 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.

3 participants