[pull] main from MetaMask:main#537
Merged
Merged
Conversation
…26244) ## **Description** Cleans up the temporary backwards-compatibility code in `usePredictBalance`. ### What changed **Hook simplification** — `usePredictBalance` is now a 20-line thin wrapper around `useQuery()` that directly returns `UseQueryResult<number, Error>`. Removed: - `loadOnMount` and `enabled` options (unused by any consumer) - `UsePredictBalanceResult` custom interface and `Refetch` type alias - 5 legacy fields: `balance`, `hasNoBalance`, `isRefreshing`, `loadBalance`, plus manual `data`/`error` spreading **Confirmations consumer migration** — The 3 confirmations files that still used the legacy `{ balance }` field with `{ loadOnMount: true }` now use standard `{ data: balance = 0 }`: - `predict-withdraw-balance.tsx` - `useInsufficientPredictBalanceAlert.ts` - `useTransactionCustomAmount.ts` **Test mock updates** — 7 test files updated to use `data`/`isLoading`/`error` instead of legacy mock shapes. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: N/A ## **Manual testing steps** ```gherkin Feature: Predict balance display Scenario: user views their Predict balance Given user has a Predict account with funds When user navigates to the Predict screen Then balance is displayed correctly with loading state Scenario: user completes a deposit and balance refreshes Given user is on the Predict screen When user completes a deposit Then balance updates automatically after confirmation toast Scenario: user views withdraw confirmation Given user initiates a Predict withdrawal When the confirmation screen appears Then available balance is displayed correctly ``` ## **Screenshots/Recordings** N/A — no visual changes, internal refactor only ## **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] > **Low Risk** > Primarily a type/shape refactor of a hook return value plus test updates; risk is limited to any missed call sites still expecting legacy fields. > > **Overview** > **Simplifies `usePredictBalance`** by removing backwards-compat options/fields (`enabled`, `loadOnMount`, `balance`, `hasNoBalance`, refresh helpers) and returning the raw React Query `UseQueryResult<number, Error>`. > > **Migrates remaining consumers/tests** (notably Predict confirmations and several Predict component tests) to read `data`/`isLoading` from the hook and default `data` to `0` where needed, updating mocks and removing tests that asserted the old disabled/legacy behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5537e41. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Passes the `location` entry point through the swap/bridge flow so all Unified SwapBridge events carry it. Enables attributing completed swaps to the trending explore flow. ### New properties added Same as core — `location` is now included on all Unified SwapBridge events emitted from mobile. ## **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: Adds location property to swap events. ## **Related issues** Related: MetaMask/core#7931 Fixes: ## **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** <!-- 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** - [ ] 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] > **Medium Risk** > Touches swap/bridge navigation params and the transaction submission call into `BridgeStatusController`, so incorrect wiring could affect analytics attribution or swap submission behavior; functional scope is otherwise contained and covered by updated tests. > > **Overview** > **Propagates a `location` entry-point through the unified swap/bridge flow for analytics attribution (including Trending Explore).** `BridgeRouteParams` is moved into `useSwapBridgeNavigation` and extended with `location` (`MetaMetricsSwapsEventSource`), with navigation now mapping/setting controller location via `BridgeController.setLocation()` and supporting `skipLocationUpdate` to preserve an existing bridge session’s origin. > > Transaction submission now forwards `location` through `SwapsConfirmButton` → `useSubmitBridgeTx` into `BridgeStatusController.submitTx`, and legacy deeplinks (`handleSwapUrl`, `handleCreateAccountUrl`) now include a default `location`. Tests/mocks are updated accordingly, and `@metamask/bridge-controller` / `@metamask/bridge-status-controller` are bumped to versions that support the new location plumbing. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5e581ef. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Micaela Estabillo <micaela.estabillo@consensys.net>
<!-- 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** - Migrated Timers.js and TimersHelper.js from tests/framework/utils/ to TypeScript - Renamed Timers → TimerStore (tests/framework/TimerStore.ts) to better reflect its role as a timer registry - Moved TimersHelper → TimerHelper (tests/framework/TimerHelper.ts) up one directory level alongside other framework modules - Added TimerData and PlatformThreshold interfaces with full type coverage - Deleted the original JS files and updated all 17 import references across performance specs, utils, and README <!-- 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: https://consensyssoftware.atlassian.net/browse/MMQA-1468 ## **Manual testing steps** N/A ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** N/A <!-- [screenshots/recordings] --> ### **After** N/A <!-- [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] > **Medium Risk** > Mostly a test-only refactor, but it changes module paths and runtime error behavior (e.g., stopping an unstarted timer now throws), which can break performance test runs if any call sites rely on the old semantics or import resolution. > > **Overview** > Migrates the performance test timing utilities from `Timers.js`/`TimersHelper.js` to TypeScript by introducing `TimerStore.ts` (timer registry) and `TimerHelper.ts` (timer wrapper with platform-specific thresholds and +10% margin). > > Deletes the legacy JS timer modules and updates all call sites (performance specs, shared flows, and a couple WDIO screen objects) plus the performance README to import/use the new `TimerHelper` location and module names. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a357b3b. 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** <!-- 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: keypad bottom border is visible occasionally on Android ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4146 ## **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** <!-- 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] > **Low Risk** > Single UI style tweak isolated to the `SwapsKeypad` bottom sheet; minimal behavioral impact beyond minor layout adjustment. > > **Overview** > Fixes an intermittent Android rendering artifact on the `SwapsKeypad` bottom sheet by adjusting `keypadDialog` styling to include a `marginBottom: -1`, preventing the keypad’s bottom border from occasionally showing. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7e3582a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…ure flag name (#26226) ## **Description** The withdraw-to-any-token capability (`canSelectWithdrawToken`) was gated by the `MM_PREDICT_WITHDRAW_ANY_TOKEN` environment variable, which required a rebuild to toggle. This PR replaces it with the `predictWithdrawAnyToken` remote feature flag from the `confirmation_pay` flag group, allowing it to be toggled server-side without app rebuilds. It fixes naming from `confirmation_pay` to `confirmations_pay`. Also adds `perpsWithdrawAnyToken` to the same selector in preparation for Perps withdraw support. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: MetaMask/MetaMask-planning#6987 ## **Manual testing steps** 1. predictWithdrawAnyToken on, you can see a select box for tokens on the Predict Withdraw page 2. predictWithdrawAnyToken off, you cannot see a select box for tokens on the Predict Withdraw page ## **Screenshots/Recordings** ### **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 - [ ] 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] > **Low Risk** > Small refactor limited to feature-flag plumbing and tests; main risk is misnaming/misconfiguring the remote flag key causing the token picker to be incorrectly enabled/disabled. > > **Overview** > Switches the withdraw token picker gate (`canSelectWithdrawToken`) from the build-time env var `MM_PREDICT_WITHDRAW_ANY_TOKEN` to the remote feature flag `confirmations_pay.predictWithdrawAnyToken`, so it can be toggled without rebuilding. > > Fixes the remote flag group key from `confirmation_pay` to `confirmations_pay`, extends `selectMetaMaskPayFlags` to expose `predictWithdrawAnyToken` and a new `perpsWithdrawAnyToken` (defaulting to `false`), and updates/expands unit tests accordingly; `useTransactionPayPostQuote` docs are updated to match the new flag name. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 14c52df. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
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 : )