[pull] main from MetaMask:main#356
Merged
Merged
Conversation
… overview (#23144) ## **Description** ### TL;DR The left back button (the "X" button) navigates back to the asset details page and the "X" button isn't shown on first screen because two back buttons are redundant and go back to the same screen ### Problem The send flow has two navigation buttons: - **Left back button**: navigates back one step in the send flow - **Right close button**: exits the send flow entirely and returns to home screen When users initiate send from the asset details page, clicking the right close button incorrectly navigates to the home screen instead of returning to asset details. This creates a disorienting UX where users lose their place in the app. ### Solution Navigate the user back to the asset details page when clicking on the "X" button on the right. Also, we should hide the "X" back button on the first send flow screen because we have navigation redundancies, both "<" and "X" go back to the same place ### Changes - Added `location` route parameter to send flow navigation - Add a `navigation.goBack();` into the `useSendActions` hook when the user access the send flow via asset details - Updated Amount component to conditionally hide back button based on `location === InitSendLocation.AssetOverview` because of back navigation redundancy - Added test coverage for navigation header configuration ### Technical Details - Uses `useParams` hook from `navUtils` to access the `location` route parameter - Navigation options are set via `navigation.setOptions()` when the component detects it was accessed from asset overview - This prevents users from navigating back to an unexpected screen when starting send from asset details ## **Changelog** CHANGELOG entry: Right back button from amount screen now navigates back to the asset details page when accessed from the asset details page ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MDP-253 ## **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** `~` ### **Before** https://github.com/user-attachments/assets/1dc570c2-4329-4e5a-97d7-b94b899e9e44 ### **After** https://github.com/user-attachments/assets/a0d7b797-b807-4ecb-9207-6ef6adc60cf5 ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Hides the right close button on Amount when launched from asset overview, routes cancel to goBack, and propagates `location` in send navigation with updated tests. > > - **Send flow UX** > - **Amount screen (`amount.tsx`)**: Use `useParams` to read `location`; when `location === InitSendLocation.AssetOverview`, hide header right button via `navigation.setOptions`. > - **Cancel behavior (`useSendActions.ts`)**: Change `handleCancelPress` to `navigation.goBack()` instead of navigating to wallet. > - **Navigation params (`utils/send.ts`)**: Include `location` in `Routes.SEND.DEFAULT` params when starting the flow. > - **Tests** > - Update `amount.test.tsx` to mock `useParams`, assert header config when from AssetOverview. > - Update `useSendActions.test.ts` to expect `goBack` on cancel and back, and keep submission nav expectations. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 884c3c7. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…3189) ## **Description** This PR fixes **589 Segment tracking plan violations** in Perps MetaMetrics events that are blocking analytics data quality in Mixpanel dashboards. **Problem:** Numeric properties were being sent as strings, optional fields were sent as `null` instead of omitted, and some required fields were missing. This caused: - Analytics dashboards unable to perform numeric calculations - 589 violation records across 5 events over 31 days - Data quality issues in Mixpanel **Solution:** - `TrackingData` interface uses `number` types matching parsed values from hooks - Views pass numeric values directly without conversion wrappers - `parseFloat()` applied only to direct event properties (e.g., `leverage`, API result prices) - Optional fields use conditional spreads instead of `|| null` pattern - Enum constants used throughout instead of string literals - Documentation accurately reflects all implemented properties - Minimal tracking approach for cleaner analytics **Files Modified:** 7 files (6 source files + 1 documentation file) ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: - https://consensyssoftware.atlassian.net/browse/TAT-2082 - https://consensyssoftware.atlassian.net/browse/TAT-1835 ## **Manual testing steps** ```gherkin Feature: Perps MetaMetrics tracking Scenario: user completes a trade transaction Given user is on the Perps trading screen When user places a market order for BTC Then Segment event sends numeric properties as JavaScript numbers (not strings) And optional fields are omitted when undefined (not sent as null) Scenario: user views a screen Given user navigates to Perps connection error screen When screen loads Then PERPS_SCREEN_VIEWED event includes required screen_type property And error_type uses valid enum value ``` **Verification in Browser Console:** 1. Open DevTools � Network tab � Filter "segment" 2. Place trade / view screen / withdraw funds 3. Verify event payloads have: - `order_size`: `0.5` (number, not `"0.5"` string) - Optional fields either present as numbers or completely omitted (not `null`) - Required fields always present ## **Screenshots/Recordings** ### **Before** - 589 Segment violations blocking analytics - Properties sent as strings: `"0.5"`, `"50000.00"` - Optional fields sent as `null` ### **After** - 0 violations (589 � 0, 100% reduction) - Properties sent as numbers: `0.5`, `50000.00` - Optional fields properly omitted ## **Pre-merge author checklist** - [x] I've followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable (updated only broken tests per plan) - [x] I've documented my code using JSDoc format if applicable - [x] I've applied the right labels on the PR ## **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 --- ## **Technical Details** ### Changes Summary **Service Layer (403 violations):** - **TradingService.ts**: `trackOrderResult()` and `buildCloseEventProperties()` use `parseFloat()` for direct event properties (372 violations) - **AccountService.ts**: `withdraw()` method uses `parseFloat()` for withdrawal_amount (31 violations) **View Layer (155 violations):** - **PerpsConnectionErrorView.tsx**: Includes `screen_type: 'error'` enum value (93 violations) - **PerpsMarketDetailsView.tsx**: Watchlist toggle uses enum constants (31 violations) - **PerpsOrderView.tsx**: `parseFloat()` applied to `leverage_used` event property (31 violations) **Constants & Types (31 violations):** - **eventNames.ts**: Enum constants for all event values (FAVORITE_TOGGLED, FAVORITE_MARKET, UNFAVORITE_MARKET, FAVORITES_COUNT, ERROR) - **types/index.ts**: **ROOT CAUSE FIX** - `TrackingData` interface uses `number` types matching hook return values (hooks parse API strings) **Documentation:** - **perps-metametrics-reference.md**: Accurately documents all implemented properties (100% alignment with code) ### Implementation Patterns 1. **Direct Number Usage**: TrackingData interface uses `number` types; hooks parse API strings once, views pass values directly 2. **Selective parseFloat()**: Applied only to direct event properties outside TrackingData (e.g., leverage, API result prices) 3. **Optional Field Handling**: Conditional spreads `...(value && { prop: value })` ensure undefined fields are omitted (not sent as null) 4. **Enum Constants**: All event values use constants (e.g., `PerpsEventValues.INTERACTION_TYPE.TAP`) instead of string literals 5. **Type Safety**: TrackingData types match hook return types, ensuring compile-time validation of numeric properties 6. **Minimal Tracking**: Only implemented properties included in events for cleaner analytics ### Type Safety - `TrackingData` interface types match hook return values (`number` for all numeric properties) - Single conversion point: API strings → numbers in hooks, then used directly - All TypeScript validations pass without suppressions ### Validation - ✅ ESLint: All files pass - ✅ TypeScript: No errors, zero suppressions - ✅ Documentation: 100% accurate with implementation <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Standardizes Perps MetaMetrics payloads (numbers, conditional optionals), updates favorites/error event semantics, and aligns constants/types/docs. > > - **Analytics/Tracking**: > - Convert numeric event properties to numbers and omit undefined optionals: > - `TradingService`: parse `leverage`, `order_size`, `asset_price`, `limit_price`; include fees/discounts/rewards/margins only when present; add `error_message` on failures; refine close-position properties (partial fills, PnL, received amount). > - `AccountService`: parse `withdrawal_amount`; include `error_message` on failure. > - `PerpsOrderView`: send numeric `leverage_used`; pass numeric `trackingData` directly (fees, marketPrice, discounts, rewards, marginUsed). > - **Favorites/Watchlist**: use enums for `interaction_type: favorite_toggled`, `action_type: favorite_market|unfavorite_market`; track `favorites_count` in `PerpsMarketDetailsView`. > - **Error Screen**: `PerpsConnectionErrorView` tracks `screen_type: error`; retry adds `interaction_type: tap`. > - **Constants/Types**: > - Add/update enums/props: `FAVORITES_COUNT`, `INTERACTION_TYPE.FAVORITE_TOGGLED`, `ACTION_TYPE.FAVORITE_MARKET|UNFAVORITE_MARKET|LEARN_MORE`, `SCREEN_TYPE.ERROR`. > - `TrackingData` uses number types for all numeric fields. > - **Docs**: > - Update MetaMetrics reference to match implementation (screen_type includes `error`, favorites properties, optional `error_message` across events, remove unused sort fields). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7e03738. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Replace the `Max` button in the Predict and Perps deposit confirmations with a `90%` button. Remove the target amount from the insufficient fees alert. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #23265 ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** <img width="300" alt="90" src="https://github.com/user-attachments/assets/23ce05c6-cd03-4052-b5e5-eae1d9115106" /> <img width="300" alt="Alert" src="https://github.com/user-attachments/assets/87c0f5da-2550-4b4d-98e9-bccda557c195" /> ## **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] > Default deposit quick-select to 90% with an opt-in Max via hasMax, and simplify insufficient fees alert to a no-target message. > > - **UI**: > - **`DepositKeyboard`**: Default to a `90%` quick-select button instead of `Max`; add `hasMax` prop to switch to `Max` when needed; memoize percentage buttons; update tests to cover `hasMax` behavior. > - **`CustomAmountInfo` / `PredictWithdrawInfo`**: Thread `hasMax` through to `DepositKeyboard`; enable `Max` for Predict withdraw flow. > - **Alerts**: > - **`useInsufficientPayTokenBalanceAlert`**: Remove target-amount calculation/formatting; always use `_fees_no_target` message for insufficient fees; clean up related logic and tests. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b24248b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- 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** During Backup SRP flow, the navigation stuck at Backup SRP screen 2 when user selected wrong backup SRP word >10 times. This pr remove the interactionManager which might cause the navigation stuck The interactionmanager will be deprecated soon https://reactnative.dev/docs/interactionmanager Jira Link https://consensyssoftware.atlassian.net/browse/SL-325 <!-- 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: null ## **Related issues** Fixes: #22845 ## **Manual testing steps** ```gherkin Feature: remove runAfterInteraction in backup screen Scenario: user create new SRP wallet Given user create new SRP wallet When user start backup srp Then user choose incorrect words for backup srp test > 10 times Then user choose correct words for backup srp test ``` ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Removes runAfterInteractions and performs immediate navigation resets in `ManualBackupStep2`, preserving metrics opt-in flow, tracing, and tracking. > > - **Backup SRP flow (`app/components/Views/ManualBackupStep2/index.js`)**: > - Remove `InteractionManager.runAfterInteractions`; execute navigation immediately. > - Simplify `goNext` logic: > - Directly `reset` to `Routes.ONBOARDING.SUCCESS_FLOW` for `backupFlow`/`settingsBackup`. > - For standard flow, end traces, then either dispatch reset or navigate to `OptinMetrics` with callback based on `isMetricsEnabled()`. > - Consolidate tracking: call `trackOnboarding(WALLET_SECURITY_PHRASE_CONFIRMED)` outside conditional blocks. > - Maintain route params for success screens with explicit `successFlow` values. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d2dbc8e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** The current naming logic has some race-conditions when we create multiple Snap accounts at the same time (which is often the case since the introduction of BIP-44). We don't use those account names anymore, so we can skip them entirely now (for state 2 at least!). ## **Changelog** CHANGELOG entry: null ## **Related issues** Extension PR: - MetaMask/metamask-extension#37762 Fixes: - #22936 ## **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** ### **Before** ### **After** ## **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] > Skips setting Snap account names during account creation when the multichain accounts state 2 flag is enabled, and updates tests to cover this behavior. > > - **SnapKeyring**: > - Conditionally bypasses `AccountsController:setAccountName` in `addAccountFinalize` when `isMultichainAccountsState2Enabled()` is true to avoid naming races. > - Imports `isMultichainAccountsState2Enabled` and adds explanatory comments. > - **Tests (`SnapKeyring.test.ts`)**: > - Mocks `isMultichainAccountsState2Enabled`; defaults to `false` in `beforeEach`. > - Adds test ensuring no `setAccountName` call in state 2 path. > - Preserves existing flows and event tracking validations. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8e7324a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
#23273) <!-- 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** Fix an issue where the blockchain explorer urls were not generated successfully when bridging assets. <!-- 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: Generate correct blockchain explorer URLs when bridging assets ## **Related issues** Fixes: #23171 ## **Manual testing steps** ```gherkin Ensure that the correct blockchain URLs are generated when visiting the transaction details screen after bridging/swapping assets. Also ensure that the correct URLs are also generated for old bridge/swaps transactions (no regressions). ``` ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Corrects multichain block explorer URL generation for bridge transactions with proper EVM/non-EVM handling and comprehensive tests. > > - **Bridge Hook (`useMultichainBlockExplorerTxUrl`)**: > - Uses `useBlockExplorer` to resolve EVM explorer base URLs via `getEvmBlockExplorerUrl` with fallback to `getEtherscanBaseUrl`. > - Builds EVM tx links with `etherscan-link.createCustomExplorerLink`. > - Keeps non-EVM (e.g., Solana) URLs via `getTransactionUrl`; derives explorer name from URL or `useBlockExplorer`. > - Derives `explorerName`, `chainName`, and `networkImageSource` consistently (EVM via CAIP/hex; non-EVM via config). > - **Hook Tests** (`useMultichainBlockExplorerTxUrl.test.tsx`): > - Add extensive coverage for parameter validation, EVM/non-EVM paths, fallback logic, explorer name resolution, network image sourcing, and custom network configs. > - Mocks external utilities (`etherscan-link`, `useBlockExplorer`, `getEtherscanBaseUrl`, network utils). > - **Block Explorer Modal Test** (`BlockExplorersModal.test.tsx`): > - Adjust expectations to show one `Etherscan` and one `Optimistic` button instead of two `Etherscan`. > - **`useBlockExplorer`**: > - Exposes `getEvmBlockExplorerUrl` in the returned API. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit fe97a35. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- 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** The main goal of this PR is to remove all references to `Routes.SWAPS` from the codebase (apart from the legacy Swaps View directory which will be handled in a different PR). <!-- 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: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/jira/software/c/projects/SWAPS/boards/1566?quickFilter=1772&selectedIssue=SWAPS-3472 ## **Manual testing steps** ```gherkin Ensure that users can navigate to swaps when they click the swap button next to a token in Browser view (see attached recording) ``` ## **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/df2961dc-a1f3-4da1-b135-52fdb69cd83e <!-- [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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Replaces all external uses of legacy Swaps routes with Bridge navigation and updates related handlers, constants, and tests. > > - **Navigation**: > - Removed `Swaps` screens and imports from `app/components/Nav/Main/MainNavigator.js`. > - Added `BridgeView` import and ensured Bridge stacks (`Routes.BRIDGE.ROOT`, `Routes.BRIDGE.MODALS.ROOT`) are the sole trade route entries. > - **Transactions UI**: > - In `SmartTransactionStatus.tsx`, `createNewSwap` now navigates to `Routes.BRIDGE.ROOT` instead of `Routes.SWAPS`. > - **Deeplinks & SDK**: > - `SwapHandler` now navigates to `Routes.BRIDGE.ROOT` → `Routes.BRIDGE.BRIDGE_VIEW` with params `{ sourceToken, destToken, sourceAmount, chainId }`. > - `handleCustomRpcCalls` routes `target: 'swap'` to `Routes.BRIDGE.ROOT`. > - **Routes/Constants**: > - Removed `Routes.SWAPS` and `Routes.SWAPS_AMOUNT_VIEW`; retained/used Bridge route keys. > - **Tests/Snapshots**: > - Updated `SmartTransactionStatus.test.tsx` to expect Bridge navigation. > - Updated `SwapHandler.test.ts` to expect Bridge navigation and param key changes. > - Snapshot `MainNavigator.test.tsx.snap` updated to remove `Swaps` screen. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7eea25c. 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 : )