Skip to content

feat(predict): cp-7.62.0 adds PredictMarketSportCard#24601

Merged
kevinbluer merged 9 commits intomainfrom
feat/predict-nft-game-card
Jan 16, 2026
Merged

feat(predict): cp-7.62.0 adds PredictMarketSportCard#24601
kevinbluer merged 9 commits intomainfrom
feat/predict-nft-game-card

Conversation

@kevinbluer
Copy link
Copy Markdown
Contributor

@kevinbluer kevinbluer commented Jan 15, 2026

Description

This PR implements the sports market card component and refactors the scoreboard to derive UI state from API data for the Predict feature.

Key changes:

  • PredictMarketSportCard - New component displaying sports betting markets with team gradient backgrounds, integrated scoreboard, and dynamic team data (colors, abbreviations)
  • PredictSportScoreboard refactor - Updated to use centralized types (PredictGameStatus, PredictSportTeam) and derive possession/winner state from props:
    • turn prop (team abbreviation) determines possession indicator
    • Scores determine winner display when game is final
    • Supports 4 UI states: Pre-game (scheduled), In-progress (ongoing), Halftime (ongoing + period: 'HT'), Final (ended)
  • formatGameStartTime - New utility function for locale-aware date/time formatting of ISO 8601 strings
  • Type consolidation - Removed PredictSportScoreboard.types.ts in favor of centralized types in types/index.ts
  • Test coverage - Added comprehensive tests for PredictMarketSportCard, formatGameStartTime, and updated PredictSportScoreboard tests

Architecture improvement:
The scoreboard component now derives UI state (possession, winner) internally from API data (turn, awayScore, homeScore) rather than requiring parent components to compute and pass these values. This reduces coupling and makes the component easier to use with real API responses.

Changelog

CHANGELOG entry: null

Related issues

Fixes: PRED-482

Manual testing steps

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

image image image

Pre-merge author checklist

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

Implements a new sports market card and simplifies scoreboard integration by deriving UI state directly from API data.

  • Adds PredictMarketSportCard showing title, gradient, PredictSportScoreboard, conditional action buttons, and navigation; uses formatGameStartTime for date/time
  • Refactors PredictSportScoreboard to accept gameStatus, period, and turn, deriving PreGame/InProgress/Halftime/Final, possession, and winner internally; removes PredictSportScoreboard.types.ts and re-exports props from implementation
  • Updates PredictGameDetailsContent to pass gameStatus, period, and turn (removes local game state/possession/winner computations)
  • Adds formatGameStartTime utility with tests; adds comprehensive tests for the new card and updated scoreboard

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

@metamaskbot metamaskbot added the team-predict Predict team label Jan 15, 2026
@kevinbluer kevinbluer marked this pull request as ready for review January 15, 2026 23:50
@kevinbluer kevinbluer requested a review from a team as a code owner January 15, 2026 23:50
@kevinbluer kevinbluer changed the title feat(predict): Add PredictMarketSportCard feat(predict): cp-7.62.0 adds PredictMarketSportCard Jan 15, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

…tMarketSportCard and PredictSportScoreboard components
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@kevinbluer kevinbluer added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jan 16, 2026
@kevinbluer kevinbluer enabled auto-merge January 16, 2026 16:17
@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.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

This PR contains changes exclusively within the Predict feature (prediction markets) in the app/components/UI/Predict/ directory. The changes include:

  1. Refactoring PredictSportScoreboard component: Changed the API from using pre-computed enums (GameState, Possession, Winner) to accepting raw data (gameStatus, period, turn) and deriving the UI state internally. This is a clean refactoring that simplifies the component interface.

  2. New PredictMarketSportCard component: A new UI component for displaying sports prediction market cards that uses the refactored scoreboard component.

  3. Updated PredictGameDetailsContent: Adapted to use the new PredictSportScoreboard API.

  4. New utility function: Added formatGameStartTime for formatting game start times.

  5. Comprehensive unit tests: All changes include corresponding unit test updates and new tests.

The changes are:

  • Self-contained within the Predict feature
  • Well-tested with unit tests
  • A refactoring that simplifies the component API without changing functionality
  • Not touching any critical infrastructure, controllers, or core wallet functionality

The SmokePredictions tag is the appropriate and only necessary tag since all changes are isolated to the predictions feature. No other features or core functionality are affected.

View GitHub Actions results

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

>
<PredictSportTeamGradient
awayColor={market.game?.awayTeam.color ?? '#1a2942'}
homeColor={market.game?.homeTeam.color ?? '#3d2621'}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inconsistent fallback colors between gradient and scoreboard

Low Severity

The fallback colors used when market.game is undefined differ between PredictSportTeamGradient (lines 105-106: #1a2942 and #3d2621) and PredictSportScoreboard (lines 122, 126: #1D4E9B and #FC4C02). When game data is missing, the gradient background and team helmet colors will be visually mismatched, creating an inconsistent appearance.

Additional Locations (1)

Fix in Cursor Fix in Web

@sonarqubecloud
Copy link
Copy Markdown

@kevinbluer kevinbluer added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit 2984b64 Jan 16, 2026
82 of 83 checks passed
@kevinbluer kevinbluer deleted the feat/predict-nft-game-card branch January 16, 2026 19:06
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Jan 16, 2026
@metamaskbot metamaskbot added release-7.62.0 Issue or pull request that will be included in release 7.62.0 and removed release-7.63.0 Issue or pull request that will be included in release 7.63.0 labels Jan 26, 2026
@metamaskbot
Copy link
Copy Markdown
Collaborator

Missing release label release-7.62.0 on PR. Adding release label release-7.62.0 on PR and removing other release labels(release-7.63.0), as PR was cherry-picked in branch 7.62.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.62.0 Issue or pull request that will be included in release 7.62.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.

3 participants