-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix(predict): cp-13.10.0 Update predict deep link to redirect to /prediction-markets #37907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 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
Builds ready [7ca6adb]
UI Startup Metrics (1177 ± 104 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
- Add deepLink_thePredictPage localization key (en, en_GB) - Update message to 'the prediction markets page' - Fix Prettier formatting in deep-link E2E test
Builds ready [32ff11b]
UI Startup Metrics (1138 ± 110 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| }, | ||
| "deepLink_thePredictPage": { | ||
| "message": "the predict page" | ||
| "message": "the prediction markets page" |
There was a problem hiding this comment.
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 🙏🏻
Pull Request Description
Description
This PR adds a deep link handler for the Predict page, enabling redirection from
https://link.metamask.io/predicttohttps://metamask.io/prediction-marketswith query parameter preservation.redirect-predict.mov
Changelog
CHANGELOG entry: Update Predict deeplink handler
Related issues
Fixes:
Manual testing steps
https://link.metamask.io/predicthttps://metamask.io/prediction-marketshttps://link.metamask.io/predict?param=valuehttps://metamask.io/prediction-markets?param=valueScreenshots/Recordings
Before
N/A - New feature
After
N/A - Redirect functionality (no UI changes)
Pre-merge author checklist
Pre-merge reviewer checklist
Technical Details
Files Changed
shared/lib/deep-links/routes/predict.ts(modified)/predictpathhttps://metamask.io/prediction-marketstest/e2e/tests/deep-link/deep-link.spec.ts(modified)handles /predict route redirecthttps://metamask.io/prediction-marketsapp/_locales/en/messages.json(modified)deepLink_thePredictPagelocalization keyapp/_locales/en_GB/messages.json(modified)deepLink_thePredictPagelocalization keyImplementation Pattern
This implementation follows the same pattern as the existing perps deep link handler (PR #35817):
Routeclass with pathname, title, and handlerBaseUrl.MetaMaskconstant for redirect targetURLSearchParamsTest Coverage
The E2E test verifies:
https://metamask.io/prediction-marketsNotes for Reviewers
Note
Redirects the
/predictdeep link toMetaMask/prediction-marketswith query params preserved, updating i18n text and e2e tests.shared/lib/deep-links/routes/predict.tsto redirect/predict->/prediction-markets(preserves query params).test/e2e/tests/deep-link/deep-link.spec.tsto wait for${BaseUrl.MetaMask}/prediction-marketsfor both signed and unsigned flows.deepLink_thePredictPagemessage to "the prediction markets page" inapp/_locales/en/messages.jsonandapp/_locales/en_GB/messages.json.Written by Cursor Bugbot for commit 32ff11b. This will update automatically on new commits. Configure here.