[pull] main from MetaMask:main#572
Merged
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?
-->
## **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**
> Low risk workflow-only change; main risk is misconfigured `if`
conditions causing SonarCloud/Smart E2E jobs to be skipped unexpectedly
or `all-jobs-pass` to misclassify results.
>
> **Overview**
> Prevents secret-dependent CI steps from running on forked pull
requests by adding fork guards to `smart-e2e-selection`, `sonar-cloud`,
and `sonar-cloud-quality-gate-status`.
>
> Updates `all-jobs-pass` to treat `skipped` jobs as acceptable on fork
PRs (in addition to `merge_group`), so forks don’t fail required checks
when those jobs are intentionally skipped. Also simplifies the
`log-merge-group-failure` condition to run on any failing `merge_group`
event.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f89ae7c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
… take in node (#26853) <!-- 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 extends **HeaderCompactStandard** (component-library) so that **title** and **subtitle** can be either a **string** or a **React node**, while keeping existing string behavior and default typography unchanged. **Reason for change:** Callers sometimes need custom title/subtitle content (e.g. styled text, icons, or composed components). Supporting `React.ReactNode` allows that without new props; string usage continues to use the default Text variants and `titleProps` / `subtitleProps`. **What changed:** 1. **HeaderCompactStandard.types.ts** (`app/component-library/components-temp/HeaderCompactStandard/HeaderCompactStandard.types.ts`) - **title**: Type changed from `string` to `string | React.ReactNode`. JSDoc updated: when string, rendered with `TextVariant.BodyMd` and `FontWeight.Bold` and `titleProps` apply; when node, rendered as-is and `titleProps` are not applied. - **subtitle**: Type changed from `string` to `string | React.ReactNode`. JSDoc updated: when string, rendered with `TextVariant.BodySm` and `TextColor.TextAlternative` and `subtitleProps` apply; when node, rendered inside the same `-mt-0.5` container and `subtitleProps` are not applied. - **titleProps** / **subtitleProps**: JSDoc clarified that each applies only when the corresponding prop is a string. 2. **HeaderCompactStandard.tsx** (`app/component-library/components-temp/HeaderCompactStandard/HeaderCompactStandard.tsx`) - Title block: if `title` is a string, render the existing `Text` with `titleProps`; otherwise render `title` as-is. - Subtitle block: wrapped in a `Box` with `-mt-0.5`. If `subtitle` is a string, render the existing `Text` with `subtitleProps`; otherwise render `subtitle` as-is. 3. **HeaderCompactStandard.test.tsx** (`app/component-library/components-temp/HeaderCompactStandard/HeaderCompactStandard.test.tsx`) - Added: "renders title when passed as React node". - Added: "renders subtitle when passed as React node". - Added: "renders both title and subtitle as React nodes". No other components or screens are modified; only HeaderCompactStandard and its types/tests are updated. ## **Changelog** Extends HeaderCompactStandard to accept React nodes for title and subtitle in addition to strings. CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-501 ## **Manual testing steps** ```gherkin Feature: HeaderCompactStandard title/subtitle as string or node Scenario: Lint and type check pass Given the branch is checked out When the author runs yarn lint and yarn lint:tsc Then both complete without errors Scenario: HeaderCompactStandard unit tests pass Given the branch is checked out When the author runs yarn jest app/component-library/components-temp/HeaderCompactStandard/ Then all tests pass Scenario: String title and subtitle unchanged Given a screen that uses HeaderCompactStandard with string title/subtitle When the header is rendered Then title uses BodyMd Bold and subtitle uses BodySm TextAlternative as before Scenario: Custom title or subtitle as node When HeaderCompactStandard is used with title or subtitle as a React node Then the node is rendered in place (no default Text wrapper); titleProps/subtitleProps are not applied ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> Everything still functional https://github.com/user-attachments/assets/6cdec7a5-a48c-4f47-bc6f-30ffc9d5a47c ## **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** > Low risk, localized to `HeaderCompactStandard` rendering and type definitions; primary risk is minor visual/layout differences when `subtitle` is present or when nodes are passed instead of strings. > > **Overview** > `HeaderCompactStandard` now accepts `title` and `subtitle` as either strings or React nodes. When a string is provided, the component preserves the existing default typography and applies `titleProps`/`subtitleProps`; when a node is provided, it renders the node as-is (without applying those props), wrapping `subtitle` in a small spacing container. > > Unit tests were extended to cover rendering `title` and/or `subtitle` when passed as React nodes, and types/JSDoc were updated to document the new behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2b104c2. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Updated `BannerBase` default text variants to align with the typography scale update from #26842. - `DEFAULT_BANNERBASE_TITLE_TEXTVARIANT`: `BodyLGMedium` -> `BodyMDMedium` - `DEFAULT_BANNERBASE_DESCRIPTION_TEXTVARIANT`: `BodyMD` -> `BodySM` Also updated affected snapshots across banner consumers that inherit these defaults. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: BannerBase typography defaults Scenario: Banner components render with updated default text variants Given the app/component-library/components/Banners tests are available When I run `yarn jest app/component-library/components/Banners` Then all Banner unit tests pass with updated snapshots ``` ## **Screenshots/Recordings** ### **Before** N/A (snapshot-only visual baseline updates) <img width="464" height="225" alt="Screenshot 2026-03-03 at 3 37 40 PM" src="https://github.com/user-attachments/assets/9ca02b88-f80f-498e-a9af-5ba7c001298b" /> ### **After** N/A (snapshot-only visual baseline updates) <img width="439" height="167" alt="Screenshot 2026-03-03 at 3 34 51 PM" src="https://github.com/user-attachments/assets/ef0956f8-a995-45ef-b8a1-0e0bad4b99b2" /> ## **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 visual-only change: updates `BannerBase` default typography variants and refreshes Jest snapshots for affected banner renders; no functional logic or data flow changes. > > **Overview** > Updates `BannerBase` default `Text` variants so banner titles/descriptions render with smaller typography (`BodyMDMedium`/`BodySM` instead of `BodyLGMedium`/`BodyMD`). > > Refreshes Jest snapshots across banner variants and multiple banner consumers that inherit these defaults to reflect the new font sizes/line heights. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit eaec761. 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** Cache the `.metamask` folder across CI workflows to avoid re-downloading the Foundry `anvil` binary on every job, and align the caching pattern with the MetaMask Extension project. **Problem:** Every CI job that runs `yarn setup:github-ci` re-downloads the `anvil` binary from scratch via `yarn install:foundryup`. This adds unnecessary time to each job and increases network load, particularly for the many parallel E2E build and test jobs. **Solution:** Introduce a `.metamask` folder cache step (using `actions/cache@v4`) in each affected workflow, keyed on both `package.json` and `yarn.lock`: `package.json` carries the `foundryup.version` and per-platform checksums that determine which binary is downloaded; `yarn.lock` tracks the `@metamask/foundryup` npm package itself. This follows the same pattern used in the [MetaMask Extension CI](https://github.com/MetaMask/metamask-extension/blob/main/.github/workflows/main.yml). The cache step is always placed immediately before the setup step so that on a cache hit, `yarn install:foundryup` inside the setup script detects the binary is already present and skips the download. **Changes:** | File | Change | |---|---| | `.github/workflows/build-android-e2e.yml` | Add `.metamask` folder restore cache + Foundry fallback install | | `.github/workflows/build-ios-e2e.yml` | Add `.metamask` folder restore cache + Foundry fallback install | | `.github/workflows/ci.yml` | Add `.metamask` folder restore cache + Foundry fallback install | | `.github/workflows/performance-test-runner.yml` | Add `.metamask` folder restore cache + Foundry fallback install | | `.github/workflows/run-e2e-smoke-tests-android-flask.yml` | Add `.metamask` folder restore cache + Foundry fallback install; wrap `yarn setup:github-ci` in `nick-fields/retry` for resilience | | `.github/workflows/run-e2e-smoke-tests-ios-flask.yml` | Add `.metamask` folder restore cache + Foundry fallback install; wrap `yarn setup:github-ci` in `nick-fields/retry` for resilience | | `.github/workflows/setup-node-modules.yml` | Add `.metamask` folder restore cache + Foundry fallback install (conditional on `inputs.platform != ''`) | | `scripts/setup.mjs` | Skip Foundry installation when running in node-only mode (`IS_NODE` flag) to avoid errors in JS-only CI jobs | **Key design decisions (aligned with Extension):** - **Cache path**: `.metamask` (entire folder, not just `.metamask/cache`) — consistent with extension, covers any state foundryup may store alongside the download cache - **Cache key**: `.metamask-${{ hashFiles('yarn.lock') }}` — `yarn.lock` is more precise than `package.json` since it pins exact resolved versions - **Explicit fallback**: An `Install Foundry if cache missed` step runs `yarn install:foundryup` on cache miss, making the intent explicit rather than relying on setup as a side-effect - **No `restore-keys`**: The explicit fallback makes fuzzy partial-key matching unnecessary <!-- 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: Foundry installation in CI Scenario: unit-tests job skips Foundry download Given a CI run for the unit-tests job When yarn setup:github-ci --node is executed Then the Foundry installation step is skipped And no network request to GitHub releases is made Scenario: E2E build job uses cached Foundry binary Given a CI run for build-android-e2e or build-ios-e2e When the Foundry binary is already cached from a previous run Then the binary is restored from cache And no download from GitHub releases occurs ``` ## **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** > Touches multiple CI workflows and the shared setup script; misconfigured caching or conditional Foundry installs could cause widespread CI failures or missing `anvil` in some jobs. > > **Overview** > **CI now caches Foundry state** by restoring `.metamask` via `actions/cache@v4` in the main CI, E2E build/test, performance, and node-modules setup workflows, with a fallback `yarn install:foundryup` step on cache miss. > > **Setup behavior changes:** `scripts/setup.mjs` now skips the Foundry install task when running in `--node` mode, and the Flask smoke workflows wrap `yarn setup:github-ci` in `nick-fields/retry` for resilience. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 3edf305. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
#26848) <!-- 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 updates the **TitleStandard** component-library component to use **HeadingLg** instead of **DisplayMd** for the main title text. **Reason for change:** The title typography is adjusted for better hierarchy or consistency with design; `TextVariant.HeadingLg` is used for the main title instead of `TextVariant.DisplayMd`. **What changed:** 1. **TitleStandard.tsx** (`app/component-library/components-temp/TitleStandard/TitleStandard.tsx`) - Changed the title `Text` variant from `TextVariant.DisplayMd` to `TextVariant.HeadingLg`. 2. **TitleStandard.types.ts** (`app/component-library/components-temp/TitleStandard/TitleStandard.types.ts`) - Updated the JSDoc for the `title` prop to state that it is rendered with `TextVariant.HeadingLg` (was `DisplayMd`). No other files are modified; only the TitleStandard component and its types are updated. ## **Changelog** This PR is not end-user-facing; it updates typography of the TitleStandard component. CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: TitleStandard title typography Scenario: Lint and type check pass Given the branch is checked out When the author runs yarn lint and yarn lint:tsc Then both complete without errors Scenario: TitleStandard unit tests pass Given the branch is checked out When the author runs yarn jest app/component-library/components-temp/TitleStandard/ Then all tests pass Scenario: Title uses HeadingLg in app Given the app is running and a screen uses TitleStandard When the title is displayed Then the title uses HeadingLg typography (smaller than previous DisplayMd) ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> Title was rendered with `TextVariant.DisplayMd`. ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/887bfff6-2f68-4b59-aee5-c4eebf73dbcb ## **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** > Low risk visual-only typography change: `TitleStandard` titles render smaller (`HeadingLg` vs `DisplayMd`), which may affect layout/wrapping on screens using this component. > > **Overview** > Updates `TitleStandard` to render its main `title` using `TextVariant.HeadingLg` instead of `TextVariant.DisplayMd` to match updated design typography. > > Adjusts the `TitleStandardProps` JSDoc accordingly and updates the `ImportPrivateKey` snapshot to reflect the new title font sizing/line height. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5dd4dce. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…26873) ## Summary - Sports WebSocket broadcast handler now early-returns for games with no active subscribers - Only subscribed games get cached in `GameCache` and dispatched to callbacks - Prevents unbounded `GameCache` growth from broadcast messages for games the user isn't viewing ## Test plan - [x] Updated existing test to also assert `GameCache.updateGame` is not called for unsubscribed games - [x] All 82 WebSocketManager tests pass across 4 test suites <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: small refactor that only short-circuits sports message handling when there are no subscribers, plus a targeted test addition to lock in the behavior. > > **Overview** > Sports WebSocket message handling now *early-returns* when a `gameId` has no active subscribers, so **`GameCache.updateGame` and callback dispatch only happen for subscribed games**. > > Tests were updated to assert that receiving an update for an unrelated `gameId` does **not** update `GameCache`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1a24591. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Luis Taniça <matallui@gmail.com>
…26928) ## **Description** The `evm-provider-events.spec.ts` E2E tests had `testSpecificMock` blocks in tests 2 and 3 that explicitly disabled the BIP-44 feature flag (`enableMultichainAccountsState2`). This does not represent the production state where BIP-44 is enabled by default. This PR removes those mocks and updates the test flows to work with the V2 UI (`MultichainAccountPermissions` / `MultichainPermissionsSummary`): - **Test 1** — No changes needed. Already works with BIP-44 defaults. - **Test 2 (account switching)** — V2 does not support switching the active account from the connected accounts modal. Updated to switch accounts via the wallet home screen account selector (close browser → tap wallet → tap identicon → select Account 2 → navigate back to browser). - **Test 3 (network switching)** — V2 uses a permissions-based flow for network changes. Updated to open the Permissions tab, edit network permissions, and deselect Ethereum Main Network — which triggers an auto-switch to Localhost (the remaining permitted network). - Removed unused imports (`setupRemoteFeatureFlagsMock`, `remoteFeatureMultichainAccountsAccountDetailsV2`, `NetworkListModal`) - Added new imports (`NetworkConnectMultiSelector`, `TabBarComponent`, `WalletView`) ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #24143 [MMQA-1510](https://consensyssoftware.atlassian.net/browse/MMQA-1510) ## **Manual testing steps** ```gherkin Feature: EVM Provider Events E2E Tests Scenario: Tests run with BIP-44 enabled by default Given the app is built and E2E test environment is configured When the evm-provider-events smoke tests are executed Then test 1 (notify connected account on load) passes And test 2 (notify dapp on account switch) passes using wallet home account selector And test 3 (notify dapp on network change) passes using V2 permissions flow And no tests mock the BIP-44 feature flag to false ``` ## **Screenshots/Recordings** ### **Before** - Tests 2 and 3 mocked `enableMultichainAccountsState2` to `false`, bypassing BIP-44 - Test 2 switched accounts by tapping an account in the "Connected accounts" modal (V1 `tapAccountByName`) - Test 3 switched networks via `tapManagePermissionsButton` → `tapNetworksPicker` → `NetworkListModal.changeNetworkTo` (V1 flow) ### **After** - Tests 2 and 3 run with BIP-44 enabled (production default) — no feature flag mocks - Test 2 switches accounts via the wallet home screen account selector (close browser → identicon → select account → return to browser) - Test 3 switches networks via V2 permissions flow (Permissions tab → edit networks → deselect Mainnet → update triggers auto-switch to Localhost) ## **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** > Low risk: changes are limited to smoke test automation flows and imports; production code paths aren’t modified. Main risk is test brittleness due to updated UI navigation for account/network permission changes. > > **Overview** > Updates `tests/smoke/wallet/connections/evm-provider-events.spec.ts` to stop mocking the multichain/BIP-44 feature flag off, so the suite runs against the default production-like state. > > Refactors the account-switch test to switch accounts via the wallet home account selector (close browser → wallet tab → identicon → `tapAccountByNameV2`) instead of the connected-accounts modal. > > Refactors the network-change test to use the V2 permissions flow (Permissions tab → edit network permissions → toggle via `NetworkConnectMultiSelector` → update) rather than the legacy network picker/modal, and cleans up/adds page-object imports accordingly. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1d53fa5. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.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 E2E tests for the files,
e2e/specs/multichain/permissions/chains/permission-system-dapp-chain-switch-grant.spec.js
tests/smoke/multichain/permissions/chains/permission-system-initial-connection.spec.js
Fail once the BIP-44 flag is removed and currently it is being mocked to
be OFF for this test. This mock is not correct since it does not
represent the real state of the wallet in production.
The goal of this ticket is to update the test file to be compatible with
BIP-44. If the tests are not relevant anymore, they can be deleted from
the test suite. For this remove the testSpecificMock from the fixture
and check for failures in the test.
## **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**
> Low risk because changes are isolated to Detox smoke tests and
primarily adjust setup/expectations to match updated UI flows. Main risk
is increased test flakiness if the new selectors/labels vary across
builds or locales.
>
> **Overview**
> Removes the remote feature-flag mocking from the chain-permissions
smoke tests and unskips the dApp chain-switch permission test so it runs
by default.
>
> Updates test flows/assertions to match the current Connected Accounts
modal: checks for `disconnectAllAccountsAndNetworksButton` visibility
instead of the modal title/manage-permissions step, uses
select/deselect-all interactions for network permissions validation, and
updates the expected network picker label (`'E'` -> `'l E'`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5c25e60. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…ks (batch 1) (#26955) ## **Description** This PR is Card-team batch 1 of the broader effort to remove hard-coded hex colors and `@metamask/design-tokens/color-no-hex` suppressions in tests. Reason for change: - Many tests were asserting or mocking hex values directly and suppressing lint. - The migration needs to be split into smaller, codeowner-aligned PRs to reduce review overhead and risk. Improvement/solution: - Replaced local hex theme mocks with shared theme sources (`mockTheme` / design tokens) in Card-owned test files. - Removed color-rule suppressions where no longer needed. - Updated one hook test to assert config behavior without hard-coding color literals. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: DSYS-507 ## **Manual testing steps** ```gherkin Feature: Card tests use shared theme values instead of hex suppressions Scenario: developer runs the updated Card test files Given the branch `chore/color-no-hex-card-batch-1` is checked out When the developer runs the targeted Jest commands Then all updated test suites pass without introducing new color-no-hex suppressions ``` Commands run: - `yarn jest app/components/UI/Card/components/AssetSelectionBottomSheet/AssetSelectionBottomSheet.test.tsx --runInBand --watchman=false --no-coverage` - `yarn jest app/components/UI/Card/components/DaimoPayModal/DaimoPayModal.test.tsx --runInBand --watchman=false --no-coverage` - `yarn jest app/components/UI/Card/components/Onboarding/ConfirmEmail.test.tsx --runInBand --watchman=false --no-coverage` - `yarn jest app/components/UI/Card/components/Onboarding/KYCFailed.test.tsx --runInBand --watchman=false --no-coverage` - `yarn jest app/components/UI/Card/components/Onboarding/KYCPending.test.tsx --runInBand --watchman=false --no-coverage` - `yarn jest app/components/UI/Card/hooks/useCardDetailsToken.test.ts --runInBand --watchman=false --no-coverage` - `yarn jest app/components/UI/Card/hooks/useSpendingLimit.test.ts --runInBand --watchman=false --no-coverage` ## **Screenshots/Recordings** ### **Before** N/A (test-only changes) ### **After** N/A (test-only 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 - [ ] 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: changes are primarily test refactors and lint-rule scoping, plus a small styling token swap in `KYCFailed`. Main risk is inadvertent test brittleness or lint failures due to the stricter `color-no-hex` enforcement under `app/components/UI/Card`. > > **Overview** > Refactors Card-owned tests to stop hard-coding hex theme colors by switching mocks to the shared `util/theme` `mockTheme` (and design-tokens like `brandColor.white`), reducing the need for `@metamask/design-tokens/color-no-hex` suppressions. > > Tightens linting rollout by keeping `color-no-hex` disabled for tests globally but **re-enabling it for `app/components/UI/Card/**/*`**, and updates Card code/tests to comply (e.g., `KYCFailed` background now uses `brandColor.purple800`, and CSS constants for card-details/PIN token generation are exported and reused in tests). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e732ec2. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
… install cp-7.68.0 (#26952) ## **Description** **Problem:** When users tap Buy and reach Token Selection (non-V2) before geolocation and smart routing have run, the screen can show a blank or incorrect state because `detectedGeolocation` and `rampRoutingDecision` are not yet set. Previously, these ran only when the FiatOrders component mounted (e.g. when the user entered a Ramp flow), which could be too late. **Solution:** Introduce a **RampsBootstrap** component that runs at app root as soon as the app mounts: 1. **RampsBootstrap** (`app/components/UI/Ramp/RampsBootstrap.tsx`) – New component that runs three hooks at app root: - `useDetectGeolocation()` – detect user region - `useRampsSmartRouting()` – set ramp routing decision (AGGREGATOR / DEPOSIT / etc.) - `useHydrateRampsController()` – when V2 is enabled, ensure controller init/hydrate runs early 2. **App.tsx** – Mount `<RampsBootstrap />` at the root (direct import from `Ramp/RampsBootstrap`). Marked with a TODO to remove once V2 flag is on for all users. 3. **Ramp index (FiatOrders)** – Remove the three hook calls (`useDetectGeolocation`, `useRampsSmartRouting`, `useHydrateRampsController`) from `FiatOrders` so they run only once at app root in RampsBootstrap. `FiatOrders` continues to run `useFetchRampNetworks()` and order polling. By the time the user reaches Buy → Token Selection, geolocation and routing are usually already set, improving non-V2 behavior. ## **Changelog** CHANGELOG entry: Run Ramps geolocation, smart routing, and controller hydrate at app root via RampsBootstrap so Token Selection (non-V2) has region and routing ready sooner. ## **Related issues** Fixes: #26699 ## **Manual testing steps** ```gherkin Feature: Ramps bootstrap at app root Scenario: User opens app and navigates to Buy Token Selection (non-V2) Given the app has just started When the user taps Buy and reaches the Select token screen Then geolocation and smart routing have already run (bootstrap at app root) And the token list loads according to region and routing (no blank/empty due to missing geolocation) Scenario: V2 flow still works Given Ramps V2 is enabled When the user goes to Buy and Token Selection Then tokens load (Engine init plus bootstrap hydrate as before) ``` ## **Screenshots/Recordings** <div> <a href="https://www.loom.com/share/b7b90cdc4a6645719d2bae04f28c2e3d"> <p>Fix buy token loading issue - 26699 - Watch Video</p> </a> <a href="https://www.loom.com/share/b7b90cdc4a6645719d2bae04f28c2e3d"> <img style="max-width:300px;" src="https://cdn.loom.com/sessions/thumbnails/b7b90cdc4a6645719d2bae04f28c2e3d-c643ea7310eb57da-full-play.gif#t=0.1"> </a> </div> ## **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] > **Medium Risk** > Moves ramp bootstrap hooks (geolocation, smart routing, controller hydration) to run at app startup, which can affect ramp availability decisions and controller init timing across sessions. Risk is moderate due to new side effects on app mount and potential extra network calls, but changes are localized and covered by tests. > > **Overview** > Ensures ramp prerequisites are initialized *as soon as the app mounts* by introducing `RampsBootstrap`, which runs geolocation detection, smart routing, and ramps controller hydration and renders `null`. > > Mounts `RampsBootstrap` at the `App` root (with a TODO to remove once V2 is fully rolled out) and removes the same hook calls from `FiatOrders`, preventing late/duplicate initialization when users reach non-V2 Buy token selection. Adds unit tests for `RampsBootstrap` and updates existing app/ramp tests to mock the new root-level component. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0013f0e. 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 : )