Skip to content

fix(predict): add extended sports market support for more leagues cp-7.79.0#30559

Merged
matallui merged 6 commits into
mainfrom
predict/add-more-leagues
May 22, 2026
Merged

fix(predict): add extended sports market support for more leagues cp-7.79.0#30559
matallui merged 6 commits into
mainfrom
predict/add-more-leagues

Conversation

@caieu

@caieu caieu commented May 21, 2026

Copy link
Copy Markdown
Contributor

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

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

Performance checks (if applicable)

  • I've tested on Android
    • N/A - no Android-specific or performance-sensitive native path changed.
  • I've tested with a power user scenario
    • N/A - Predict sports details rendering does not depend on imported wallet size.
  • 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.

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

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.

Reviewed by Cursor Bugbot for commit c2a0122. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbotv2 metamaskbotv2 Bot added the team-predict Predict team label May 21, 2026
@caieu caieu changed the title feat(predict): add extended sports market support for more leagues feat(predict): add extended sports market support for more leagues cp-7.79.0 May 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 22 changed files are within the Predict/Polymarket feature area (app/components/UI/Predict/) plus locales/languages/en.json.

Key changes:

  1. New sports leagues: WNBA, MLB, NHL (team sports) and ATP, WTA, ITF (tennis) added to PredictSportsLeague type, SUPPORTED_SPORTS_LEAGUES, and LEAGUE_SLUG_CONFIGS game parser patterns.
  2. Tennis market types: New constants for tennis_first_set_winner, tennis_first_set_totals, etc. added to SPORTS_MARKET_TYPE_TO_GROUP, GROUP_ORDER, and SPORTS_MARKET_TYPE_PRIORITIES.
  3. getPrimaryMoneylineOutcomes utility: New function that filters outcomes to primary moneyline outcomes, used in PredictActionButtons, PredictGameChart, and PredictMarketSportCard to correctly handle markets with multiple outcome types (e.g., tennis markets with both moneyline and set totals).
  4. Team color matching improvement: getTeamColor now uses fuzzy matching (abbreviation, name, alias) instead of exact abbreviation match - fixes display issues for tennis players where names don't match abbreviations.
  5. PredictGameDetailsTabsContent refactor: Removed internal navigation hooks (useNavigation, usePredictActionGuard, usePredictNavigation), now accepts onBetPress callback from parent - this is a prop interface change that could affect the betting flow.
  6. Localization: Added strings for new tennis market types, "1st Set" group, and "nrfi" (baseball).

Tag selection rationale:

  • SmokePredictions: Direct impact - changes to core prediction market UI components (action buttons, game charts, sport cards, game details tabs). The onBetPress prop change in PredictGameDetailsTabsContent is a behavioral change that could affect the position opening flow.
  • SmokeWalletPlatform: Required per SmokePredictions tag description - "Predictions is also a section inside the Trending tab (SmokeWalletPlatform)".
  • SmokeConfirmations: Required per SmokePredictions tag description - "opening/closing positions are on-chain transactions - also select SmokeConfirmations".

Performance Test Selection:
Changes are limited to Predict UI component logic improvements (better outcome filtering with getPrimaryMoneylineOutcomes, improved team color matching, new sports league support). These are functional correctness fixes rather than performance-impacting changes. No changes to rendering loops, list components, data fetching patterns, or performance test infrastructure. The @PerformancePredict tag could theoretically apply but the changes don't introduce new rendering complexity or data loading patterns that would meaningfully impact performance metrics.

View GitHub Actions results

@caieu caieu changed the title feat(predict): add extended sports market support for more leagues cp-7.79.0 fix(predict): add extended sports market support for more leagues cp-7.79.0 May 21, 2026
@caieu caieu marked this pull request as ready for review May 21, 2026 23:01
@caieu caieu requested a review from a team as a code owner May 21, 2026 23:01
@sonarqubecloud

Copy link
Copy Markdown

@caieu caieu added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label May 22, 2026
@matallui matallui added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 788641c May 22, 2026
333 of 352 checks passed
@matallui matallui deleted the predict/add-more-leagues branch May 22, 2026 03:51
@github-actions github-actions Bot locked and limited conversation to collaborators May 22, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.80.0 Issue or pull request that will be included in release 7.80.0 label May 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.80.0 Issue or pull request that will be included in release 7.80.0 size-XL skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants