- 
                Notifications
    
You must be signed in to change notification settings  - Fork 5.4k
 
fix: Refine slippage buttons to match trade patterns #36556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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/swaps-engineers (2 files, +32 -84)
  | 
    
          📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI  | 
    
          Builds ready [8d9f4c2]
 UI Startup Metrics (1230 ± 65 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
  | 
    
| 
           ❌ test-e2e-chrome-api-specs failed. View the html report here.  | 
    
          📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI  | 
    
          Builds ready [bf01e69]
 UI Startup Metrics (1230 ± 62 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
  | 
    
| 
           ❌ test-e2e-chrome-api-specs failed. View the html report here.  | 
    
| : `${customSlippage}%`} | ||
| </Text> | ||
| </Button> | ||
| <> | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not use the variant prop way so we can prevent duplicating logic by having only a single button component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, thanks for the suggestion!
I've updated the code to conditionally render the buttons using the variant prop. Now the logic is not duplicated.
| !isAutoSelected && localSlippage === hardcodedSlippage; | ||
| return ( | ||
| <Button | ||
| isAutoSelected === false && localSlippage === hardcodedSlippage; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amandaye0h I agree with Cursor here. can you change this to check for !isAutoSelected instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
          📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI  | 
    
          Builds ready [e3c0ea8]
 UI Startup Metrics (1262 ± 84 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
  | 
    
          📊 Page Load Benchmark ResultsCurrent Commit:  📄 Localhost MetaMask Test DappSamples: 100 Summary
 📈 Detailed Results
 Results generated automatically by MetaMask CI  | 
    
          Builds ready [d039c94]
 UI Startup Metrics (1274 ± 85 ms)
 Bundle size diffs [🚨 Warning! Bundle size has increased!]
  | 
    
Description
This PR refactors the slippage buttons to follow the Trade UI selection patterns used in our Mobile app. It improves cross-client consistency by replacing the old logic with
ButtonSecondary, ensuring the buttons inherit design system standards.Changelog
CHANGELOG entry: null: UI fixes
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
Screen.Recording.2025-10-08.at.4.17.09.PM.mov
After
Screen.Recording.2025-10-03.at.3.57.37.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Refactors bridge slippage controls to use design-system Button variants/sizes and simplifies text field styling.
ui/pages/bridge/prepare/bridge-transaction-settings-modal.tsx):ButtonPrimarysubmit withButton(ButtonVariant.Primary,ButtonSize.Lg).ButtonSize.Mdand useButtonVariant.Primary/Secondaryfor selected state; remove manual border/background/text color logic.TextwithvariantbodyMdMedium; adjust container padding (paddingInline,paddingBottom).TextField: setsizetoMd,borderColortoborderMuted,borderRadiustoXL; remove explicit border width.ui/pages/bridge/prepare/index.scss):.bridge-settings-modal .mm-text-field: remove fixed heights and input font-size/padding; keep width; maintain secondary button hover style.Written by Cursor Bugbot for commit d039c94. This will update automatically on new commits. Configure here.