Skip to content

[pull] main from MetaMask:main#426

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

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

Conversation

@pull

@pull pull Bot commented Dec 19, 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 : )

javiergarciavera and others added 4 commits December 19, 2025 07:58
<!--
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 some test refactors to simplify timers
- Added quaility gates for tests and defined threshold (10%) for Android
and iOS (once merged, we track the metrics and decide about the
thresholds)

<!--
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]
> Introduces platform-specific thresholds with 10% margins and quality
gates to performance tests, refactors timers/reporters, updates tests to
use measure() + thresholds, and adds aggregated HTML reporting.
> 
> - **Performance framework**:
> - Add `QualityGatesValidator` with platform-specific thresholds (+10%)
and pass/fail validation.
> - Extend `TimersHelper` with threshold resolution (iOS/Android),
`measure()` helper, and `hasThreshold()`/`threshold` metadata.
> - Update fixture `fixtures/performance-test.js` to auto-attach metrics
and assert quality gates post-test.
> - Enhance `PerformanceTracker` to emit per-step thresholds/validation
and optional total validation; add `addTimers`.
> - **Reporter & outputs**:
> - Update `custom-reporter.js` to validate quality gates, embed results
in HTML/CSV, include BrowserStack video/profiling.
> - Improve per-test HTML tables (duration/threshold/status) and CSV;
include total threshold status.
> - Aggregation script now generates a polished
`aggregated-reports/performance-report.html` dashboard.
> - **Tests**:
> - Refactor performance specs to use `TimerHelper(..., { ios, android
}, device)` and `measure()`; consolidate timer adds via `addTimers`.
> - Add explicit thresholds across login, swaps, send, perps, predict,
and onboarding flows; minor skips/timeout tweaks.
> - **Docs**:
> - Overhaul `appwright/README.md` with device matrix, categories,
performance system, quality gates, reports, aggregation, and best
practices.
> - **Page objects**:
>   - `WalletMainScreen.isVisible()` now uses `appwright` expect.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
35f1aa5. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Curtis David <Curtis.David7@gmail.com>
## **Description**

When a position has a liquidation price of $0 (e.g., cross-margin
positions), the Adjust Margin view was displaying "0%" for liquidation
distance, which is misleading since 0% would normally indicate imminent
liquidation.

This PR adds a fallback display ("--") when the liquidation price is $0,
consistent with how other displays handle unavailable data in the Perps
feature.

## **Changelog**

CHANGELOG entry: Fixed liquidation distance showing 0% instead of
fallback when liquidation price is unavailable

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2200

## **Manual testing steps**

```gherkin
Feature: Adjust Margin View - Liquidation Distance Display

  Scenario: User views liquidation distance when liquidation price is $0
    Given user has an open position with liquidation price of $0

    When user opens the Adjust Margin view
    Then liquidation distance displays "--" instead of "0%"

  Scenario: User views liquidation distance with valid liquidation price
    Given user has an open position with a valid liquidation price

    When user opens the Adjust Margin view
    Then liquidation distance displays the correct percentage (e.g., "25%")
```

## **Screenshots/Recordings**

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

### **Before**

<!-- Liquidation distance shows "0%" when liquidation price is $0 -->
<img width="1206" height="2622" alt="Simulator Screenshot -
iPhone16Pro-Gamma - 2025-12-18 at 11 44 31"
src="https://github.com/user-attachments/assets/d0a5a7f1-d53d-4c0e-820b-cb54110d6404"
/>

### **After**

<img width="1206" height="2622" alt="Simulator Screenshot -
iPhone16Pro-Delta - 2025-12-18 at 11 47 32"
src="https://github.com/user-attachments/assets/ad72b39b-c58c-486f-a398-c1e755010cf7"
/>

## **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]
> Use a formatter to display a fallback (e.g., "--") for liquidation
distance when liquidation price is 0 in the Adjust Margin view.
> 
> - **Perps Adjust Margin View (`PerpsAdjustMarginView.tsx`)**:
>   - **Liquidation Distance**:
> - Add `formatLiquidationDistance` helper to return
`PERPS_CONSTANTS.FALLBACK_DATA_DISPLAY` when `liquidationPrice === 0`.
> - Replace direct percentage rendering with `formatLiquidationDistance`
for current and new values.
>   - **Config**: Import `PERPS_CONSTANTS` from `constants/perpsConfig`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3c7f695. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
)

## **Description**

The ActionSheet is buggy on Android (a new layout shift has caused
Android to freeze when the ActionSheet is trying to be visible).

Instead we have replaced it with a more reliable MMDS BottomSheet, which
allows us to control the buttons and other fields with our Design System
components.

## **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: refactor: replace remove token ActionSheet with MMDS
BottomSheet

## **Related issues**

Fixes: #23605,
https://consensyssoftware.atlassian.net/browse/ASSETS-1961

## **Manual testing steps**

See issue:
1. Long press non-native tokens
2. See bottom sheet

## **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/8163f10e116646e0b2097aae3a085f0f

## **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]
> Replaces the token removal ActionSheet with a new MMDS BottomSheet,
updates related state/UX, adds targeted tests, and tweaks test IDs and
i18n copy.
> 
> - **UI (Tokens)**:
> - **BottomSheet replacement**: Introduces
`TokenList/RemoveTokenBottomSheet` and refactors `Tokens` to use it
instead of `ActionSheet` (adds `removeTokenState`, `showRemoveMenu`, and
close handlers).
> - **Skeleton**: Adds `testID="token-list-skeleton"` in
`TokenListSkeleton`.
> - **Empty State**: `TokensEmptyState` now sets
`testID="tokens-empty-state"` and passes through props.
> - **Tests**:
> - Overhauls `app/components/UI/Tokens/index.test.tsx` to mock
subcomponents and cover: container render, loading skeleton, empty
state, token list, refresh action, add-token navigation, and EVM/non‑EVM
removal via BottomSheet.
>   - Updates `TokensEmptyState.test.tsx` to assert new `testID`.
> - **i18n**:
>   - Changes `wallet.remove_token_title` to "Hide token?".
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d30881c. 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>
…#24164)

<!--
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**

Upgrade `@metamask/notification-services-controller` to `^21.0.0` as no
breaking changes were found during verification.

<!--
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: chore: bump
`@metamask/notification-services-controller` to `^21.0.0`

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2187

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **Screenshots/Recordings**

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

### **Before**

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

### **After**

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

## **Pre-merge author checklist**

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

## **Pre-merge reviewer checklist**

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

---
<a
href="https://cursor.com/background-agent?bcId=bc-18bd079b-c614-4660-9378-94e3a821d897"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-cursor-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in
Cursor"
src="https://cursor.com/open-in-cursor.svg"></picture></a>&nbsp;<a
href="https://cursor.com/agents?id=bc-18bd079b-c614-4660-9378-94e3a821d897"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-web-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web"
src="https://cursor.com/open-in-web.svg"></picture></a>


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Aligns `Encryptor` with `@metamask/keyring-controller@^25` (and
removes `cacheEncryptionKey`), while bumping notification and profile
sync controllers.
> 
> - **Core/Encryptor**:
> - Implement `Encryptor` to conform to `@metamask/keyring-controller`
`Encryptor<EncryptionKey, KeyDerivationOptions, EncryptionResult>`
interface.
> - Remove legacy `WithKeyEncryptor` type and related imports from
`types.ts`.
> - **Engine**:
> - Update `keyring-controller-init` to drop `cacheEncryptionKey`
option; adjust test to match constructor args.
> - **Dependencies**:
>   - Bump `@metamask/keyring-controller` to `^25.0.0`.
> - Bump `@metamask/notification-services-controller` to `^21.0.0` and
`@metamask/profile-sync-controller` to `^27.0.0` (lockfile updated).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8d5f489. 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>
@pull pull Bot locked and limited conversation to collaborators Dec 19, 2025
@pull pull Bot added the ⤵️ pull label Dec 19, 2025
@pull pull Bot merged commit f1d9bb2 into Reality2byte:main Dec 19, 2025
2 of 36 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.

3 participants