fix(confirmations): use elevated surface for edit spending cap modal#33299
fix(confirmations): use elevated surface for edit spending cap modal#33299georgewrmarshall wants to merge 2 commits into
Conversation
In Pure Black mode, the Edit approval limit bottom sheet used background.default, causing it to collapse visually against the elevated confirmation surface beneath it. Replace with getElevatedSurfaceColor(theme) to match other confirmation modals. Fixes TMCU-1090 Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
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. |
Apply muted border on elevated surface in Pure Black dark mode so the spending cap sheet matches other confirmation bottom sheets. Co-authored-by: Cursor <cursoragent@cursor.com>
|
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. |
| // Drop getElevatedSurfaceColor, isPureBlackEnabled, and AppThemeKey checks. | ||
| container: { | ||
| backgroundColor: theme.colors.background.default, | ||
| backgroundColor: getElevatedSurfaceColor(theme), |
There was a problem hiding this comment.
EditSpendingCapModal is the approval-limit sheet opened from ERC-20 Approve or Increase Allowance flows (edit-spending-cap-button), not Sign Permit value editing. In Pure Black dark the container used background.default and blended into the flat confirmation screen (TMCU-1090); getElevatedSurfaceColor elevates only the outer sheet.
| const { theme } = params; | ||
| const { colors } = theme; | ||
| const isPureBlackDark = | ||
| isPureBlackEnabled && theme.themeAppearance === AppThemeKey.dark; |
There was a problem hiding this comment.
isPureBlackDark uses the same gate as ConfirmAlertModal, AlertModal, and gas-fee-token-modal: isPureBlackEnabled plus AppThemeKey.dark. Light mode and non-preview builds are unchanged.
| backgroundColor: theme.colors.background.default, | ||
| backgroundColor: getElevatedSurfaceColor(theme), | ||
| borderWidth: isPureBlackDark ? 1 : 0, | ||
| borderColor: isPureBlackDark ? colors.border.muted : undefined, |
There was a problem hiding this comment.
border.muted on the top sheet edge separates the elevated surface from the flat black confirmation backdrop when borderWidth is 1; borderWidth 0 elsewhere avoids double borders on rounded corners in standard themes.
| isPureBlackEnabled && theme.themeAppearance === AppThemeKey.dark; | ||
|
|
||
| return StyleSheet.create({ | ||
| // TODO(Pure Black): Remove once MMDS ships pure-black-aware surface tokens. |
There was a problem hiding this comment.
Temporary themeUtils shim with TODO until MMDS ships native elevated surface tokens; inner content styles are out of scope for this ticket.
| return StyleSheet.create({ | ||
| // TODO(Pure Black): Remove once MMDS ships pure-black-aware surface tokens. | ||
| // Drop getElevatedSurfaceColor, isPureBlackEnabled, and AppThemeKey checks. | ||
| container: { |
There was a problem hiding this comment.
Manual validation: test-dapp Approve Tokens or Increase Allowance, tap Edit approval limit to open this modal. Enable MM_PURE_BLACK_PREVIEW and dark appearance; sheet should show elevated gray surface with muted top border.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
This is a cosmetic visual change that only affects the appearance of the edit spending cap modal in pure black dark mode. The change is only imported by the modal component itself ( Performance Test Selection: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #33299 +/- ##
========================================
Coverage 84.37% 84.37%
========================================
Files 6127 6129 +2
Lines 163530 163632 +102
Branches 39887 39906 +19
========================================
+ Hits 137974 138071 +97
+ Misses 16050 16047 -3
- Partials 9506 9514 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|



Description
In Pure Black mode, the Edit approval limit bottom sheet (
EditSpendingCapModal) usedbackground.default, which collapsed visually against the elevated confirmation surface beneath it.This change replaces
theme.colors.background.defaultwithgetElevatedSurfaceColor(theme)on the modal container, matching other confirmation modals (e.g.gas-fee-token-modal).Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-1090
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an examplePre-merge reviewer checklist