Skip to content

fix(confirmations): use elevated surface color in ConfirmAlertModal for Pure Black#33296

Open
georgewrmarshall wants to merge 2 commits into
mainfrom
cursor/fix-confirm-alert-modal-pure-black-230a
Open

fix(confirmations): use elevated surface color in ConfirmAlertModal for Pure Black#33296
georgewrmarshall wants to merge 2 commits into
mainfrom
cursor/fix-confirm-alert-modal-pure-black-230a

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

In Pure Black mode, the ConfirmAlertModal (high-risk / Blockaid warnings) bottom sheet used background.default, which collapses visually against the elevated confirmation surface beneath it.

This change replaces theme.colors.background.default with getElevatedSurfaceColor(theme) on the modal container, matching other confirmation modals (e.g. gas-fee-token-modal).

Changelog

CHANGELOG entry: null

Related issues

Fixes: TMCU-1093

Manual testing steps

Feature: ConfirmAlertModal Pure Black surface

  Scenario: elevated surface is used in Pure Black mode
    Given Pure Black mode is enabled
    And a confirmation flow triggers a high-risk / Blockaid alert
    When the ConfirmAlertModal bottom sheet is shown
    Then the modal background uses the elevated surface color (#1c1d1f)
    And it is visually distinct from the flat black confirmation screen behind it

Screenshots/Recordings

Before

Screenshot 2026-07-14 at 3 24 51 PM

After

Screenshot 2026-07-14 at 3 35 59 PM

Pre-merge author checklist

  • Followed contributor docs
  • Completed PR template
  • Included tests if applicable
  • Documented code with JSDoc if applicable
  • Applied right labels

Performance checks (if applicable)

N/A

Pre-merge reviewer checklist

  • Reviewer item
Open in Web Open in Cursor 

Replace background.default with getElevatedSurfaceColor in the
ConfirmAlertModal bottom sheet so Pure Black mode shows the correct
elevated surface when stacked on the confirmation screen.

Fixes TMCU-1093

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@metamask-ci metamask-ci Bot added the team-design-system All issues relating to design system in Mobile label Jul 14, 2026
@metamask-ci

metamask-ci Bot commented Jul 14, 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 only 5 of the required 8 items. Every checklist row must be present and consciously checked — do not delete rows.

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

Adds a muted border in Pure Black dark mode so the elevated sheet edge
reads clearly against the flat confirmation background.

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.

@georgewrmarshall georgewrmarshall marked this pull request as ready for review July 14, 2026 22:38
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner July 14, 2026 22:38
@georgewrmarshall georgewrmarshall self-assigned this Jul 14, 2026
@github-actions github-actions Bot added size-S and removed size-XS labels Jul 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The change is a styling-only modification to confirm-alert-modal.styles.ts in the confirmations flow. It adds pure black theme support by:

  1. Changing backgroundColor from theme.colors.background.default to getElevatedSurfaceColor(theme)
  2. Adding a conditional border for pure black dark mode

This is a visual/cosmetic change with no functional logic changes. However, since it modifies the styling of the confirm-alert-modal component which is part of the confirmations flow, running SmokeConfirmations is appropriate to verify the modal renders correctly and doesn't break any confirmation UI flows. No other test areas are impacted as this is isolated to the confirmations modal styling.

Performance Test Selection:
This is a pure styling change to a modal component. It only affects visual appearance (background color and border for pure black theme) with no impact on rendering performance, data loading, or any performance-sensitive flows.

View GitHub Actions results

@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jul 14, 2026
@sonarqubecloud

Copy link
Copy Markdown

// Drop getElevatedSurfaceColor, isPureBlackEnabled, and AppThemeKey checks.
modalContainer: {
backgroundColor: theme.colors.background.default,
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.

ConfirmAlertModal opens over the confirmations screen, which is flat black in Pure Black dark. background.default on the sheet matched that parent (TMCU-1093); getElevatedSurfaceColor maps to background.alternative only when Pure Black preview and dark appearance are both active.

const styleSheet = (params: { theme: Theme }) => {
const { theme } = params;
const { colors } = theme;
const isPureBlackDark =

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 uses the same gate as gas-fee-token-modal.styles.ts: isPureBlackEnabled plus AppThemeKey.dark. Light mode and non-preview builds keep background.default with no border, so this is scoped to the Pure Black dark case only.

modalContainer: {
backgroundColor: theme.colors.background.default,
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.

The 1px border.muted edge matches gas-fee-token-modal and the value-detail bottom sheet follow-up. Elevated fill alone was still hard to read against the flat confirmation backdrop in device QA.

isPureBlackEnabled && theme.themeAppearance === AppThemeKey.dark;

return StyleSheet.create({
// TODO(Pure Black): Remove once MMDS ships pure-black-aware surface tokens.

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.

Temporary Pure Black shim per repo convention: themeUtils branching here until MMDS exposes surface tokens that distinguish default vs elevated without local isPureBlackEnabled checks.

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

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.

Style-only change; no new tests. Manual validation path: test-dapp Sign In With Ethereum Bad Domain, acknowledge the inline Request from alert, then tap Confirm to surface this modal (testID confirm-alert-modal). Blockaid malicious batch is an alternate path if security alerts flag the request.

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

Labels

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.

2 participants