You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: improve xchain swaps slippage settings with decimals and warnings (#29617)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
The slippage settings for xchain transactions was not allowing users to
input a decimal (i.e. 0.5%), only whole numbers (0, 1, so on...). It
also did not display a warning for low slippage settings. This addresses
both by allowing the user to input decimal numbers, and displaying a
warning when the custom slippage is set to <0.5% in the settings modal.
[](https://codespaces.new/MetaMask/metamask-extension/pull/29617?quickstart=1)
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/MMS-1830
## **Manual testing steps**
1. Go to the xchain swaps transaction preparation page.
2. Edit slippage settings.
3. Notice decimals are now allowed, and a warning is displayed with low
slippage.
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<img width="465" alt="Screenshot 2025-01-09 at 4 49 04 PM"
src="https://github.com/user-attachments/assets/b7930dab-166d-4ad9-a622-efa118b6a196"
/>
<!-- [screenshots/recordings] -->
### **After**
<img width="483" alt="Screenshot 2025-01-09 at 2 29 30 PM"
src="https://github.com/user-attachments/assets/2918f0c3-98a6-4b28-ae88-42ea166c4921"
/>
<img width="489" alt="Screenshot 2025-01-09 at 2 29 22 PM"
src="https://github.com/user-attachments/assets/0a7fdcdd-8057-4818-a22c-4ac7e1f3620e"
/>
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
0 commit comments