Skip to content

feat: change contacts logic in order to support global network selector removal #16585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 2, 2025

Conversation

mathieuartu
Copy link
Contributor

@mathieuartu mathieuartu commented Jun 23, 2025

Description

This PR makes it so the contacts feature supports the future removal of the global network selector.
Namely, with this PR:

  • Every EVM contact is displayed in the contacts page, with an added network badge
  • Every EVM contact is displayed in the send flow
  • A network selector can be used when adding or editing a contact
  • Network badges are also shown in the send flow address book

By itself, this PR introduces no user facing changes, because new logic is behind the MM_REMOVE_GLOBAL_NETWORK_SELECTOR feature flag. This flag is false by default.

In order to test this PR changes, you'd need to temporarily modify app/util/networks/index.js so that isRemoveGlobalNetworkSelectorEnabled returns true.

Related issues

Fixes:

Manual testing steps

  1. Enable the MM_REMOVE_GLOBAL_NETWORK_SELECTOR feature flag (see description above)
  2. Go to the contacts page
  3. Verify that every contact has a network badge
  4. Add or edit a contact
  5. Verify that you can select the network
  6. Go to the send flow
  7. Verify that all EVM contacts are displayed
  8. Verify that those contacts have a network badge

Screenshots/Recordings

Before

After

contacts_2.mov

Pre-merge author checklist

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.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@mathieuartu mathieuartu added Run Smoke E2E Requires smoke E2E testing needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Jun 23, 2025
Copy link
Contributor

github-actions bot commented Jun 23, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: be795d1
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/cd70be6b-a636-4891-bfef-3a9a758ecf3c

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@mathieuartu mathieuartu added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Jun 24, 2025
@MetaMask MetaMask deleted a comment from github-actions bot Jun 24, 2025
@mathieuartu mathieuartu added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Jun 24, 2025
@MetaMask MetaMask deleted a comment from github-actions bot Jun 24, 2025
@mathieuartu mathieuartu added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Jun 24, 2025
@MetaMask MetaMask deleted a comment from github-actions bot Jun 25, 2025
@mathieuartu mathieuartu added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Jun 25, 2025
Copy link
Contributor

github-actions bot commented Jun 25, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 581c089
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9af95c14-98ee-45a0-84f7-d94528a0f007

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

…b.com:MetaMask/metamask-mobile into feat/contacts-without-global-network-selector
Copy link

@mathieuartu
Copy link
Contributor Author

A custom Bitrise pipeline where process.env. MM_REMOVE_GLOBAL_NETWORK_SELECTOR is true has been run successfully here

@mathieuartu mathieuartu marked this pull request as ready for review June 25, 2025 13:21
@mathieuartu mathieuartu requested review from a team as code owners June 25, 2025 13:21
Copy link
Contributor

@cmd-ob cmd-ob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done a manual pass confirming the functionality as described in the PR description

Copy link
Contributor

@vinnyhoward vinnyhoward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks solid. Approving now. I'll do some manual testing this afternoon. I'll ping you if I find anything

@mathieuartu mathieuartu enabled auto-merge July 2, 2025 16:04
@mathieuartu mathieuartu added this pull request to the merge queue Jul 2, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 2, 2025
…or removal (#16585)

## **Description**

This PR makes it so the contacts feature supports the future removal of
the global network selector.
Namely, with this PR:

- Every EVM contact is displayed in the contacts page, with an added
network badge
- Every EVM contact is displayed in the send flow
- A network selector can be used when adding or editing a contact
- Network badges are also shown in the send flow address book

By itself, this PR introduces no user facing changes, because new logic
is behind the `MM_REMOVE_GLOBAL_NETWORK_SELECTOR` feature flag. This
flag is `false` by default.

In order to test this PR changes, you'd need to temporarily modify
`app/util/networks/index.js` so that
`isRemoveGlobalNetworkSelectorEnabled` returns true.

## **Related issues**

Fixes:
- MetaMask/MetaMask-planning#4112
- MetaMask/MetaMask-planning#4177

## **Manual testing steps**

1. Enable the `MM_REMOVE_GLOBAL_NETWORK_SELECTOR` feature flag (see
description above)
2. Go to the contacts page
3. Verify that every contact has a network badge
4. Add or edit a contact
5. Verify that you can select the network
6. Go to the send flow
7. Verify that all EVM contacts are displayed
8. Verify that those contacts have a network badge

## **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/2e6c866e-a6ca-4f77-8d93-c5d1c2b795fe



## **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.
Merged via the queue into main with commit 4548413 Jul 2, 2025
44 of 47 checks passed
@mathieuartu mathieuartu deleted the feat/contacts-without-global-network-selector branch July 2, 2025 16:51
@github-actions github-actions bot locked and limited conversation to collaborators Jul 2, 2025
@github-actions github-actions bot removed the needs-qa Any New Features that needs a full manual QA prior to being added to a release. label Jul 2, 2025
@metamaskbot metamaskbot added the release-7.51.0 Issue or pull request that will be included in release 7.51.0 label Jul 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.51.0 Issue or pull request that will be included in release 7.51.0 Remove GNS Run Smoke E2E Requires smoke E2E testing team-identity team-wallet-ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants