[pull] main from MetaMask:main#351
Merged
Merged
Conversation
Related issue: https://consensyssoftware.atlassian.net/jira/polaris/projects/MWMR/ideas/view/8845676?selectedIssue=MWMR-10 ## Description Reorganized deeplink-related files and folders, and remove some unused code **Impact:** None - pure refactoring, no behavior changes ## Changelog ``` CHANGELOG entry: null ``` _(Internal refactoring only, no user-facing changes)_ ## Manual Testing Steps **Given** the app is unlocked **When** I trigger any deeplink (via URL, QR code, push notification, or in-app browser) **Then** the deeplink routes correctly to the expected screen **Test coverage:** - `metamask://swap` → Opens swap screen - `https://metamask.app.link/buy` → Opens buy crypto flow - QR code scans with deeplinks work - Push notification deeplinks work ## Pre-merge Author Checklist - [x] I've followed MetaMask Coding Standards - [x] I've clearly explained the changes - [x] I've included manual testing steps - [x] I've added/updated tests (32 test suites, 353 tests passing) - [x] I've run `yarn lint:tsc` ✅ - [x] I've run `yarn eslint --fix` ✅ - [x] All tests pass ✅ ## Test Results ``` ✅ 32/32 test suites passed ✅ 353/353 tests passed ✅ 0 ESLint errors ✅ 0 TypeScript errors ``` --- <!-- CURSOR_SUMMARY --> > [!NOTE] > Reorganizes deeplink code into a new module structure (legacy handlers + v2 router/handlers), updates app imports/usages, and refreshes tests without changing behavior. > > - **Core Deeplink Architecture**: > - Introduces v2 system (`handlers/v2`, `router`, `registry`, `normalization`, `types`, `utils`) with `BaseHandler`, `NavigationHandler`, `SendHandler`, `SwapHandler`, `UniversalRouter`, `HandlerRegistry`, and `CoreLinkNormalizer`. > - Adds central exports in `core/DeeplinkManager/index.ts` and integration layer `UniversalRouterIntegration`. > - **Legacy Handlers**: > - Moves existing handlers under `handlers/legacy` and updates internal imports (e.g., `handleEthereumUrl`, `handleMetaMaskDeeplink`, `handleUniversalLink`, `switchNetwork`). > - Adds small wrapper re-exports (`handleRampUrl`, `handleDepositCashUrl`). > - Updates `parseDeeplink` to reference new paths/utilities. > - **App Updates**: > - Switches to `SharedDeeplinkManager` in `components/UI/Navbar` and adjusts QR scanner comment link. > - Updates Rewards `ActiveBoosts` to import `handleDeeplink` from new path. > - **Tests**: > - Refreshes all mocks/imports to new locations; adds comprehensive tests for v2 handlers, router, registry, normalization, and updated legacy handlers. > - Adjusts saga and DeeplinkManager tests to new `handleDeeplink` path and notification flows. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit bd54982. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )