fix: Remove black backgrounds on fees and migrate edit-gas-fee-popover to Modal#39690
Conversation
|
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. |
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (2 files, +101 -75)
|
ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-fee-popover.js
Outdated
Show resolved
Hide resolved
Builds ready [e5fc033]
UI Startup Metrics (1283 ± 114 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
cbea872 to
095da2a
Compare
ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-fee-popover.js
Outdated
Show resolved
Hide resolved
Builds ready [43de4d5]
UI Startup Metrics (1303 ± 117 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [cba3fb5]
UI Startup Metrics (1383 ± 94 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…ee-popover to Modal This PR fixes the black background issue on fee rows in the Edit Gas Fee modal and migrates the modal to use the component library Modal instead of the deprecated Popover. Changes: - Fixed black background on selected fee rows by changing LoadingHeartBeat backgroundColor from 'var(--color-background-alternative)' to 'var(--color-primary-muted)' - Migrated edit-gas-fee-popover from deprecated Popover to component library Modal - Replaced deprecated ModalHeader and ModalContent with current versions - Migrated from SASS to Tailwind CSS and design system components - Updated imports to use @metamask/design-system-react (Box, Text, TextButton) - Replaced raw div/span elements with design system Text components - Replaced ButtonLink with TextButton for "Learn more" link - Used Box component props and Tailwind classes instead of SASS styles The modal now follows the UI development guidelines by using: - Modal, ModalOverlay, ModalContent, ModalHeader, ModalBody from component library - Box with flexDirection and other typed props - Text with variant, color, and fontWeight props - TextButton with asChild pattern for links - Tailwind utility classes instead of custom SCSS All tests pass successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…as-fee-popover
Replaced Tailwind CSS classes with typed Box component props from design-system-react:
- BannerAlert: className="mb-1" → marginBottom={1}
- Box header row: className="flex gap-0 mx-3 mb-0" → flexDirection={BoxFlexDirection.Row} + marginHorizontal={3}
- Box separator: className="border-t border-default my-2 mx-3" → borderColor={BoxBorderColor.BorderDefault} + marginVertical={2} + marginHorizontal={3}
- Box footer: className="mt-9" → marginTop={9}
- Text: className="text-center" → textAlign={TextAlign.Center}
Kept Tailwind classes where Box doesn't provide equivalent props (width percentages, border-t utility).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
| TextColor, | ||
| BoxBorderColor, | ||
| TextAlign, | ||
| } from '@metamask/design-system-react'; |
There was a problem hiding this comment.
Replacing legacy component imports with design system components from @metamask/design-system-react. This aligns with the ongoing effort to standardize components across the extension.
| </Box> | ||
| <Box> | ||
| <NetworkStatistics /> | ||
| <ModalBody className="flex flex-col justify-between"> |
There was a problem hiding this comment.
Using Tailwind flex utilities combined with Box flexDirection prop to create a responsive two-column layout. The top section contains the gas options list and the bottom section has network stats with margin-top spacing.
| variant={TextVariant.BodyXs} | ||
| fontWeight={FontWeight.Bold} | ||
| color={TextColor.TextAlternative} | ||
| className="inline-block w-[36%]" |
There was a problem hiding this comment.
Replaced CSS classes with Tailwind width utilities to control column proportions. This provides more explicit control over the table-like header layout compared to the previous CSS approach.
| )} | ||
| <EditGasItem priorityLevel={PriorityLevels.medium} /> | ||
| <EditGasItem priorityLevel={PriorityLevels.high} /> | ||
| <Box |
There was a problem hiding this comment.
Migrating from CSS class separator to Box component with Tailwind border utility and borderColor prop. This maintains the visual separation while using design system tokens.
| textAlign={TextAlign.Center} | ||
| > | ||
| {t('learnMoreAboutGas', [ | ||
| <TextButton asChild key="learnMoreLink" className="inline"> |
There was a problem hiding this comment.
Using TextButton with asChild pattern to render as an anchor tag. This provides button styling while maintaining proper semantic HTML for external links.
| backgroundColor={ | ||
| priorityLevel === estimateUsed | ||
| ? 'var(--color-background-alternative)' | ||
| ? 'var(--color-primary-muted)' |
There was a problem hiding this comment.
Changed from background-alternative to primary-muted for the selected gas option. This fixes the black background issue reported in MDP-496 and provides better visual contrast for the selected state.
Builds ready [bbaedac]
UI Startup Metrics (1384 ± 92 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
bbaedac to
a0987ae
Compare
a0987ae to
1543d38
Compare
Builds ready [1543d38]
UI Startup Metrics (1417 ± 88 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Description
This PR fixes a UI issue in the edit gas fee popover where black backgrounds appeared behind the fee options, causing the highlighted row to appear broken and awkward.
The edit-gas-fee-popover component had visual issues identified in MDP-496 where black backgrounds were showing behind fee options, breaking up the highlighted row selection and creating an awkward appearance. Additionally, the component was using the deprecated Popover component and needed migration to the current Modal component.
Changes included:
Popovercomponent toModalwithModalOverlay,ModalContent,ModalHeader, andModalBodyLoadingHeartBeatbackground color fromvar(--color-background-alternative)tovar(--color-primary-muted)Box,Text, and design-system constants to@metamask/design-system-reactcomponentsButtonLinkwithTextButtonusing the asChild pattern for proper link semanticsflexDirection,marginHorizontal, andmarginVerticalpropsChangelog
CHANGELOG entry: Fixed edit gas fee popover UI by removing black backgrounds and migrating to Modal component
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MDP-496
Manual testing steps
Screenshots/Recordings
Before
After
720after.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
UI refactor in the transaction confirmation flow that changes the container component and layout for the gas fee editor; risk is mainly regressions in modal/back/close behavior and styling across modes.
Overview
Replaces the deprecated
Popover-based edit gas fee UI with the component-libraryModal(ModalHeader/ModalBody), including updated close/back wiring via the transaction modal context.Migrates layout primitives to
@metamask/design-system-react(Box/Text/TextButton) and adjusts header/separator styling and the “Learn more” link rendering.Fixes the selected fee row’s visual highlight by updating
LoadingHeartBeat’s selectedbackgroundColorfrom--color-background-alternativeto--color-primary-muted.Written by Cursor Bugbot for commit 1543d38. This will update automatically on new commits. Configure here.