Commit ae26186
chore(runway): cherry-pick fix(predict): add extended sports market support for more leagues cp-7.79.0 (#30566)
- fix(predict): add extended sports market support for more leagues
cp-7.79.0 (#30559)
## **Description**
Adds Predict live sports and extended-market support for additional
basketball, baseball, hockey, soccer, and tennis leagues. This expands
league parsing and supported flag filtering so newly enabled Polymarket
game events can render as game detail experiences instead of generic
markets.
This also fixes several extended sports details issues found while
validating the new leagues:
- Parses WNBA, MLB, NHL, ATP, WTA, and ITF game slugs and tennis
provider metadata.
- Uses tennis `series` and team metadata when ATP/WTA/ITF events only
include generic tennis tags.
- Keeps extended game charts on the primary moneyline outcome so World
Cup and other draw-capable markets load correctly.
- Opens extended market cards through the bottom-sheet buy flow instead
of the legacy full-screen buy preview.
- Adds loading-only chart height reservation to avoid the game details
footer jumping while the chart loads.
- Adds tennis market labels and separates tennis cards into `Game Lines`
and `1st Set` groups.
- Aligns footer and card outcome labels, order, and team colors for
tennis moneyline and first-set winner markets.
## **Changelog**
CHANGELOG entry: Added support for additional Predict sports leagues and
extended sports market details.
## **Related issues**
Fixes: PRED-925 https://consensyssoftware.atlassian.net/browse/PRED-925
## **Manual testing steps**
```gherkin
Feature: Predict extended sports markets for newly supported leagues
Scenario: user opens supported game detail markets
Given Predict live sports is enabled for WNBA, MLB, NHL, ATP, WTA, and ITF
And Predict extended sports markets is enabled for NBA, WNBA, MLB, NHL, World Cup, UCL, EPL, La Liga, Serie A, Bundesliga, MLS, FIFA Friendlies, ATP, WTA, and ITF
When the user opens a supported game market
Then the market renders as a game details view
And the chart loads from the primary moneyline market
And the footer prices match the primary moneyline outcomes
Scenario: user opens an ATP, WTA, or ITF tennis game
Given the event has generic Tennis and Games tags
And the event has ATP, WTA, or ITF league metadata in series or teams
When the user opens the game details view
Then the event is parsed into the correct tennis league
And the tabs show Game Lines and 1st Set
And tennis market cards show translated labels
And the 1st Set Winner buttons use the same team colors as the footer
Scenario: user selects an extended sports market card
Given the extended sports market cards are visible
When the user taps a card outcome
Then the bottom-sheet buy flow opens for that outcome
And the app does not navigate to the legacy full-screen buy preview
```
## **Automated testing**
- `node .yarn/releases/yarn-4.14.1.cjs jest
app/components/UI/Predict/utils/gameParser.test.ts
app/components/UI/Predict/constants/sports.test.ts
app/components/UI/Predict/providers/polymarket/utils.test.ts
app/components/UI/Predict/components/PredictActionButtons/PredictActionButtons.test.tsx
app/components/UI/Predict/components/PredictGameChart/PredictGameChart.test.tsx
app/components/UI/Predict/components/PredictGameChart/PredictGameChart.wrapper.test.tsx
app/components/UI/Predict/components/PredictGameDetailsContent/PredictGameDetailsTabsContent.test.tsx
app/components/UI/Predict/components/PredictGameDetailsContent/PredictGameOutcomesTab.test.tsx
app/components/UI/Predict/components/PredictMarketSportCard/PredictMarketSportCard.test.tsx`
- 9 test suites passed
- 288 tests passed
- `node .yarn/releases/yarn-4.14.1.cjs lint:tsc`
## **Screenshots/Recordings**
### **Before**
N/A - no recordings attached in this local PR draft.
### **After**
N/A - no recordings attached in this local PR draft.
## **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.
#### Performance checks (if applicable)
- [x] I've tested on Android
- N/A - no Android-specific or performance-sensitive native path
changed.
- [x] I've tested with a power user scenario
- N/A - Predict sports details rendering does not depend on imported
wallet size.
- [x] I've instrumented key operations with Sentry traces for production
performance metrics
- N/A - no new production performance operation was added.
For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).
## **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**
> Medium risk because it changes how sports leagues are
detected/whitelisted and how UI components select outcome tokens
(primary moneyline vs extended markets), which can affect navigation,
pricing subscriptions, and displayed teams across multiple sport
experiences.
>
> **Overview**
> Extends Predict live/extended sports support to additional leagues
(WNBA/MLB/NHL and tennis `atp`/`wta`/`itf`), including updated league
whitelisting/types and more robust league detection from event
`series`/team metadata when tags are missing.
>
> Standardizes **"primary" moneyline selection** via
`getPrimaryMoneylineOutcomes`, and updates the footer buttons, market
sport cards, and game charts to ignore non-moneyline extended outcomes
(especially for draw-capable leagues) and to map tennis/home-away tokens
to the correct team labels/colors.
>
> Improves game details UX by routing outcomes-tab buys through the
shared `onBetPress` bottom-sheet flow (instead of navigation) and
reserving chart height only while loading to avoid layout jump; adds
tennis group ordering/labels (e.g., `first_set`) and corresponding i18n
strings.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c2a0122. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
[788641c](788641c)
Co-authored-by: Caainã Jeronimo <caainaje@gmail.com>1 parent 06135e3 commit ae26186
22 files changed
Lines changed: 1118 additions & 87 deletions
File tree
- app/components/UI/Predict
- components
- PredictActionButtons
- PredictGameChart
- PredictGameDetailsContent
- PredictMarketSportCard
- constants
- providers/polymarket
- types
- utils
- locales/languages
Lines changed: 117 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
319 | 393 | | |
320 | 394 | | |
321 | 395 | | |
| |||
379 | 453 | | |
380 | 454 | | |
381 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
382 | 499 | | |
383 | 500 | | |
384 | 501 | | |
| |||
Lines changed: 73 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
| |||
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
32 | 71 | | |
33 | 72 | | |
34 | 73 | | |
| |||
45 | 84 | | |
46 | 85 | | |
47 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
48 | 99 | | |
49 | 100 | | |
50 | 101 | | |
51 | 102 | | |
52 | 103 | | |
53 | | - | |
| 104 | + | |
54 | 105 | | |
55 | 106 | | |
56 | 107 | | |
57 | 108 | | |
58 | 109 | | |
59 | | - | |
| 110 | + | |
60 | 111 | | |
61 | 112 | | |
62 | | - | |
| 113 | + | |
63 | 114 | | |
64 | 115 | | |
65 | 116 | | |
| |||
68 | 119 | | |
69 | 120 | | |
70 | 121 | | |
71 | | - | |
72 | | - | |
| 122 | + | |
| 123 | + | |
73 | 124 | | |
74 | 125 | | |
75 | 126 | | |
| |||
110 | 161 | | |
111 | 162 | | |
112 | 163 | | |
113 | | - | |
| 164 | + | |
114 | 165 | | |
115 | 166 | | |
116 | 167 | | |
| |||
126 | 177 | | |
127 | 178 | | |
128 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
129 | 183 | | |
130 | | - | |
| 184 | + | |
131 | 185 | | |
132 | | - | |
| 186 | + | |
133 | 187 | | |
134 | | - | |
| 188 | + | |
135 | 189 | | |
136 | | - | |
| 190 | + | |
137 | 191 | | |
138 | 192 | | |
139 | 193 | | |
| |||
148 | 202 | | |
149 | 203 | | |
150 | 204 | | |
151 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
152 | 212 | | |
153 | 213 | | |
154 | 214 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
316 | 346 | | |
317 | 347 | | |
318 | 348 | | |
| |||
Lines changed: 14 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
79 | 86 | | |
80 | | - | |
| 87 | + | |
81 | 88 | | |
82 | | - | |
| 89 | + | |
83 | 90 | | |
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
89 | | - | |
| 96 | + | |
90 | 97 | | |
91 | | - | |
| 98 | + | |
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
95 | | - | |
| 102 | + | |
96 | 103 | | |
97 | 104 | | |
98 | 105 | | |
| |||
103 | 110 | | |
104 | 111 | | |
105 | 112 | | |
106 | | - | |
| 113 | + | |
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
| |||
0 commit comments