fix: update cancel/speedup modal UI and migrate to non-deprecated components#39661
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. |
2143bfd to
2af64a9
Compare
Builds ready [2af64a9]
UI Startup Metrics (1353 ± 116 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
ui/components/app/cancel-speedup-popover/cancel-speedup-popover.js
Outdated
Show resolved
Hide resolved
Builds ready [765d532]
UI Startup Metrics (1314 ± 118 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
765d532 to
3e21f1c
Compare
3e21f1c to
9f7dbc1
Compare
| TextButton, | ||
| TextVariant, | ||
| } from '../../../helpers/constants/design-system'; | ||
| } from '@metamask/design-system-react'; |
There was a problem hiding this comment.
Migrated from deprecated design-system imports to the new @metamask/design-system-react package. This is part of the ongoing effort to remove deprecated components.
| ModalContent, | ||
| ModalHeader, | ||
| ModalFooter, | ||
| } from '../../component-library'; |
There was a problem hiding this comment.
Replaced deprecated ModalHeader and ModalContent with their current versions from component-library. The deprecated versions were scheduled for removal.
| {editGasMode === EditGasModes.cancel | ||
| ? `❌${t('cancel')}` | ||
| : `🚀${t('speedUp')}`} | ||
| {editGasMode === EditGasModes.cancel ? t('cancel') : t('speedUp')} |
There was a problem hiding this comment.
Removed emoji decorations from modal headers per design feedback. The emojis felt out of place and made the modal headers less professional.
| paddingBottom={2} | ||
| className="cancel-speedup-popover__description" | ||
| className="cancel-speedup-popover__description flex items-center mb-2 pb-2" | ||
| variant={TextVariant.BodySm} |
There was a problem hiding this comment.
Using TextVariant.BodySm with PascalCase to match the design-system-react exports. The old constants used camelCase which is incompatible with the new package.
| {t('cancelSpeedUpLabel', [ | ||
| <strong key="cancelSpeedupReplace">{t('replace')}</strong>, | ||
| ])} | ||
| {t('cancelSpeedUpLabel', [t('replace')])} |
There was a problem hiding this comment.
Removed bold formatting from the description text to match design specs. The strong tag was making the text too visually prominent.
| > | ||
| {t('learnMoreUpperCase')} | ||
| </ButtonLink> | ||
| <TextButton asChild className="inline"> |
There was a problem hiding this comment.
Replaced ButtonLink with TextButton using the asChild pattern. TextButton wraps an anchor tag for proper link semantics while maintaining button styling. Also added rel="noopener noreferrer" for security.
| } | ||
| /> | ||
| </Text> | ||
| <Box |
There was a problem hiding this comment.
Migrated from deprecated Box component to design-system-react Box. Using BoxAlignItems and BoxFlexDirection enums instead of the old constant values.
| </Box> | ||
| <Button onClick={submitTransactionChange}>{t('submit')}</Button> | ||
| </div> | ||
| <ModalFooter |
There was a problem hiding this comment.
Replaced standalone Button with ModalFooter component for consistent full-width button styling. ModalFooter handles the submit action and button props, ensuring consistent modal UX across the application.
| it('should have Cancel in header if editGasMode is cancel', async () => { | ||
| await act(async () => render()); | ||
| expect(screen.queryByText('❌Cancel')).toBeInTheDocument(); | ||
| expect(screen.queryByText('Cancel')).toBeInTheDocument(); |
There was a problem hiding this comment.
Updated test assertions to verify the emoji-free modal headers. These tests ensure the UI changes for MDP-485 and MDP-486 are working correctly.
Builds ready [9f7dbc1]
UI Startup Metrics (1379 ± 93 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Description
This PR addresses several UI papercuts in the cancel and speedup transaction modals by removing emojis, updating button styling, removing bold text formatting, and migrating from deprecated Modal components to their current versions.
The modals had several UI issues identified in MDP-485, MDP-486, and MDP-491: emoji decorations felt out of place, the submit button wasn't full-width, and bold text made the description too prominent. Additionally, the component was using deprecated Modal components scheduled for removal.
Changes included:
ModalHeaderandModalContentimports to current component library versionsButtonLinkwithTextButtonusing the asChild pattern for proper link semanticsBoxand design-system constants to@metamask/design-system-reactcomponentsButtonwithModalFootercomponent for consistent full-width button styling<strong>tag from description text to match design specsTextVariantenum usage to use PascalCase (BodySm) instead of camelCase (bodySm)Changelog
CHANGELOG entry: Fixed cancel and speedup modal UI by removing emojis, standardizing button width, and migrating to current component versions
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MDP-485
Fixes: https://consensyssoftware.atlassian.net/browse/MDP-486
Fixes: https://consensyssoftware.atlassian.net/browse/MDP-491
Manual testing steps
Screenshots/Recordings
Before
beforespeedup720.mov
After
speedupafter720.mov
Pre-merge author checklist
Pre-merge reviewer checklist