Skip to content

feat: add network picker deeplink cp-7.65.0#25446

Merged
Prithpal-Sooriya merged 7 commits intomainfrom
cursor/network-picker-deeplink-60f5
Feb 6, 2026
Merged

feat: add network picker deeplink cp-7.65.0#25446
Prithpal-Sooriya merged 7 commits intomainfrom
cursor/network-picker-deeplink-60f5

Conversation

@Prithpal-Sooriya
Copy link
Copy Markdown
Contributor

@Prithpal-Sooriya Prithpal-Sooriya commented Jan 30, 2026

Description

Add deeplink support to open the network picker modal from the home screen.

This allows users to directly open the network selection modal via a universal link to the home screen, improving navigation flow for network-specific actions.

Deeplink: https://link.metamask.io/home?openNetworkSelector=true

Changelog

CHANGELOG entry: feat: add network picker deeplink

Related issues

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

Manual testing steps

  1. Generate a link that a user can click (or spin up inside bash command)
  2. "Click" network picker deeplink
  3. EXPECTED - should open home screen and network deeplink

Screenshots/Recordings

Before

After

https://www.loom.com/share/53a5b4ea0e4245be85f8c96d4871a351

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.

Open in Cursor Open in Web


Note

Medium Risk
Changes wallet home focus-time navigation behavior and relies on delayed setParams timing/param clearing, which could cause unexpected navigation or regress existing deeplink flows if route params aren’t shaped as expected.

Overview
Adds support for home?openNetworkSelector=true deeplinks by navigating to Routes.WALLET.HOME and then (after a delay) setting openNetworkSelector via NavigationService.navigation.setParams.

Refactors wallet home deeplink handling into a new useHomeDeepLinkEffects hook that runs on screen focus, performs delayed actions (select Perps tab or open the network selector modal), and clears consumed deeplink params by setting them to null. Updates/extends unit tests and deeplink docs to cover the new parameter and hook behavior.

Written by Cursor Bugbot for commit 0220ffb. This will update automatically on new commits. Configure here.

@cursor
Copy link
Copy Markdown

cursor bot commented Jan 30, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@github-actions
Copy link
Copy Markdown
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.

1 similar comment
@github-actions
Copy link
Copy Markdown
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.

@github-actions github-actions bot added size-M and removed size-S labels Jan 30, 2026
@Prithpal-Sooriya Prithpal-Sooriya changed the title Network picker deeplink feat: add network picker deeplink Feb 2, 2026
Comment on lines +24 to +31
// The timeout is REQUIRED - React Navigation needs time to:
// 1. Complete the navigation transition
// 2. Mount the Wallet component
// 3. Make navigation context available for setParams
// Without this delay, deeplink param effects may fail
setTimeout(() => {
NavigationService.navigation.setParams({ openNetworkSelector: true });
}, PERFORMANCE_CONFIG.NavigationParamsDelayMs);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copied from perps deeplink navigation

// The timeout is REQUIRED - React Navigation needs time to:
// 1. Complete the navigation transition
// 2. Mount the Wallet component
// 3. Make navigation context available for setParams
// Without this delay, the tab selection will fail
setTimeout(() => {
NavigationService.navigation.setParams({
initialTab: 'perps',
shouldSelectPerpsTab: true,
// Future: could use tab parameter for more specific navigation
...(tab && { specificTab: tab }),
});
}, PERFORMANCE_CONFIG.NavigationParamsDelayMs);
};

onChangeTab={onChangeTab}
defiEnabled={defiEnabled}
collectiblesEnabled={collectiblesEnabled}
navigationParams={route.params}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cleanup, we don't need this additional routing if we are already drilling down the navigation/route (we can use useRoute hooks)

}, [route.params, isPerpsEnabled, navigationParams, navigation]),
);
// Handle deep link effects
useHomeDeepLinkEffects({
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Abstract away deeplink effect hooks.

…ling

Updated the `Wallet` component's deep link parameters to accept `null` values for `openNetworkSelector`, `shouldSelectPerpsTab`, and `initialTab`. This change ensures that the parameters are correctly set to `null` when needed, improving the handling of navigation state. Adjusted related tests to reflect these changes in expected parameter values.
@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as ready for review February 5, 2026 19:31
@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team as a code owner February 5, 2026 19:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 5, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeNetworkAbstractions, SmokePerps, SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 78%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes add a new deeplink parameter openNetworkSelector to the home URL handler and refactor the Wallet component's deeplink handling into a reusable hook useHomeDeepLinkEffects.

Key impacts:

  1. handleHomeUrl.ts - Adds new deeplink functionality to open the network selector when navigating to home via deeplink with openNetworkSelector=true parameter
  2. Wallet/index.tsx - Refactors existing perps tab selection deeplink handling and adds network selector opening into a new hook. The hook uses useFocusEffect and navigation params to handle deeplink actions.

The changes touch:

  • SmokeNetworkAbstractions: The new deeplink opens the network selector modal (Routes.SHEET.NETWORK_SELECTOR), which is tested by network management tests
  • SmokePerps: The perps tab selection deeplink handling was refactored (though functionally unchanged), and perps is a section in Trending
  • SmokeWalletPlatform: The Wallet home screen component was modified, and per tag description, changes to Perps views affect Trending which is covered by this tag

The changes are well-covered by unit tests, but E2E validation is needed to ensure the deeplink flows work correctly in the actual app navigation context. The refactoring of existing deeplink handling code introduces some risk of regression.

Performance Test Selection:
The changes are focused on deeplink handling and navigation logic. They don't affect UI rendering performance, data loading, or critical performance paths. The setTimeout delays used are for navigation timing purposes, not performance-critical code. No performance tests are needed.

View GitHub Actions results

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Feb 5, 2026

@Prithpal-Sooriya Prithpal-Sooriya changed the title feat: add network picker deeplink feat: add network picker deeplink cp-7.65.0 Feb 6, 2026
@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue Feb 6, 2026
Merged via the queue into main with commit b539420 Feb 6, 2026
211 of 216 checks passed
@Prithpal-Sooriya Prithpal-Sooriya deleted the cursor/network-picker-deeplink-60f5 branch February 6, 2026 12:01
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2026
@metamaskbot metamaskbot added the release-7.66.0 Issue or pull request that will be included in release 7.66.0 label Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.66.0 Issue or pull request that will be included in release 7.66.0 size-M team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants