Skip to content

[pull] main from MetaMask:main#36

Merged
pull[bot] merged 5 commits into
Reality2byte:mainfrom
MetaMask:main
Aug 1, 2025
Merged

[pull] main from MetaMask:main#36
pull[bot] merged 5 commits into
Reality2byte:mainfrom
MetaMask:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Aug 1, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

abretonc7s and others added 5 commits August 1, 2025 06:22
…gration (#17797)

<!--
  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 refactors the PerpsController to remove all i18n dependencies,
making it
UI-agnostic and ready to be moved to the MetaMask Core monorepo. The
controller now
returns error codes instead of localized strings, with translation
handled at the UI
  layer through a centralized error handling pattern.

  **What is the reason for the change?**
- The PerpsController had direct dependencies on the mobile app's i18n
system
  through `strings()` function calls
- This tight coupling prevented the controller from being extracted into
a separate
  package
- Error messages were being localized at the controller level rather
than the UI
  layer

  **What is the improvement/solution?**
  - Introduced an error code system with constants (`PERPS_ERROR_CODES`)
  - Replaced all 13 `strings()` calls with error code constants
- Created a centralized error handling utility (`perpsErrorHandler.ts`)
with:
- `handlePerpsError()`: Main error handler that accepts any error type
and
  provides context-aware translation
- `translatePerpsError()`: Type-safe translation function for known
error types
- `isPerpsErrorCode()`: Helper to check if an error matches a specific
code
- UI components now intelligently detect and translate PerpsController
error codes
  while preserving existing error handling
- Improved code quality by extracting nested ternary operations and
using proper
  type constraints

  ## **Changelog**

  CHANGELOG entry: null

  ## **Related issues**

  Fixes: TAT-1319

  ## **Manual testing steps**

  1. Navigate to Perps trading feature
  2. Test error scenarios:
     - Try depositing with insufficient funds
     - Try depositing an unsupported token
     - Disconnect network to trigger connection errors
     - Try withdrawing more than available balance
  3. Verify that all error messages still appear correctly localized
4. Ensure existing UI error messages (not from controller) still work as
before

  ## **Screenshots/Recordings**

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

  ### **Before**

  N/A - Internal refactoring with no UI changes

  ### **After**

  N/A - Internal refactoring with no UI 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.
<!--
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**
Refactor recreateNewVault with changePassword
changePassword is recently added in KeyringController, refactoring
mobile's recreateNewVault to reduce the complexity of change password in
mobile

<!--
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:
#17593
 #17618
## **Manual testing steps**

1. Login into Wallet
2. Go to Setting > Security Settings > Change Password
3. Submit old password 
4. Submit new password

## **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/724a7f84-f88c-4139-8d66-c43232ccfaff


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

- [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.

---------

Co-authored-by: himanshuchawla009 <himanshuchawla2014@gmail.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**

Adding validations for to address in send flow

## **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: MetaMask/MetaMask-planning#5402

## **Manual testing steps**

1. Enable send re-designs locally
2. Enter wrong to address on send page
3. Check errors displayed

## **Screenshots/Recordings**
<img width="399" height="851" alt="Screenshot 2025-07-28 at 9 19 53 PM"
src="https://github.com/user-attachments/assets/de221647-0874-45c6-a52a-86524bc663a9"
/>
<img width="390" height="850" alt="Screenshot 2025-07-28 at 9 13 10 PM"
src="https://github.com/user-attachments/assets/119d01eb-7811-4888-9e18-2a26b54b6ca7"
/>
<img width="389" height="848" alt="Screenshot 2025-07-28 at 9 13 00 PM"
src="https://github.com/user-attachments/assets/2b18e5b1-a4ef-493c-893f-646c867fae10"
/>

## **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.

---------

Co-authored-by: OGPoyraz <omergoktugpoyraz@gmail.com>
## **Description**

This PR fixes the iOS-specific scrolling issue with the Solana feature
popup that was preventing users from accessing the bottom buttons. The
problem occurred when the title text spans multiple lines (particularly
in non-English languages), causing the "Not now" button to appear below
the visible screen area. While users could scroll down to reach the
button, the ScrollView would automatically snap back to the top, making
the buttons inaccessible and effectively blocking app usage.

**Root Cause:** The issue was caused by conflicting flex layouts where
`contentContainerStyle` with `flex: 1` forced the ScrollView content to
always try to fill the full height, creating layout calculation
conflicts on iOS that resulted in the automatic scroll-back behavior.

**Solution:** 
- Replaced `flex: 1` with `flexGrow: 1` and `minHeight: '100%'` to allow
proper content expansion without forcing full height
- Enhanced ScrollView configuration for better iOS compatibility

## **Changelog**

CHANGELOG entry: Fixed Solana popup scrolling issue that prevented iOS
users from accessing bottom buttons

## **Related issues**

Fixes: #17795

## **Manual testing steps**

1. Open MetaMask on an iOS device (physical device or simulator)
2. Clear the Solana feature modal storage flag to trigger the popup:
- In developer tools, delete AsyncStorage key:
`@MetaMask:solanaFeatureModalShownV2`
- Or temporarily add
`StorageWrapper.removeItem(SOLANA_FEATURE_MODAL_SHOWN)` to the component
3. Restart the app to see the Solana popup
4. Test with different scenarios:
- **Short title (English)**: Verify normal display with buttons visible
- **Long title (other languages)**: Change device language to
German/Spanish/French or temporarily replace title with long text
5. When title spans 3+ lines:
   - Scroll down to reach the "Not now" button
   - Verify content stays scrolled and doesn't snap back to top
- Verify both "Import your wallet" and "Not now" buttons are clickable
6. Test on both iPhone simulator and physical device for best coverage

## **Screenshots/Recordings**

### **Before**
- Recording in #17795
- Users reported scrolling down but screen automatically moving back up
- "Not now" button became inaccessible on longer text
- App effectively blocked for users with this popup

### **After**
https://www.loom.com/share/26aefcc54516462596e16fa0aa88e81d

- Smooth scrolling behavior without snap-back
- Bottom buttons remain accessible after scrolling
- Consistent experience across different text lengths and languages

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

- [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.
<!--
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 fixing minor design defect on transactions view.

## **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: MetaMask/MetaMask-planning#5433

## **Manual testing steps**

N/A

## **Screenshots/Recordings**

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

### **Before**

<img width="897" height="2160" alt="Screenshot 2025-08-01 at 09 06 37"
src="https://github.com/user-attachments/assets/05acbc53-7ef9-4976-ba63-4e93c27bf8d4"
/>


### **After**

<img width="897" height="2160" alt="Screenshot 2025-08-01 at 09 06 22"
src="https://github.com/user-attachments/assets/d7ca0dd4-a1ca-4d73-ab0f-4fdf13cce420"
/>


## **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.
@pull pull Bot locked and limited conversation to collaborators Aug 1, 2025
@pull pull Bot added the ⤵️ pull label Aug 1, 2025
@pull pull Bot merged commit 7da38e7 into Reality2byte:main Aug 1, 2025
1 check failed
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.

5 participants