Repository navigation
refactor: migrate bridge switch tokens button to MMDS - #47597
Conversation
✨ Files requiring CODEOWNER review ✨🔄 @MetaMask/swaps-engineers (3 files, +54 -36)
|
1bee916 to
e3c18cf
Compare
Builds ready [1bee916]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 4 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
e3c18cf to
93963aa
Compare
Builds ready [93963aa]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 4 warn · 🔴 2 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
93963aa to
1ae3db2
Compare
Builds ready [1ae3db2]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 5 warn · 🔴 1 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
1ae3db2 to
b741c48
Compare
Builds ready [b741c48]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 3 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
b741c48 to
95146ce
Compare
138b2ae to
a768ba4
Compare
Builds ready [a768ba4]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)
Bundle Size Diffs
|
…roup-mmds-d1f4 Resolve the conflicts with the swap input card layout from main (#47725) while keeping this branch's MMDS bridge input group. - Keep main's separate source and destination cards and flip-button markup. - Keep the MMDS input group, including the token-address copy button. - Refresh the prepare-page snapshots for that combination. - Keep the flip-button rules in prepare/index.scss, which the new button still uses for hover, pressed, and the spin. The unused select-button, mascot, highlight, and settings-modal rules stay removed. - Leave CHANGELOG.md and attribution.txt as they are on main. Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
…1f4' into cursor/bridge-switch-tokens-mmds-d1f4 Keep the MMDS switch-tokens button on the 28px flip control from the updated prepare page. - Use ButtonIcon from the design system, with isDisabled and the down arrow. - Keep the card gap, SVG notch, and 28px circle from the swap card layout. - Refresh the prepare-page snapshots for that button. - Leave CHANGELOG.md and attribution.txt unchanged. Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Builds ready [89f7d52]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 4 warn · 🔴 2 fail)
Bundle Size Diffs
|
…roup-mmds-d1f4 Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
…1f4' into cursor/bridge-switch-tokens-mmds-d1f4 Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Builds ready [9d651c5]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 3 warn · 🔴 2 fail)
Bundle Size Diffs
|
|



Description
Part of the MMDS migration epic: https://consensyssoftware.atlassian.net/browse/TMCU-1741
Stack: #47558 (Bridge Grotzec large number input) is merged to main. This PR is stacked on #47596 (bridge input group to MMDS).
This PR migrates the switch-tokens button in
ui/pages/bridge/prepare/prepare-bridge-page.tsxfrom the legacyButtonIcon/IconNameto MMDSButtonIcon,ButtonIconSizeandIconName. The goal is no visual change.size={ButtonIconSize.Lg}is set explicitly, because MMDS defaults toMd. Lg gives the same 40px button and 32px (Xl) icon as the legacy default.color={IconColor.iconAlternative}moves toiconProps.color(IconColor.IconAlternative), next to the existing icon classes.disabled→isDisabled. The disabled opacity is the same (legacy--opacity-disabledis 0.5; MMDS usesopacity-50).data-testid="switch-tokens"andariaLabelare unchanged. The test ID is used bytest/e2e/page-objects/pages/bridge/quote-page.ts.className="min-w-10"keeps the legacy.mm-button-iconmin-width: 40px. Under globalborder-box, the button's inlinewidth/height: 100%resolves to 36px inside the 40px wrapper with a 2px border. Legacy's min-width therefore made the hover/pressed fill 40×36. Without the class, the fill would shrink to a 36×36 circle.group-hovervariants on the icon), so they work the same on the MMDS inline SVG icon.Boxand the surroundingColumn(BackgroundColor,BlockSize,JustifyContent) are unchanged.Possible visual differences to check: The icon now renders as an inline SVG instead of a legacy CSS-mask span. It's the same glyph and size, but anti-aliasing may differ by a sub-pixel.
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Swap page, DAI → mUSD (
getBridgeFixtures+enableFiatToggle), captured at 2x in the side panel (360×768) and the popup (400×600). Before = #47558 at9048d3d0. After = this PR at138b2aecf6(stacked on #47596 at8923f5293e; fresh stills, 2026-11-05). Pixel diffs were run on every screen (rest, hover, pressed, disabled, empty, amount entered) in light and dark.Before
Legacy
ButtonIconfor switch tokens (this PR) and legacyText/ButtonLinkin the input group (#47596).#4459FF, dark#8B99FF.#E4E4E5, dark#36363D.After
MMDS
ButtonIcon(this PR) and MMDSText/TextButton(#47596). Only two differences show up, both in interaction states:TextButtonusesprimary-default-hover, so the text and underline go to light#384DF5, dark#9EAAFF. Underline position, thickness, glyphs and spacing are unchanged.#DFDFE0, dark#3E3E46. Size and position are unchanged.Both are subtle in static shots (one or two shades), so compare the Max link and the switch circle in those rows. Everything else is pixel-identical apart from about 3 px of sub-pixel anti-aliasing on the switch arrow tips.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
UI-only design-system swap on a single bridge control; behavior and test IDs are preserved, with only minor possible differences in pressed styling or icon rendering.
Reviewed by Cursor Bugbot for commit 9d651c5. Bugbot is set up for automated code reviews on this repo. Configure here.