[pull] main from MetaMask:main#556
Merged
Merged
Conversation
…6573) ## **Description** **Reason for the change:** This is a preparatory change for upgrading the React Navigation library to v6. With global default types now applied to the navigation API, we no longer need to apply generic types to the `useNavigation` hook in most cases. **Improvement/Solution:** - Removed generic types from `useNavigation` hook invocations (now uses default global navigation types) - Applied `NavigationProp<NavigatableRootParamList>` where deeply nested navigation is required - Part of a series of PRs splitting the cleanup by codebase ownership **Note on exceptions:** Generic types may still be needed when navigating to deeper nested stacks. For those instances, we apply a recursive navigation type pattern. **References:** - Parent issue: #23763 - React Navigation nesting docs: https://reactnavigation.org/docs/nesting-navigators/ ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #23763 (partial) ## **Manual testing steps** ```gherkin Feature: Navigation functionality after useNavigation cleanup Scenario: Rewards navigation works correctly Given the app is running And the rewards controller is active When rewards-related navigation occurs Then the navigation should complete successfully And no TypeScript errors should occur ``` **Additional verification:** - Run `yarn lint:tsc` to verify no TypeScript errors are introduced - Run unit tests for affected components ## **Screenshots/Recordings** N/A - No visual changes (internal refactoring/type cleanup) ## **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. Made with [Cursor](https://cursor.com) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Type-only/refactor change with no behavioral change intended; risk is limited to potential incorrect casting assumptions if non-`InternalAccount` objects reach `performSilentAuth`. > > **Overview** > Adjusts rewards silent-auth account handling to be more tolerant of mixed account types returned by the account tree by adding explicit `InternalAccount` casts when calling `performSilentAuth` and selecting the active account. > > Refactors `sortAccounts` to be generic over a minimal `type`/`address` shape (instead of requiring `InternalAccount`), improving compatibility across different account representations while preserving the same EIP-155-first sorting behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6ce9b51. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
…es (#26572) ## **Description** **Reason for the change:** This is a preparatory change for upgrading the React Navigation library to v6. With global default types now applied to the navigation API, we no longer need to apply generic types to the `useNavigation` hook in most cases. **Improvement/Solution:** - Removed generic types from `useNavigation` hook invocations (now uses default global navigation types) - Applied `NavigationProp<NavigatableRootParamList>` where deeply nested navigation is required - Part of a series of PRs splitting the cleanup by codebase ownership **Note on exceptions:** Generic types may still be needed when navigating to deeper nested stacks. For those instances, we apply a recursive navigation type pattern. **References:** - Parent issue: #23763 - React Navigation nesting docs: https://reactnavigation.org/docs/nesting-navigators/ ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #23763 (partial) ## **Manual testing steps** ```gherkin Feature: Navigation functionality after useNavigation cleanup Scenario: Confirmations navigation works correctly Given the app is running And the user is viewing confirmations When user navigates through confirmation flows Then the navigation should complete successfully And no TypeScript errors should occur ``` **Additional verification:** - Run `yarn lint:tsc` to verify no TypeScript errors are introduced - Run unit tests for affected components ## **Screenshots/Recordings** N/A - No visual changes (internal refactoring/type cleanup) ## **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. Made with [Cursor](https://cursor.com) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Type-only refactor with no behavioral changes; risk is limited to potential TypeScript/navigation typing mismatches causing build errors. > > **Overview** > Updates confirmations UI hooks to rely on default `useNavigation` typing instead of `StakeNavigationParamsList` generics, as prep for a React Navigation v6 upgrade. > > `useClearConfirmationOnBackSwipe` now types navigation against `RootStackParamList`, while `useNavbar`/`useModalNavbar` drop the explicit `StackNavigationProp` generic and use `useNavigation()` directly; runtime behavior is unchanged. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 4db9c6d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor <cursoragent@cursor.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** The second of three PRs for mUSD Quick Convert. This includes all changes except the actual "Max Convert" bottom sheet confirmation (e.g. Quick Convert List) <!-- 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: The second of three PRs for mUSD Quick Convert. This includes all changes except the actual "Max Convert" bottom sheet confirmation. ## **Related issues** Fixes: - [MUSD-150: Quick convert proof of concept](https://consensyssoftware.atlassian.net/browse/MUSD-150) - [MUSD-358: Convert Max should be in sentence case](https://consensyssoftware.atlassian.net/browse/MUSD-358) - [MUSD-367: Empty "Your mUSD" balance rendered on QuickConvert view when user doesn't have any mUSD](https://consensyssoftware.atlassian.net/browse/MUSD-367) - [MUSD-315: Education screen not displayed before navigating to quick convert screen](https://consensyssoftware.atlassian.net/browse/MUSD-315) - [MUSD-321: Error conversion failed persists across app restarts for an account after attempting to quick convert](https://consensyssoftware.atlassian.net/browse/MUSD-321) - [MUSD-351: Quick Convert - Replace Aggregated mUSD balance with Single Row per mUSD Balance](https://consensyssoftware.atlassian.net/browse/MUSD-351) - [MUSD-354: Add "Rate" Row to Max Convert Bottom Sheet](https://consensyssoftware.atlassian.net/browse/MUSD-354) - [MUSD-353: Update Max Convert Bottom Sheet Asset Header](https://consensyssoftware.atlassian.net/browse/MUSD-353) ## **Manual testing steps** ```gherkin Feature: Quick Convert List Scenario: user wants to quickly convert their stablecoins to mUSD Given user has is on home screen When user clicks any mUSD conversion entry point Then user is redirected to the quick convert list ``` **Note: This PR doesn't include the Max Convert Bottom Sheet. Clicking "Max" causes a crash. This is expected.** ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> N/A - Quick Convert List didn't exist. ### **After** <!-- [screenshots/recordings] --> <img width="505" height="1021" alt="image" src="https://github.com/user-attachments/assets/27559909-3c41-474d-b1cf-a4d2db484565" /> ## **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** > Touches conversion transaction creation/navigation and post-creation pay-with configuration (including automatic rejection paths), so regressions could affect mUSD conversion flow and confirmations; changes are feature-flagged but span multiple entrypoints and analytics. > > **Overview** > Adds the **mUSD Quick Convert** list screen (gated by `MM_MUSD_QUICK_CONVERT_ENABLED` + remote flag), including new UI components (`MusdQuickConvertView`, `ConvertTokenRow`, `MusdBalanceCard`) that show convertible tokens with **Max**/**Edit** actions, disables actions when conversions are in-flight, and links to Terms of Use. > > Refactors the conversion entrypoints to route through `useMusdConversion`’s new APIs: `initiateCustomConversion` (supports a `navigationOverride` that can redirect to Quick Convert) and `initiateMaxConversion` (creates a max-balance transaction, configures pay-with token via `TransactionPayController`, fetches gas estimates, and rejects the tx on post-creation config failure). Updates education + CTA flows and MetaMetrics `redirects_to` values to account for Quick Convert, and enhances `useMusdBalance` to return per-chain + aggregated token/fiat balances (Mainnet/Linea only) with formatted display values. > > Also updates mUSD display metadata (`mUSD` / `MetaMask USD`) and makes minor Earn avatar style tweaks that update snapshots. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 4999c37. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Signed-off-by: Matthew Grainger <matthew.grainger@consensys.net>
## **Description** **Reason for the change:** This is a preparatory change for upgrading the React Navigation library to v6. With global default types now applied to the navigation API, we no longer need to apply generic types to the `useNavigation` hook in most cases. **Improvement/Solution:** - Removed generic types from `useNavigation` hook invocations (now uses default global navigation types) - Applied `NavigationProp<NavigatableRootParamList>` where deeply nested navigation is required - Part of a series of PRs splitting the cleanup by codebase ownership **Note on exceptions:** Generic types may still be needed when navigating to deeper nested stacks. For those instances, we apply a recursive navigation type pattern. **References:** - Parent issue: #23763 - React Navigation nesting docs: https://reactnavigation.org/docs/nesting-navigators/ ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #23763 (partial) ## **Manual testing steps** ```gherkin Feature: Navigation functionality after useNavigation cleanup Scenario: Perps navigation works correctly Given the app is running And the user is on the Perps section When user navigates to any Perps screen Then the navigation should complete successfully And no TypeScript errors should occur ``` **Additional verification:** - Run `yarn lint:tsc` to verify no TypeScript errors are introduced - Run unit tests for affected components ## **Screenshots/Recordings** N/A - No visual changes (internal refactoring/type cleanup) ## **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. Made with [Cursor](https://cursor.com) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Primarily TypeScript/type and test refactors with minimal runtime impact; main risk is any missed navigation typing that could hide compile-time errors until later. > > **Overview** > Removes most explicit `useNavigation<NavigationProp<...>>` typings across Perps views/components/hooks and relies on React Navigation’s global default types, cleaning up imports and dropping unused `PerpsNavigationParamList` references where no longer needed. > > Updates Perps unit tests (notably `PerpsFundingTransactionView.test.tsx` and `PerpsMarketTypeSection.test.tsx`) to use `renderWithProvider` with a minimal Redux `initialState`, simplify navigation/route mocking, and trim overly broad assertion coverage. > > Fixes a Perps controller typing edge in `findEvmAccount` by explicitly casting `account.type` to `InternalAccount['type']` before passing it to `isEvmAccountType` (plus minor import ordering cleanup). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2238fe6. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
…26486) <!-- 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** **Reason for the change:** The `NetworkSelector` component was using the `useRoute()` hook internally to access route parameters. This approach has several drawbacks: - Tightly couples the component to the navigation context - Makes type derivation less explicit - Reduces testability as tests need to mock the navigation context **Improvement/Solution:** - Refactored `NetworkSelector` to receive `route` as a prop instead of calling `useRoute()` internally - This enables better TypeScript type inference from the `RootStackParamList` - Extracted `infuraNetwork` and `ShowConfirmDeleteModalState` interfaces to a separate `types.ts` file for better code organization - Extended `NetworkSelectorParams` in `NetworkSelector.types.ts` with missing route parameters (`chainId`, `hostInfo`, `source`) - Updated tests to properly pass the `route` prop ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: N/A (internal refactoring) ## **Manual testing steps** ```gherkin Feature: Network Selector Scenario: User opens network selector from wallet Given the user is on the wallet home screen When user taps the network selector button Then the network selector bottom sheet should open And user should see the list of available networks Scenario: User opens network selector from dApp browser Given the user is connected to a dApp When user taps the network selector in the browser Then the network selector bottom sheet should open And the current network should be highlighted ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** N/A - No visual changes ### **After** N/A - No visual changes ## **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] > **Low Risk** > Pure refactor and type-safety changes with minimal behavioral impact; primary risk is missed callers/tests that now must pass the `route` prop. > > **Overview** > Refactors `NetworkSelector` to take a typed `route` prop (derived from `RootStackParamList`) instead of calling `useRoute()` internally, and updates all route param accesses accordingly. > > Improves typing of navigation params by extending `NetworkSelectorParams` with `chainId`, `hostInfo`, and `source`, and extracts `infuraNetwork`/`ShowConfirmDeleteModalState` interfaces into a new local `types.ts`. > > Updates `NetworkSelector` tests to pass a mock `route` prop when rendering the component. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit fcabec9. 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**
- Fix nested retry timeout mismatch in `TabBarComponent` where inner
`expectElementToBeVisible` (15s default) exceeded the outer
`executeWithRetry` timeout (10s), causing the outer loop to get only 1
attempt
- Both `tapWallet` and `tapActivity` now use fast-fail inner operations
(2s timeout) with outer retry control (`maxRetries: 30`)
Example with tapActivity:
executeWithRetry(maxRetries: 30) ← OUTER: retries up to 30 times
├─ waitAndTap(timeout: 2000ms) ← INNER: waits 2s for tap, fails fast if
blocked
└─ expectElementToBeVisible(timeout: 2000ms) ← INNER: waits 2s for
title, fails fast if not visible
Per attempt: ~4s max (2s tap + 2s assertion). If either fails, control
returns to the outer loop which retries the whole sequence. Total
budget: ~2 min (30 attempts x ~4s).
<!--
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:
## **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] -->
### **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**
> Changes are limited to Detox test page objects and smoke specs; main
risk is altering retry/timing behavior which could affect test stability
(better or worse) but not production code.
>
> **Overview**
> Improves Detox tab-bar navigation reliability by making `tapWallet`,
`tapActivity`, `tapExploreButton`, and `tapRewards` **fast-fail per
attempt** (short tap/visibility timeouts) while shifting control to an
outer `executeWithRetry` loop with explicit `maxRetries` and a larger
overall timeout budget.
>
> Simplifies `tapSettings` to navigate via the Wallet tab and hamburger
menu directly (instead of calling `tapWallet`) and increases its retry
timeout. Updates the mUSD conversion smoke tests to use the new
`tapWallet()`/`tapActivity()` signatures (removing per-call timeout
overrides).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f86844b. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…er placement (#26432) <!-- 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** 1. **What is the reason for the change?** During Perps order placement, users only saw an "Order submitted" toast after the order was sent. There was no feedback while the order was in flight, which could make it unclear that the app was still working. 2. **What is the improvement/solution?** - Show a **persistent** "Submitting your trade" toast as soon as the user confirms the order. It stays visible until the order completes (success or failure). - Remove the separate "Order submitted" toast; success/error is still communicated by the existing confirmed/creationFailed toasts. - The new toast has `hasNoTimeout`, a loading icon, and a close button so users can dismiss it manually if they want. - Implemented via a new `orderManagement.shared.submitting()` option in `usePerpsToasts`, used in `PerpsOrderView` before calling the order execution hook. ## **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: Added a persistent "Submitting your trade" toast during Perps order placement so users see clear feedback while the order is processing. ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2570 ## **Manual testing steps** ```gherkin Feature: Perps order placement toast Scenario: user sees persistent "Submitting your trade" toast while order is in flight Given the user is on the Perps order view and has valid order inputs When the user taps to place the order (market or limit) Then a "Submitting your trade" toast appears immediately with a loading icon and close button And the toast remains visible until the order completes (no auto-dismiss) And the user can dismiss it manually via the close button And on success, the existing "Order filled" / "Order placed" toast is shown; on failure, the error toast is shown ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/8b7f0b1c-cb05-4fcf-bf90-8aa8347aa275 ## **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] > **Low Risk** > Primarily UI/UX toast behavior changes around order submission with corresponding test and i18n updates; no changes to order execution semantics beyond when toasts are shown. > > **Overview** > Perps order placement now shows a **persistent** `Submitting your trade` toast immediately when the user places an order, providing in-flight feedback until the order resolves. > > This removes the prior `onSubmitted`-triggered `Order submitted` toast from `usePerpsOrderExecution` usage, and introduces a new `PerpsToastOptions.orderManagement.shared.submitting()` toast option (no timeout, loading icon, manual dismiss via close button). Tests and English locale strings were updated accordingly. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f2f044f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
## **Description** Phase 3 analytics migration (Batch 3-5): migrate In App Browser's Browser view, BrowserUrlBar, and BrowserBottomBar components from `useMetrics` to the new analytics system. **Reason**: Deprecate MetaMetrics in favour of the shared analytics utility and AnalyticsController. **Changes**: Browser `index.js`, `BrowserUrlBar.tsx`, and `BrowserBottomBar/index.tsx` now use `useAnalytics` from `app/components/hooks/useAnalytics/useAnalytics` instead of `useMetrics`; `MetaMetricsEvents` import remains from `app/core/Analytics`. Test mocks updated across 7 test files to mock `useAnalytics` instead of `useMetrics`. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-301 (Batch 3-5) ## **Manual testing steps** ```gherkin Feature: In App Browser analytics Scenario: user triggers an in app browser flow event Given app is open and user is in the in-app browser When user performs an action that triggers analytics (e.g. switch tab, navigate back/forward, bookmark a page, open new tab) Then the event is tracked on Mixpanel ``` ## **Screenshots/Recordings** N/A – analytics migration, no UI 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 - [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] > **Low Risk** > Primarily a hook migration and test mock updates; behavior change is limited to adding extra analytics event properties in the browser favorites flow. > > **Overview** > Migrates the in-app browser (`Browser`, `BrowserUrlBar`, `BrowserBottomBar`) from `useMetrics` to the new `useAnalytics` hook, updating all related unit tests to mock the new hook path. > > Adjusts `BrowserBottomBar` analytics by adding properties to the `MetaMetricsEvents.DAPP_ADD_TO_FAVORITE` event (and adds a focused test asserting both favorites events include the expected properties). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f97f8ce. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Phase 3 analytics migration (Batch 3-7): migrate Payment Request's `PaymentRequest` class component from `withMetricsAwareness` HOC to the new analytics system. **Reason**: Deprecate MetaMetrics in favour of the shared analytics utility and AnalyticsController. **Changes**: `PaymentRequest/index.js` now uses `analytics.trackEvent()` and `AnalyticsEventBuilder` from `app/util/analytics` directly instead of the `withMetricsAwareness` HOC; test mocks updated to mock the analytics utility instead of MetaMetrics. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-301 (Batch 3-7) ## **Manual testing steps** ```gherkin Feature: Payment Request analytics Scenario: user triggers a payment request flow event Given app is open and user is in a payment request flow When user performs an action that triggers analytics (e.g. network selector press) Then the event is tracked on Mixpanel ``` ## **Screenshots/Recordings** N/A – analytics migration, no UI 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 - [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] > **Low Risk** > Analytics plumbing is swapped from `withMetricsAwareness` to the shared `analytics` utility with minimal behavioral change and no sensitive data handling. > > **Overview** > Migrates `PaymentRequest` analytics from the deprecated `withMetricsAwareness`/MetaMetrics injection to the shared `analytics.trackEvent()` + `AnalyticsEventBuilder` flow when the network picker is pressed, preserving the `chain_id` property. > > Removes the `metrics` prop/HOC wrapper and updates tests to mock the new analytics module (plus a small TypeScript cast workaround for the connected `.js` component). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 89e949b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Phase 3 analytics migration (Batch 3-8): migrate Account Backup/Recovery components from `useMetrics` to the new analytics system (`useAnalytics`). **Reason**: Deprecate MetaMetrics in favour of the shared analytics utility and AnalyticsController. **Changes**: `SRPListItem`, `SRPList`, `SRPQuiz`, `ManualBackupStep1`, and `ManualBackupStep2` now use `useAnalytics` from `app/components/hooks/useAnalytics/useAnalytics` instead of `useMetrics`; test mocks updated to mock `useAnalytics` instead of `useMetrics`. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-301 (Batch 3-8) ## **Manual testing steps** ```gherkin Feature: Account Backup/Recovery analytics Scenario: user triggers an account backup/recovery flow event Given app is open and user is in an account backup/recovery flow When user performs an action that triggers analytics (e.g. SRP picker selection, SRP quiz progression, seed phrase reveal) Then the event is tracked on Mixpanel ``` ## **Screenshots/Recordings** N/A – analytics migration, no UI 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 - [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] > **Low Risk** > Primarily a hook migration from `useMetrics` to `useAnalytics` with no functional flow changes; risk is limited to potential missing/incorrect analytics wiring due to API/mocking differences. > > **Overview** > Migrates SRP backup/recovery UI surfaces (`SRPList`, `SRPListItem`, `ManualBackupStep1`, `ManualBackupStep2`, and `SRPQuiz`) from the deprecated `useMetrics` hook to the new `useAnalytics` hook while keeping existing event names/properties and event-builder usage. > > Updates the associated Jest tests to mock `useAnalytics` instead of `useMetrics`, including adjusting mocked IDs (`getMetaMetricsId` `getAnalyticsId`) and providing a compatible `createEventBuilder` mock shape where needed. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 988af76. 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** Adds Sentry performance tracing to Market Insights to measure load times for two key user flows: MarketInsightsEntryCardLoad — Measures the time from when a token details page starts rendering to when the Market Insights entry card mounts. Uses the asset's CAIP-19 ID as the trace id so rapid token switching doesn't cause trace collisions. MarketInsightsViewLoad — Measures the time from when the user taps the entry card to when the full Market Insights view renders with report data. Includes an unmount cleanup to end the trace if the user navigates away before the report loads. Both traces use a new TraceOperation.MarketInsightsLoad (market_insights.load) operation for easy filtering in Sentry. ## **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: ## **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 - [ ] 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 instrumentation-only change, but it touches token details rendering and navigation flows and could create noisy traces if the start/end pairing is missed in edge cases. > > **Overview** > Adds two new Sentry traces for Market Insights load performance: `MarketInsightsEntryCardLoad` (token details render -> entry card mount) and `MarketInsightsViewLoad` (entry card tap -> report displayed). > > Starts traces from `AssetOverviewContent` using a new `TraceOperation.MarketInsightsLoad`, passes `caip19Id` into `MarketInsightsEntryCard` to end the matching trace on mount, and ends the view-load trace in `MarketInsightsView` once report data is available. Updates the entry card prop types and tests to include the required `caip19Id`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8f6ebb8. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Fixes the Buy button not being vertically centered in the `PopularTokenRow` component on the Homepage Tokens section (zero balance state). The issue was caused by a fixed `h-16` (64px) height on the row container. When the content (e.g., mUSD description) wrapped to multiple lines, the button stayed top-aligned instead of centering. **Changes:** - Replace fixed `h-16` height with `py-2` padding so rows grow naturally with content - Wrap the Buy button in a `self-center` Box to ensure vertical centering regardless of row height ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: https://consensyssoftware.atlassian.net/browse/TMCU-407 ## **Manual testing steps** ```gherkin Feature: Buy button vertical centering in PopularTokenRow Scenario: Buy button is vertically centered on single-line rows Given user has a zero balance account And user is on the Homepage When user views the Tokens section Then each Buy button is vertically centered with the token name and price Scenario: Buy button is vertically centered on multi-line rows Given user has a zero balance account And mUSD row has a multi-line description When user views the Tokens section Then the Buy button on the mUSD row is vertically centered with the content ``` ## **Screenshots/Recordings** ### **Before** <!-- Buy button top-aligned on multi-line rows --> ### **After** <!-- Buy button vertically centered on all rows --> ## **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 - [ ] 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 UI-only layout tweak: replaces a fixed row height with padding and adjusts Buy button container alignment, which could slightly affect row spacing/height but has no data or logic impact. > > **Overview** > Fixes vertical alignment issues in `PopularTokenRow` when token details wrap to multiple lines. > > The row layout now uses `py-2` instead of a fixed `h-16` height so it can grow with content, and the Buy button is wrapped in a `self-center` container to keep it vertically centered regardless of row height. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d1952a3. 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** We are removing the locale territory (e.g. 'en-US', 'en-GB') so we can have a unified currency experience. Will need to sync with the ramps team who are using these shared utils. I've also added a small test harness to prevent this regression in the future. ## **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: formatting remove territory for unified formatting ## **Related issues** Fixes: #26428 https://consensyssoftware.atlassian.net/browse/ASSETS-2767 ## **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** <img width="441" height="950" alt="Screenshot 2026-02-26 at 10 53 56" src="https://github.com/user-attachments/assets/6229d6f2-f018-4e3f-95cd-2789d85904ae" /> ### **After** <img width="811" height="940" alt="Screenshot 2026-02-26 at 12 08 56" src="https://github.com/user-attachments/assets/78dc2765-4ebf-48d0-853b-eab998ecf5e2" /> ## **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 locale handling for all callers of `useFormatters`, which can affect currency/number formatting across the app; impact is broad but the logic change is small and covered by a new regression test. > > **Overview** > Forces `useFormatters` to *drop the locale territory* (e.g., `en-US` -> `en`) before creating formatters, to unify currency formatting output. > > Adds a hook test that mocks `I18n.locale` across several English locales and asserts `formatCurrency` for USD uses the `$` prefix (and never `US$`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6e0cf30. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
#26083) Added component view tests for Perps section on increase coverage <!-- 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** ## Summary Improves Perps component-view flow tests: less duplication, faster runs, and more components covered. ## Changes ### 1. i18n strings as variables (no hardcoded keys) - **PerpsOrderLifecycleFlow**: `ORDER_TYPE_TITLE`, `ORDER_TYPE_MARKET`, `ORDER_TYPE_LIMIT`, `QUOTE_NETWORK_FEE`, `QUOTE_ESTIMATED_TIME`, `QUOTE_RATE`, `DONE_BUTTON`, `LIQUIDATION_PRICE` in `beforeAll`. - **PerpsPortfolioFlow**: `SEE_ALL_PERPS`, `POSITIONS`, `ACCOUNT_SUMMARY_TITLE`, `EMPTY_TITLE`, `FIRST_TIME_DESCRIPTION`, `ADD_MARGIN`, `REDUCE_MARGIN`. - **PerpsActiveTraderFlow**: `MARKET_ORDERS`, `LEVERAGE_MODAL_TITLE`, `LIMIT_PRICE_MODAL_TITLE`, `LIMIT_PRICE_MID`, `LIMIT_PRICE_BID`, `CLOSE_ALL_TITLE`, `CANCEL_ALL_TITLE`, `ADJUST_MARGIN_TITLE`, `ADD_MARGIN`, `REDUCE_MARGIN`. - **PerpsErrorsAndInfoFlow**: `CONNECTION_FAILED_TITLE`, `CONNECTION_FAILED_RETRY`, `CONNECTION_FAILED_GO_BACK`, `GOT_IT_BUTTON`. - **PerpsMarketAndRiskFlow**: `NOTIFICATIONS_TITLE`, `SORT_SORT_BY`, `SORT_APPLY`. All of these are set once in `beforeAll` and reused in the tests instead of repeating `strings('perps....')`. ### 2. Test execution speed - **PerpsOrderLifecycleFlow**: `TIMEOUT_MS = 3000`; all `findBy*` use it instead of 10s/5s so failures are detected sooner. - **PerpsPortfolioFlow**: One `findBy*` per phase (with `TIMEOUT_MS`), then `getBy*` for the rest to avoid extra async waits. ### 3. New coverage in existing flow tests **PerpsOrderLifecycleFlow** - **Phase 13 – PerpsTransactionsView**: Renders Activity, asserts Trades/Orders/Funding/Deposits tabs and tab switching. - **Phase 14 – PerpsSelectOrderTypeView**: Renders order type view (route + params), asserts title, Market/Limit options, and Limit press. **PerpsMarketAndRiskFlow** - **Phase 8 – PerpsMarketSortFieldBottomSheet**: Renders sort sheet, asserts "Sort by" and "Apply", selects Volume and Apply, asserts `onOptionSelect`. - **Phase 9 – PerpsTransactionItem**: Renders item with sample transaction, asserts testID, title/subtitle, and `onPress` with transaction. - **Phase 10 – TradingViewChart**: Renders chart with `candleData: null`, asserts container testID. - **Phase 11 – PerpsNotificationTooltip**: Renders with `orderSuccess={false}`, asserts notification sheet title is not shown. ### 4. Components covered by these flows - **OrderLifecycleFlow**: PerpsClosePositionView, PerpsOrderBookView, PerpsOrderDetailsView, PerpsHeroCardView, PerpsWithdrawView, PerpsSelectProviderView, PerpsOrderTypeBottomSheet, PerpsQuoteDetailsCard, PerpsQuoteExpiredModal, PerpsAdjustMarginView, **PerpsTransactionsView**, **PerpsSelectOrderTypeView**. - **MarketAndRiskFlow**: PerpsLoader, LivePriceDisplay, PerpsMarketRowItem, PerpsMarketTradesList, PerpsStopLossPromptBanner, PerpsNotificationBottomSheet, PerpsTransactionDetailAssetHero, **PerpsMarketSortFieldBottomSheet**, **PerpsTransactionItem**, **TradingViewChart**, **PerpsNotificationTooltip**. ## Testing - Run flow tests: `yarn jest PerpsOrderLifecycleFlow.view.test PerpsMarketAndRiskFlow.view.test PerpsPortfolioFlow.view.test PerpsActiveTraderFlow.view.test PerpsErrorsAndInfoFlow.view.test --no-coverage` <!-- 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: ## **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] --> ### **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] > **Medium Risk** > Mostly adds/updates view tests, but it also changes shared Jest view-test setup and core Engine/controller mocks, which could affect many tests and introduce CI flakiness. > > **Overview** > Adds several new Perps *E2E-like* component-view flow tests covering trading (tabs/orders/modify/flip/leverage/limit/cross-margin), errors+info (connection recovery, tooltips, badges, fill tags), market+risk (loaders, market rows, stop-loss prompts, notifications, sorting, transactions, chart), order lifecycle (provider switching, order type, quotes, adjust margin, activity tabs), portfolio (tab/home/positions/geo-block/empty states), plus new standalone tests for `PerpsTPSLView` and `PerpsTransactionsView`. > > Expands the Perps view-test harness (`perpsViewRenderer`) with many new render helpers, default fixtures, order stream overrides, and a `topOfBook` channel shim; updates shared test setup/mocks (`testSetupView.js`, component-view `mocks.ts`, `perpsStatePreset`) to stub additional React Native propTypes, Engine controller methods/state, and missing Redux slices; removes older narrower view tests now covered by the flow suites and tweaks a single onboarding perf timer threshold. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 94bd6ef. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
## **Description** Upgrades \`@metamask/design-system-react-native\` from \`^0.7.0\` to \`^0.8.0\` (design system monorepo [v21.0.0](https://github.com/MetaMask/metamask-design-system/releases/tag/v21.0.0)) and marks the legacy \`RadioButton\` component as deprecated. This also updates the transitive dependency \`@metamask/design-system-shared\` from \`0.1.3\` → \`0.2.0\`. **What's new in 0.8.0:** - Added \`RadioButton\` component (checked, disabled, read-only, and danger states; full accessibility support) - \`BadgeStatus\` migrated from TypeScript enums to string union types — no migration required, enum constants still work - \`BottomSheetFooter\` refactored to top-level location — no import changes needed for package entry point consumers **Deprecation:** - Added \`@deprecated\` JSDoc tag to the legacy \`app/component-library\` \`RadioButton\` component, pointing consumers to \`RadioButton\` from \`@metamask/design-system-react-native\` ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** \`\`\`gherkin Feature: design system upgrade Scenario: app builds and runs normally after upgrade Given the app is built with the updated dependency When user navigates through the app Then existing components render correctly with no regressions \`\`\` ## **Screenshots/Recordings** ### **After** General smoke test to make sure mobile loads https://github.com/user-attachments/assets/7e2f0181-a01a-4775-9a2d-cb290f5e24ab ## **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] > **Low Risk** > Dependency bump plus a doc-only deprecation annotation; no functional code paths are changed in this repo beyond updated package resolution. > > **Overview** > Upgrades `@metamask/design-system-react-native` from `^0.7.0` to `^0.8.0` (and updates the lockfile, including `@metamask/design-system-shared` to `^0.2.0`). > > Marks the legacy `app/component-library` `RadioButton` component as **deprecated** via JSDoc, directing consumers to migrate to the design-system `RadioButton` and linking to its docs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f79730b. 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**
## Summary
The **Performance E2E Tests for Experimental Builds** workflow was
failing because the Android APK artifact matching was hardcoded to look
for `metamask-main-rc-*.apk`, which doesn't match experimental builds
that produce `metamask-main-exp-*.apk`. This caused the BrowserStack URL
to be empty, making all downstream Android test jobs fail with `"No
android BrowserStack URL available"`.
## Root Cause
Two issues in the CI workflow:
1. **Hardcoded APK name pattern**
(`build-android-upload-to-browserstack.yml`): The jq filter used
`metamask-main-rc-[0-9]+\.apk` to locate the APK artifact from Bitrise.
When the experimental workflow passes `build_variant: exp`, Bitrise runs
`build_android_main_exp` which produces APKs named
`metamask-main-exp-*.apk` — the regex never matched them.
2. **Weak `if` conditions** (`run-performance-e2e.yml`): Test jobs used
`needs.trigger-android-dual-versions.result == 'success'` to decide
whether to run, but this evaluates to `true` even when the build job
"succeeded" without actually producing a BrowserStack URL (e.g., when
the artifact wasn't found but the step didn't exit with an error).
## Changes
### `build-android-upload-to-browserstack.yml`
- Made the APK name regex dynamic using `inputs.build_variant` (defaults
to `rc`), so it matches `metamask-main-rc-*.apk` for release builds and
`metamask-main-exp-*.apk` for experimental builds.
- Added `exit 1` when APK artifact is not found or build ID is
unavailable (previously these were silent warnings).
- Added debug logging to print the APK pattern being searched for.
### `run-performance-e2e.yml`
- Replaced loose `if` conditions with explicit checks that the actual
BrowserStack URL output is non-empty (e.g.,
`needs.trigger-android-dual-versions.outputs.without-srp-browserstack-url
!= ''`).
- Added `!cancelled()` guard to imported-wallet and mm-connect test jobs
for consistency.
## Note
The iOS workflow (`build-ios-upload-to-browserstack.yml`) was **not
affected** — its regex `metamask-device-main-[a-zA-Z0-9-]+-[0-9]+\.ipa`
already accommodates any variant.
<!--
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:
## **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] -->
### **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]
> **Medium Risk**
> Workflow logic changes can alter when performance jobs run and when
the BrowserStack upload step fails, potentially causing unexpected CI
skips or failures. Scope is limited to GitHub Actions/Bitrise artifact
handling, not app runtime code.
>
> **Overview**
> Fixes Android BrowserStack uploads for experimental builds by making
the Bitrise artifact match pattern depend on `inputs.build_variant`
(e.g., `metamask-main-exp-*` vs `metamask-main-rc-*`), and improves
error handling so the step records per-APK failures and only fails if
*both* uploads fail.
>
> Tightens `run-performance-e2e.yml` job `if` conditions to gate
onboarding/imported-wallet/mm-connect runs on *non-empty* BrowserStack
URL outputs (or explicitly provided inputs), and adds `!cancelled()`
guards for consistency.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
af1ab7f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…#26590) <!-- 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** Patch for the core fix: MetaMask/core#8044 https://consensyssoftware.atlassian.net/browse/ASSETS-2796 ## **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: AccountsApiBalanceFetcher stricter zero out conditions ## **Related issues** Fixes: MetaMask/metamask-extension#40324 (this issue also happens on mobile!) #26618 ## **Manual testing steps** 1. Add avalanche and have avalanche tokens 2. Select avalanche only in the network picker - EXPECTED: see avalanche erc-20 balances 3. Select popular networks in the network picket - EXPECTED: see avalanche erc-20 balances ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://www.loom.com/share/d6e472d2ab444205acdad64507f43eed ## **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** > Touches cross-chain balance fetching behavior via a patched dependency; incorrect gating could still cause missing/incorrect displayed balances for some network selections. Dependency patching adds some upgrade/maintenance risk but is scoped to a small conditional change. > > **Overview** > Updates `@metamask/assets-controllers` via a Yarn patch to tighten when missing balances are backfilled as zero in `AccountsApiBalanceFetcher`. > > Zero-value native and ERC-20 balances are now only synthesized when the chain was *explicitly requested* (`chainIds.includes(chainId)`) and is *supported* (`supports(chainId)`), avoiding unintended zeroing for other chains. The app’s dependency wiring is updated (`package.json` + `yarn.lock`) to use the patched `@metamask/assets-controllers@100.0.3`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c3c5058. 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**
The purpose of this PR is to clean up and restructure the mock responses
for ramps
## **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:
## **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]
> **Medium Risk**
> Test-only change, but it rewires the on-ramp E2E mocking layer and
alters mocked quote/checkout/order-polling behavior, so it could cause
widespread test flakiness or failures if any endpoints/patterns don’t
match real calls.
>
> **Overview**
> Refactors the ramps/on-ramp E2E mocks into **modular, region-aware
helpers** and splits the previously monolithic `ramps-mocks.ts` data
into dedicated `ramps/responses/*` fixtures.
>
> The new `setupRegionAwareOnRampMocks` now composes mocks for
geolocation/eligibility, catalog endpoints, quote polling, checkout (buy
+ callback), token icon assets, and a **stateful order-status** endpoint
that transitions `PENDING` → `COMPLETED` during polling.
>
> Updates default mocks and multiple ramps smoke/regression specs (and
cardholder mocks) to import the new response modules and to use
`setupRegionAwareOnRampMocks` from `ramps-mocks`, while removing the old
`ramps-region-aware-mock-setup.ts` and the oversized quotes fixture in
favor of a **single-quote** response.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
160bb1f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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 : )