From 54465031445c5b8f9c75757284875012e8a35692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Tani=C3=A7a?= Date: Mon, 24 Nov 2025 11:43:26 -0700 Subject: [PATCH 1/4] chore(predict): add env var to skip geoblock (#23204) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** This PR enables setting a new environment variable (`MM_PREDICT_SKIP_GEOBLOCK="true"`) to bypass geo-block restrictions. Geo-blocking still happens at the API level, so this is mostly useful for testing confirmations. ## **Changelog** CHANGELOG entry: null ## **Related issues** 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** ### **Before** ### **After** ## **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 - [ ] I’ve included tests if applicable - [ ] 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. --- > [!NOTE] > Introduce `MM_PREDICT_SKIP_GEOBLOCK` to force eligibility true and set country to `N/A` during `refreshEligibility`. > > - **PredictController** (`app/components/UI/Predict/controllers/PredictController.ts`): > - In `refreshEligibility`, honor env var `MM_PREDICT_SKIP_GEOBLOCK === 'true'` to: > - Force `eligible` to `true`. > - Set `country` to `N/A`. > - Retains local geo-block override logic before env-based bypass. > > Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e43a18689fa6902d5d6861ac3626724822fb735f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot). --- app/components/UI/Predict/controllers/PredictController.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/components/UI/Predict/controllers/PredictController.ts b/app/components/UI/Predict/controllers/PredictController.ts index ca3612fe691..b9375ecd1bd 100644 --- a/app/components/UI/Predict/controllers/PredictController.ts +++ b/app/components/UI/Predict/controllers/PredictController.ts @@ -1660,6 +1660,10 @@ export class PredictController extends BaseController< }); geoBlockResponse.isEligible = !isLocallyGeoblocked; } + if (process.env.MM_PREDICT_SKIP_GEOBLOCK === 'true') { + geoBlockResponse.isEligible = true; + geoBlockResponse.country = 'N/A'; + } this.update((state) => { state.eligibility[providerId] = { eligible: geoBlockResponse.isEligible, From 7457059ebd9a79f7ff488fe0f795499311a5e4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caain=C3=A3=20Jeronimo?= Date: Mon, 24 Nov 2025 16:48:59 -0300 Subject: [PATCH 2/4] fix(predict): cp-7.60.0 improve spacing and styling in Predict components (#23207) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Adjust gaps, text sizes, and badge styling in PredictBalance and PredictPositionsHeader for better visual consistency and hierarchy. ## **Changelog** CHANGELOG entry: null ## **Related issues** 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** ### **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. --- > [!NOTE] > Adjusts gaps, text sizes, skeleton rounding, and adds a muted badge border in PredictBalance; adds small spacing between balance value and arrow in PredictPositionsHeader. > > - **PredictBalance (`PredictBalance.tsx`)**: > - Increase button/skeleton gap from `gap-2` to `gap-3`; change skeleton rounding from `rounded-full` to `rounded-xl`. > - Update balance typography from `text-heading-md` to `text-body-md`; add `text-body-sm` to subtitle. > - Add `border-background-muted` to network `Badge`. > - **PredictPositionsHeader (`PredictPositionsHeader.tsx`)**: > - Add `gap-1` between balance text and arrow icon in the header row. > > Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 61687f5ecb290488a1744d4f955bb715e8bf04c0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot). --- .../components/PredictBalance/PredictBalance.tsx | 13 +++++++------ .../PredictPositionsHeader.tsx | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/components/UI/Predict/components/PredictBalance/PredictBalance.tsx b/app/components/UI/Predict/components/PredictBalance/PredictBalance.tsx index f1dab7ebe37..b49291703c7 100644 --- a/app/components/UI/Predict/components/PredictBalance/PredictBalance.tsx +++ b/app/components/UI/Predict/components/PredictBalance/PredictBalance.tsx @@ -98,16 +98,16 @@ const PredictBalance: React.FC = ({ onLayout }) => { - + @@ -145,11 +145,11 @@ const PredictBalance: React.FC = ({ onLayout }) => { alignItems={BoxAlignItems.Center} > - + {formatPrice(balance, { maximumDecimals: 2 })} {strings('predict.available_balance')} @@ -162,6 +162,7 @@ const PredictBalance: React.FC = ({ onLayout }) => { } @@ -173,7 +174,7 @@ const PredictBalance: React.FC = ({ onLayout }) => { /> - +