Skip to content

[pull] main from MetaMask:main#397

Merged
pull[bot] merged 4 commits into
Reality2byte:mainfrom
MetaMask:main
Dec 10, 2025
Merged

[pull] main from MetaMask:main#397
pull[bot] merged 4 commits into
Reality2byte:mainfrom
MetaMask:main

Conversation

@pull

@pull pull Bot commented Dec 10, 2025

Copy link
Copy Markdown

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 : )

chrisleewilcox and others added 4 commits December 10, 2025 07:25
#23848)

<!--
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?
-->
This PR moves the Predict Market Details performance test to the login
configuration directory to align with its test requirements and improve
test organization.

### Changes

- Relocated test file: Moved predict-market-details.spec.js from
appwright/tests/performance/predict/ to
appwright/tests/performance/login/predict/
- Updated import paths: Adjusted all relative imports to reflect the new
directory depth

### Why this change?

- The Predict Market Details performance test requires a logged-in user
session to execute (it calls login(device) before testing). Moving it
under the login/ directory:
- Groups it with other tests that share the same login configuration
prerequisites
- Improves test organization by aligning directory structure with test
requirements
- Makes it clearer to developers which tests require authentication
- Reduces the use of test runners on browserstack, freeing up more
devices for testing


## **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: https://consensyssoftware.atlassian.net/browse/MMQA-1077

## **Manual testing steps**

```gherkin
Feature: Performance test Prediction market details screens

  Scenario: Navigate through market details screens for Predictions
    Given I am on market details screen for a market in Predictions
    When I navigate through market details screens
    Then all details screens render properly
    And market details screens render in acceptable time
```

## **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://app-automate.browserstack.com/builds/5848fa614265dae9ee9ed2b2882ec1679f932355/sessions/04840758e630354152540ff387d86cbfedc50f7e?auth_token=03a3e7fd05fc6c581e18d24e82e7f8e9398dc100597fc55f81851259c17bef22

## **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
- [ ] 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**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Moves the Predict Market Details performance test under the login
suite and updates all relative imports; test logic unchanged.
> 
> - **Tests (performance)**:
> - Relocate `predict-market-details.spec.js` to
`appwright/tests/performance/login/predict/` and update relative imports
(`fixtures`, `utils`, `wdio` screen objects).
>   - No changes to test flow or assertions; only path adjustments.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ee3afaa. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description**

Unified all ramp-related button click analytics to use a single
`RAMPS_BUTTON_CLICKED` event instead of separate `BUY_BUTTON_CLICKED`
and `SELL_BUTTON_CLICKED` events.

**Changes:**
- Replaced `BUY_BUTTON_CLICKED` with `RAMPS_BUTTON_CLICKED` (with
`ramp_type: 'BUY'`)
- Replaced `SELL_BUTTON_CLICKED` with `RAMPS_BUTTON_CLICKED` (with
`ramp_type: 'SELL'`)
- Added consistent analytics payload across all ramp buttons:
`ramp_routing`, `is_authenticated`, `preferred_provider`, `order_count`
- Removed duplicate analytics calls in `BalanceEmptyState` and
`AssetOverview`
- Removed deprecated `BUY_BUTTON_CLICKED` and `SELL_BUTTON_CLICKED`
event definitions

**Files updated:**
- `FundActionMenu.tsx` - All buttons now use unified event
- `BalanceEmptyState.tsx` - Removed duplicate event, uses unified event
- `AssetOverview.tsx` - Removed duplicate event, uses unified event
- `SendTo/index.js` - Updated to use unified event with full payload
- `ReceiveRequest/index.js` - Updated to use unified event with full
payload
- `MetaMetrics.events.ts` - Removed deprecated event definitions
- `analytics.ts` (types) - Removed deprecated type definitions
- Updated related tests

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Fixes: TRAM-2901,
#23777

## **Manual testing steps**

Feature: Ramp Button Analytics

  Scenario: user taps Buy button in FundActionMenu
    Given the user is on the wallet screen with FundActionMenu open

    When user taps the Buy button
Then RAMPS_BUTTON_CLICKED event is fired with ramp_type: 'BUY' and
extended payload

  Scenario: user taps Sell button in FundActionMenu
    Given the user is on the wallet screen with FundActionMenu open

    When user taps the Sell button
Then RAMPS_BUTTON_CLICKED event is fired with ramp_type: 'SELL' and
extended payload

  Scenario: user taps Add funds in BalanceEmptyState
    Given the user is on an empty wallet state

    When user taps the Add funds button
Then RAMPS_BUTTON_CLICKED event is fired with ramp_type: 'BUY' and
extended payload## **Screenshots/Recordings**

### **Before**

N/A - Analytics change only

### **After**

N/A - Analytics change only

https://www.loom.com/share/b837c0baa90342fc9bb54240be16069d

## **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]
> Replaces separate buy/sell analytics with unified
`RAMPS_BUTTON_CLICKED` using a standardized payload across ramp
entrypoints, updates components/tests, and removes deprecated
events/types.
> 
> - **Analytics**:
> - Remove deprecated `BUY_BUTTON_CLICKED` and `SELL_BUTTON_CLICKED`
from `core/Analytics/MetaMetrics.events.ts` and
`UI/Ramp/Aggregator/types/analytics.ts`.
> - Standardize ramp entrypoint tracking on `RAMPS_BUTTON_CLICKED` with
properties: `ramp_type` (`BUY` | `SELL` | `DEPOSIT` | `UNIFIED_BUY`),
`chain_id_destination/source`, `region`, `ramp_routing`,
`is_authenticated`, `preferred_provider`, `order_count`.
> - **UI Updates**:
> - `components/UI/FundActionMenu/FundActionMenu.tsx`: All actions (buy,
unified buy, sell, deposit) emit `RAMPS_BUTTON_CLICKED` with appropriate
`ramp_type`; integrates `useRampsButtonClickData`; tests updated.
> - `components/UI/AssetOverview/AssetOverview.tsx`: Buy now tracks
`RAMPS_BUTTON_CLICKED` with extended payload; adds
`useRampsButtonClickData`.
> - `components/UI/BalanceEmptyState/BalanceEmptyState.tsx`: Action
tracks `RAMPS_BUTTON_CLICKED` with extended payload; removes duplicate
legacy event; tests updated.
> - `components/UI/ReceiveRequest/index.js` and
`Views/.../SendTo/index.js`: Remove legacy buy tracking; add TODO for
future unified analytics.
> - **Tests**:
> - Update affected tests to assert `RAMPS_BUTTON_CLICKED` and new
payload fields.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ee34603. 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**

Mark legacy swaps `useBlockExplorer` hook as deprecated and move it
under bridge module.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-3506

## **Manual testing steps**

```gherkin
No business logic was touched, this is just a file reorganization.
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Deprecates and moves the swaps block explorer hook to Bridge as
useLegacySwapsBlockExplorer, updates all usages, and adds comprehensive
tests with minor type/behavior fixes.
> 
> - **Hooks**:
> - Deprecate and move `useBlockExplorer` to
`app/components/UI/Bridge/hooks/useLegacySwapsBlockExplorer` as
`useLegacySwapsBlockExplorer`.
> - Tighten types and safety: guard empty hashes, null‑coalesce explorer
URL, validate http(s) protocol, fix import paths.
> - **Consumers Updated**:
> - Replace old hook with `useLegacySwapsBlockExplorer` in `Swaps`
(`index.js`, `components/TokenSelectModal.js`),
`Ramp/Aggregator/OrderDetails.tsx`,
`Rewards/hooks/useTransactionExplorer.ts`, and
`Views/AssetOptions/AssetOptions.tsx`.
> - **Tests**:
> - Add `useLegacySwapsBlockExplorer/index.test.ts` with coverage for
resolver logic and URL builders.
>   - Remove old `UI/Swaps/utils/useBlockExplorer.test.js`.
>   - Update `AssetOptions.test.tsx` to mock the new hook.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
a3b28b4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…raction (#23806)

<!--
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 addresses an issue where rejecting a MMConnect/SDKConnectV2
confirmation results in a connection failure toast (rather than a error
toast) in the wallet.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: fix issue where rejecting a MMConnect confirmation
results in a connection failure toast (rather than a error toast) in the
wallet.

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: SDKConnectV2 connection rejection modal

  Scenario: user reject SDKConnectV2 connection
    Given no permission exists

    When user attempts to connect via native browser (using Metamask Connect integrated dApp)
    Then rejecting connection show render an error toast with a user rejected connection message
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**


https://github.com/user-attachments/assets/aae60e47-5a45-44cf-b786-077ba9086274

<!-- [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]
> Handles userRejectedRequest errors by showing an "Approval Rejected"
toast, adding adapter support, tests, and i18n strings.
> 
> - **SDKConnectV2 behavior**:
> - On bridge responses with `error.code ===
errorCodes.provider.userRejectedRequest`, call
`hostApp.showConfirmationRejectionError` instead of
`showConnectionError` in `app/core/SDKConnectV2/services/connection.ts`.
> - **Host application adapter**:
> - Add `showConfirmationRejectionError(conninfo?)` to
`HostApplicationAdapter` with error toast dispatch in
`app/core/SDKConnectV2/adapters/host-application-adapter.ts`.
> - Extend `IHostApplicationAdapter` interface to include
`showConfirmationRejectionError` in
`app/core/SDKConnectV2/types/host-application-adapter.ts`.
> - **Tests**:
> - Add unit tests for rejection toast behavior in `connection.test.ts`
and adapter tests in `host-application-adapter.test.ts`.
> - **Localization**:
> - Add `sdk_connect_v2.show_rejection.{title,description}` strings in
`locales/languages/en.json`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c617f57. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@pull pull Bot locked and limited conversation to collaborators Dec 10, 2025
@pull pull Bot added the ⤵️ pull label Dec 10, 2025
@pull pull Bot merged commit 7879c4f into Reality2byte:main Dec 10, 2025
1 of 11 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants