[pull] main from MetaMask:main#593
Merged
pull[bot] merged 9 commits intoReality2byte:mainfrom Mar 11, 2026
Merged
Conversation
) <!-- 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? --> - Fiat payment methods now appear at the top of the `PayWithModal` token list, prepended as highlighted action items via `useFiatPaymentHighlightedActions` - When a fiat payment method is selected, the Pay-With row renders a `PayWithFiatPaymentMethodRow` showing the payment method icon and name instead of the token row - `getAvailableTokens` accepts an optional `fiatPayment` parameter - when a fiat method is active, all token isSelected flags are cleared so fiat takes visual precedence ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: #27113 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] 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-mobile/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). - [ ] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes confirmation payment selection UI and token list logic to prioritize fiat methods, which could affect what users see as selected and how they choose a pay option. Scope is limited to confirmations UI/util logic and is covered by updated tests. > > **Overview** > Adds fiat payment method support to the confirmations *Pay With* UX: `PayWithModal` now prepends fiat payment actions (from `useFiatPaymentHighlightedActions`) above the token list and passes `fiatPayment` into `getAvailableTokens`. > > Updates the *Pay With* row to render a dedicated fiat payment method row (icon + name) when a method is selected via `useTransactionPaySelectedFiatPaymentMethod`, and adjusts `getAvailableTokens` so token `isSelected` is cleared when a fiat method is actively selected; accompanying unit tests cover these behaviors. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 82a6107. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- 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** This PR aims to simplify the rendering of the Cancel and speed up modal. <!-- 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? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: MetaMask/mobile-planning#2417 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** [cancel-testmodal.webm](https://github.com/user-attachments/assets/87ae1d17-3fca-4e32-b978-6b0eeb0e4384) [Screencast from 2026-03-04 11-13-29.webm](https://github.com/user-attachments/assets/72f4fd96-7f83-44fd-9580-c72e1546e1a4) <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] 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-mobile/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). - [ ] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Moderate UI/flow change in transaction replacement (speed up/cancel) modals, including Ledger confirmation cleanup, which could impact users’ ability to close/retry these actions if regressions occur. > > **Overview** > Simplifies the transaction replacement UX by **rendering a single `CancelSpeedupModal`** for both *speed up* and *cancel* flows in `Transactions` and `UnifiedTransactionsView`, and consolidates per-action confirm-disabled flags into a single `confirmDisabled` value. > > Refactors action handling to use one shared close/completion path (`closeSpeedUpCancelModal` / `onSpeedUpCancelCompleted`) and updates success/failure/`componentDidUpdate` cleanup to always close the unified modal; `useUnifiedTxActions` now tracks modal mode via a single `SpeedUpCancelModalState` and ensures Ledger modal confirmation callbacks always clear modal state. Tests are updated/added to validate the unified modal rendering/visibility and refresh behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8d0aa6c. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Split from #26651 to reduce CODEOWNERS fanout. Batch: confirmations Source branch: \`origin/remove-static-hex-from-tests\` When \`@metamask/design-tokens\` upgrades change color values, tests that hardcode hex literals (e.g. \`'#ffffff'\`) break because the component renders the new token value while the test still asserts the old one — even though nothing is actually wrong. This PR fixes that brittleness across the confirmations scope. **Two strategies are applied:** 1. **Replace hardcoded hex with token references** — test mocks and assertions use \`mockTheme.colors.*\` (or \`brandColor.*\` for production code) so the test always agrees with whatever the current token value is. Package upgrades no longer cause spurious failures. 2. **Add targeted \`eslint-disable\` comments** — strings like \`'#12345'\` or \`'#456'\` are NFT token IDs that happen to look like hex colors. The \`color-no-hex\` rule can't distinguish them from CSS colors, so suppress comments are added inline to keep the rule enforced everywhere else without false positives. Together these changes make the \`@metamask/design-tokens/color-no-hex\` lint rule enforceable across this scope, so future hex literals won't accidentally creep in. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** \`\`\`gherkin Feature: color-no-hex lint compliance (confirmations batch) Scenario: user runs lint Given the confirmations test files have been updated When user runs the lint checks Then no color-no-hex violations are reported \`\`\` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/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). - [ ] 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.
…lance (#27289) ## **Description** This PR adds a remote feature flag to control the "default pay token when no Perps balance" behavior introduced previously. - Added `selectPerpsDefaultPayTokenWhenNoBalanceEnabledFlag` in Perps feature flag selectors. - Gated `useDefaultPayWithTokenWhenNoPerpsBalance` behind that selector. - Kept this control as **remote-only**. - Updated Perps feature flag docs and mocks. - Added/updated unit tests for selector behavior and hook behavior when flag is disabled. ## **Changelog** CHANGELOG entry: Added a remote feature flag to control default pay token preselection when users have no Perps balance. ## **Related issues** Fixes: N/A ## **Manual testing steps** ```gherkin Feature: Perps default pay token flag Scenario: remote flag enabled Given a user has no Perps balance and has allowlisted pay tokens with balance When user opens the Perps order pay row Then the highest-balance allowlisted token is preselected Scenario: remote flag disabled Given a user has no Perps balance and has allowlisted pay tokens with balance When user opens the Perps order pay row Then no default pay token is preselected by this logic ``` ## **Screenshots/Recordings** ### **Before** N/A (logic/flagging change) ### **After** N/A (logic/flagging change) ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [ ] 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-mobile/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). - [ ] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Medium risk because it changes default payment-token preselection logic in Perps (user-facing trading/deposit flow), though behavior is fully gated by a new remote flag and covered by unit tests. > > **Overview** > Adds a new **remote-only** version-gated flag, `perpsDefaultPayTokenWhenNoBalanceEnabled`, with a selector `selectPerpsDefaultPayTokenWhenNoBalanceEnabledFlag` that defaults to *true* when missing/invalid. > > Updates `useDefaultPayWithTokenWhenNoPerpsBalance` to short-circuit to `null` when this flag is disabled, and extends mocks, docs, and unit tests to cover the new flag behavior and the hook’s disabled-flag path. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2fedf46. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- 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** This PR fixes the font sizing that was broken due to a design team update. <!-- 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? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Fix bug where token selector fonts were too big ## **Related issues** Fixes: #27328 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/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). - [ ] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk visual-only changes to `BridgeTokenSelector`/`TokenSelectorItem` typography and icon sizing with no logic, data, or flow changes. > > **Overview** > Updates the Bridge token selector UI to align with new sizing guidelines by reducing the info `ButtonIcon` from `Md` to `Sm` and dialing down token list text variants (e.g., balances and names from `BodyMD` to `BodySM`, and symbol/balance weights from `BodyMDMedium` to `BodyMD`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 684ccd6. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> Fixes `IncomingMessage.failWithAbortError` in the mockserver by safely handling aborted connections when reading request bodies. --- [Slack Thread](https://consensys.slack.com/archives/C02U025CVU4/p1773130024614199?thread_ts=1773130024.614199&cid=C02U025CVU4) <p><a href="https://cursor.com/agents/bc-f5115996-b2ea-5922-8a19-f5fa03ed7ff8"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-f5115996-b2ea-5922-8a19-f5fa03ed7ff8"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </p> <!-- CURSOR_AGENT_PR_BODY_END --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: cmd-ob <cmd-ob@users.noreply.github.com>
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> Add `build_variant` tag to Sentry performance events to distinguish between experimental and RC builds. <div><a href="https://cursor.com/agents/bc-337614a8-9173-4060-9737-eaa2b165e4f2"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-337614a8-9173-4060-9737-eaa2b165e4f2"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div> <!-- CURSOR_AGENT_PR_BODY_END --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
<!--
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**
include nfts on manual refresh
<!--
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?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: include nfts on manual refresh
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/e4e47867-490d-40a9-b22c-8dd9b6ff5239
### **After**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/ad697185-85a5-4902-80c5-f819516d66fb
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/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).
- [ ] 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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Adds an extra network/data-fetch operation to the balance refresh
path, which could affect refresh latency and controller load if the
gating conditions are misconfigured.
>
> **Overview**
> Manual wallet refresh now optionally triggers NFT discovery by
invoking `NftDetectionController.detectNfts` (with `firstPageOnly:
true`) alongside existing token/balance/rate refresh work.
>
> NFT detection is gated behind both the homepage sections v1 feature
flag and the user’s NFT detection preference (`selectUseNftDetection`),
and tests were expanded to cover the new call and gating behavior.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
accdd10. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )