Skip to content

Conversation

@andrepimenta
Copy link
Member

@andrepimenta andrepimenta commented Nov 17, 2025

Pull Request Description

Description

This PR adds a deep link handler for the Predict page, enabling redirection from https://link.metamask.io/predict to https://metamask.io/prediction-markets with query parameter preservation.

redirect-predict.mov

Changelog

CHANGELOG entry: Update Predict deeplink handler

Related issues

Fixes:

Manual testing steps

  1. Go to https://link.metamask.io/predict
  2. Should be routed to https://metamask.io/prediction-markets
  3. Test with query parameters: https://link.metamask.io/predict?param=value
  4. Verify parameters are preserved in the redirect: https://metamask.io/prediction-markets?param=value

Screenshots/Recordings

Before

N/A - New feature

After

N/A - Redirect functionality (no UI changes)

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs and MetaMask Extension Coding Standards.
  • 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 format if applicable
  • I've applied the right labels on the PR (see labeling guidelines). 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.

Technical Details

Files Changed

  1. shared/lib/deep-links/routes/predict.ts (modified)

    • Route handler for /predict path
    • Redirects to https://metamask.io/prediction-markets
    • Preserves all query parameters from original URL
  2. test/e2e/tests/deep-link/deep-link.spec.ts (modified)

    • Updated E2E test: handles /predict route redirect
    • Tests both signed and unsigned deep link flows
    • Verifies redirect to https://metamask.io/prediction-markets
  3. app/_locales/en/messages.json (modified)

    • Updated deepLink_thePredictPage localization key
    • Message: "the prediction markets page"
  4. app/_locales/en_GB/messages.json (modified)

    • Updated deepLink_thePredictPage localization key
    • Message: "the prediction markets page"

Implementation Pattern

This implementation follows the same pattern as the existing perps deep link handler (PR #35817):

  • Uses the Route class with pathname, title, and handler
  • Leverages BaseUrl.MetaMask constant for redirect target
  • Preserves query parameters using URLSearchParams
  • Includes comprehensive E2E test coverage

Test Coverage

The E2E test verifies:

  • ✅ Signed deep link flow redirects correctly
  • ✅ Unsigned deep link flow redirects correctly
  • ✅ Target URL matches expected https://metamask.io/prediction-markets
  • ✅ User can access the page after authentication

Notes for Reviewers

  • This is a straightforward deep link redirect similar to the perps handler
  • No new dependencies added
  • No breaking changes
  • Query parameters are preserved in the redirect
  • Localization keys follow existing naming convention

Note

Redirects the /predict deep link to MetaMask/prediction-markets with query params preserved, updating i18n text and e2e tests.

  • Deep Links:
    • Update route in shared/lib/deep-links/routes/predict.ts to redirect /predict -> /prediction-markets (preserves query params).
  • Tests:
    • Adjust e2e expectations in test/e2e/tests/deep-link/deep-link.spec.ts to wait for ${BaseUrl.MetaMask}/prediction-markets for both signed and unsigned flows.
  • Localization:
    • Update deepLink_thePredictPage message to "the prediction markets page" in app/_locales/en/messages.json and app/_locales/en_GB/messages.json.

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

- Change redirect destination from /predict to /prediction-markets
- Update E2E test to verify redirect to metamask.io/prediction-markets
- Keep predict route handler name and localization keys consistent
@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label Nov 17, 2025
@andrepimenta andrepimenta added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed team-predict Predict team labels Nov 17, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [7ca6adb]
UI Startup Metrics (1177 ± 104 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1177996153910412401383
load101085912679010771163
domContentLoaded100485412448910691157
domInteractive221476161871
firstPaint677109128140110341145
backgroundConnect19917927111203221
firstReactRender30196093749
getState21877112642
initialActions107112
loadScripts811675103987877952
setupStore1172331318
numNetworkReqs1367520672
BrowserifyPower User HomeuiStartup20391805267426022292674
load1029872147620212811476
domContentLoaded1009854145920512731459
domInteractive501713745113137
firstPaint69421113783869091378
backgroundConnect20018324014204240
firstReactRender75431362385136
getState21415333752246337
initialActions113123
loadScripts832686127019710861270
setupStore301574174674
numNetworkReqs1299819937186199
WebpackStandard HomeuiStartup84870113641138511135
load61856095784612867
domContentLoaded61155494481608846
domInteractive191283151561
firstPaint21757948222210754
backgroundConnect251166133359
firstReactRender322079103648
getState1163541317
initialActions102111
loadScripts60855293479606835
setupStore1163641316
numNetworkReqs1367919870
WebpackPower User HomeuiStartup1034850172228012791722
load620531936141773936
domContentLoaded600518895128734895
domInteractive36121434185143
firstPaint31361899273545899
backgroundConnect55171845959184
firstReactRender39374414044
getState1257914322138143
initialActions101011
loadScripts596516887126726887
setupStore96275827
numNetworkReqs856314029132140
FirefoxBrowserifyStandard HomeuiStartup15621389204313316011865
load1308117715609213531515
domContentLoaded1308117715599213531514
domInteractive59352123962159
firstPaint------
backgroundConnect45261532449107
firstReactRender29235663043
getState147225221326
initialActions208122
loadScripts1281115915008413231475
setupStore1475881331
numNetworkReqs1266416760
BrowserifyPower User HomeuiStartup31802463462457832734624
load15331265202223618262022
domContentLoaded15331265202223618262022
domInteractive25586672182419672
firstPaint------
backgroundConnect5118811673087751167
firstReactRender90721241397124
getState1789729254217292
initialActions214124
loadScripts14861238194822717941948
setupStore1054517337135173
numNetworkReqs1246924155173241
WebpackStandard HomeuiStartup16101454227513016341929
load13661215170910314031624
domContentLoaded13661215170910314021624
domInteractive54301482563108
firstPaint------
backgroundConnect4618127205197
firstReactRender322582103246
getState127192181216
initialActions103122
loadScripts1338120016799613691580
setupStore14753111340
numNetworkReqs1266616760
WebpackPower User HomeuiStartup31622503404744435274047
load16341458214721418002147
domContentLoaded16331458214721317992147
domInteractive21486491149364491
firstPaint------
backgroundConnect342102791217546791
firstReactRender894713820106138
getState233105578127321578
initialActions213123
loadScripts15821406210620517182106
setupStore873020047124200
numNetworkReqs1287023757197237
📊 Page Load Benchmark Results

Current Commit: 7ca6adb | Date: 11/17/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±52ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 749ms (±74ms) 🟢 | historical mean value: 728ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 93ms (±143ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 52ms 1.03s 1.52s 1.09s 1.52s
domContentLoaded 749ms 74ms 714ms 1.44s 763ms 1.44s
firstPaint 93ms 143ms 64ms 1.52s 92ms 1.52s
firstContentfulPaint 93ms 143ms 64ms 1.52s 92ms 1.52s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 53 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 31 Bytes (0%)

- Add deepLink_thePredictPage localization key (en, en_GB)
- Update message to 'the prediction markets page'
- Fix Prettier formatting in deep-link E2E test
@github-actions github-actions bot added size-S and removed size-XS labels Nov 17, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [32ff11b]
UI Startup Metrics (1138 ± 110 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1138958158711011921346
load97382414009810271113
domContentLoaded96681613969710221102
domInteractive2314146201872
firstPaint5607612583909671084
backgroundConnect18617224912188210
firstReactRender25194862740
getState20781112345
initialActions103112
loadScripts787632120696851919
setupStore1063131014
numNetworkReqs1367720673
BrowserifyPower User HomeuiStartup21711771344736421883447
load1160981194925614061949
domContentLoaded1140964193026013951930
domInteractive56171915699191
firstPaint721199199050010411990
backgroundConnect25423230618258306
firstReactRender805215330100153
getState23114752284237522
initialActions104114
loadScripts907736163724711731637
setupStore27765123265
numNetworkReqs1239318433165184
WebpackStandard HomeuiStartup8517171200938611029
load61857095274619771
domContentLoaded61056393071611757
domInteractive181274131557
firstPaint20361915180212589
backgroundConnect261183142958
firstReactRender3520162203761
getState1173031317
initialActions101011
loadScripts60756192069608746
setupStore1263451324
numNetworkReqs1367519870
WebpackPower User HomeuiStartup1114933190824913081908
load69458210581478421058
domContentLoaded67957110091398231009
domInteractive38141283773128
firstPaint38311010143288271014
backgroundConnect53142916677291
firstReactRender42395034450
getState1489918025161180
initialActions101011
loadScripts674569998136812998
setupStore97162816
numNetworkReqs80641382290138
FirefoxBrowserifyStandard HomeuiStartup14541299193713314771763
load1227111915069212541425
domContentLoaded1227111915069212531425
domInteractive52321893252151
firstPaint------
backgroundConnect4226140214794
firstReactRender27225562842
getState1174051121
initialActions207122
loadScripts1201108214788812331391
setupStore1375581228
numNetworkReqs1266215758
BrowserifyPower User HomeuiStartup32102632440253734834402
load15191314193120417591931
domContentLoaded15191313193120417591931
domInteractive24390622180491622
firstPaint------
backgroundConnect5229011773568451177
firstReactRender865811517100115
getState17810230453201304
initialActions224134
loadScripts14731259190921017341909
setupStore14333517157148517
numNetworkReqs1276823458216234
WebpackStandard HomeuiStartup16741496238914816962008
load14161239183010814631649
domContentLoaded14161238182910914631649
domInteractive61302113366137
firstPaint------
backgroundConnect52272002855124
firstReactRender35268283844
getState13857101351
initialActions203123
loadScripts1383122117529814291576
setupStore198222251357
numNetworkReqs1366817762
WebpackPower User HomeuiStartup30562512371228932503712
load16601341194616117891946
domContentLoaded16591341194516017881945
domInteractive23089527128347527
firstPaint------
backgroundConnect369127954233526954
firstReactRender926214321107143
getState1598928446182284
initialActions213123
loadScripts16141307187915117291879
setupStore105204389599438
numNetworkReqs1277218837161188
📊 Page Load Benchmark Results

Current Commit: 32ff11b | Date: 11/17/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±51ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 719ms (±48ms) 🟢 | historical mean value: 729ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±11ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 51ms 1.00s 1.31s 1.05s 1.31s
domContentLoaded 719ms 48ms 692ms 991ms 733ms 991ms
firstPaint 76ms 11ms 60ms 172ms 84ms 172ms
firstContentfulPaint 76ms 11ms 60ms 172ms 84ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 53 Bytes (0%)
  • ui: 5.64 KiB (0.08%)
  • common: 649 Bytes (0.01%)

@omnat omnat changed the title feat: Update predict deep link to redirect to /prediction-markets cp-13.10.0. feat: Update predict deep link to redirect to /prediction-markets Nov 18, 2025
@matallui matallui changed the title cp-13.10.0. feat: Update predict deep link to redirect to /prediction-markets fix(predict): cp-13.10.0 Update predict deep link to redirect to /prediction-markets Nov 18, 2025
@andrepimenta andrepimenta added this pull request to the merge queue Nov 19, 2025
},
"deepLink_thePredictPage": {
"message": "the predict page"
"message": "the prediction markets page"
Copy link
Contributor

@DDDDDanica DDDDDanica Nov 19, 2025

Choose a reason for hiding this comment

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

Just a quick note: translations in other languages won’t be available immediately. The safest fix is to create a new label/key and remove the existing non-English mappings so the fallback displays correct English. If this change is not too contradictory/disruptive for the current release, we can keep the current approach and wait for the translations to land 🙏🏻

Merged via the queue into main with commit e627234 Nov 19, 2025
183 of 184 checks passed
@andrepimenta andrepimenta deleted the fix/update-predict-link branch November 19, 2025 10:44
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2025
@metamaskbot metamaskbot added the release-13.11.0 Issue or pull request that will be included in release 13.11.0 label Nov 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-13.11.0 Issue or pull request that will be included in release 13.11.0 size-S team-mobile-platform Mobile Platform team team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants