Skip to content

feat(predict): cp-7.62.0 integrate UI components into game details view#24595

Merged
matallui merged 2 commits intomainfrom
predict/game-details
Jan 15, 2026
Merged

feat(predict): cp-7.62.0 integrate UI components into game details view#24595
matallui merged 2 commits intomainfrom
predict/game-details

Conversation

@matallui
Copy link
Copy Markdown
Contributor

@matallui matallui commented Jan 15, 2026

Description

This PR integrates the visual UI components into PredictGameDetailsContent for the Live NFL Sports feature in Prediction Markets. The changes add team gradient backgrounds, a live scoreboard, price history chart, and user positions section to the game details screen.

What changed:

  • Wrapped component with PredictSportTeamGradient for team-colored backgrounds
  • Added PredictSportScoreboard at top showing game state, scores, and possession
  • Added PredictGameChart below scoreboard for price history visualization
  • Added PredictPicks section showing user positions with Cash Out functionality
  • Passed team colors to footer for gradient background
  • Added guards for undefined market.game and empty outcomes

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/PRED-481

Manual testing steps

Feature: Game Details View Integration

  Scenario: user views game details for an NFL game
    Given user is on the Predict market list screen
    And there is an NFL game market available

    When user taps on the NFL game market
    Then user sees the game details screen with:
      - Team-colored gradient background
      - Scoreboard showing team abbreviations and scores
      - Price history chart with team colors
      - "Your picks" section (if user has positions)
      - Footer with team betting buttons

  Scenario: user views scoreboard during live game
    Given user is viewing game details for an in-progress game
    
    When the game status is "ongoing"
    Then scoreboard displays current quarter and time
    And scoreboard shows possession indicator
    And scores update in real-time

  Scenario: user cashes out a position
    Given user is viewing game details
    And user has an open position

    When user taps "Cash out" button
    Then user is navigated to the sell preview screen

Screenshots/Recordings

Before

N/A - New feature integration

After

Screenshot 2026-01-15 at 3 48 47 PM

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

Integrates core game UI into PredictGameDetailsContent and enhances footer styling/behavior.

  • Wraps content with PredictSportTeamGradient and passes team colors to PredictGameDetailsFooter (conditional gradient rendering)
  • Adds PredictSportScoreboard with derived gameState, possession, and winner; formats date/time from startTime
  • Renders PredictGameChart when exactly two token IDs exist; adds PredictPicks section
  • Guards: return null when market.game is missing or outcomes is empty
  • Updates tests and snapshot to cover gradient, scoreboard states, chart visibility, picks, and footer gradient conditions

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

…tails

- Wrap PredictGameDetailsContent with PredictSportTeamGradient
- Add PredictSportScoreboard at top of ScrollView with game state logic
- Add PredictGameChart below scoreboard with token IDs
- Pass team colors to footer for gradient background
- Add guard for undefined market.game
- Fix React hooks exhaustive-deps warning in tokenIds useMemo
- Add PredictPicks component below chart section
- Shows user positions with Cash Out functionality
- Matches Figma design for 'Your picks' section
@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.

@metamaskbot metamaskbot added the team-predict Predict team label Jan 15, 2026
@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

The changes are entirely contained within the Predict feature components (PredictGameDetailsContent and PredictGameDetailsFooter). The modifications add UI enhancements including:

  1. Team gradient backgrounds using PredictSportTeamGradient
  2. Scoreboard display with game state, possession, and winner logic
  3. Game chart integration
  4. Picks component integration
  5. New props for team colors (awayColor, homeColor)

All changes are isolated to the Predictions feature with no impact on core wallet functionality, controllers, Engine, or other features. The unit tests have been updated to cover the new functionality. The SmokePredictions tag is the appropriate and only necessary tag to run, as it covers the prediction markets E2E tests that would validate these UI changes.

View GitHub Actions results

@matallui matallui marked this pull request as ready for review January 15, 2026 22:49
@matallui matallui requested a review from a team as a code owner January 15, 2026 22:49
},
]}
testID="game-chart"
/>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Chart series config order mismatched with token order

Medium Severity

The seriesConfig array is hardcoded as [awayTeam, homeTeam], but tokenIds is derived from outcome.tokens in whatever order they appear from the API. The PredictGameChart component maps seriesConfig[index] directly to tokenIds[index], so if the token order doesn't match [away, home], the chart will display swapped team colors. Looking at the test data, tokens are ordered [Team A, Team B] where Team A is homeTeam and Team B is awayTeam, causing the home team's price data to render with the away team's color.

Fix in Cursor Fix in Web

gameState={gameState}
eventTitle={market.title}
date={gameDateTime?.date}
time={gameDateTime?.time}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Elapsed game time not passed during live games

Medium Severity

The scoreboard receives time={gameDateTime?.time} which is always the game's start time (e.g., "8:00 PM EST"). During live games (InProgress state), the scoreboard displays {quarter} • {time}, so it would incorrectly show "Q2 • 8:00 PM EST" instead of the elapsed game clock "Q2 • 5:30". The game.elapsed field contains the actual game clock time but is never passed to the scoreboard component.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Contributor

@caieu caieu left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud
Copy link
Copy Markdown

@matallui
Copy link
Copy Markdown
Contributor Author

Getting this merged to complete the UI integration and will address bugs in separate PRs.

@matallui matallui enabled auto-merge January 15, 2026 23:19
@matallui matallui changed the title feat(predict): integrate UI components into game details view feat(predict): cp-7.62.0 integrate UI components into game details view Jan 15, 2026
@matallui matallui added this pull request to the merge queue Jan 15, 2026
Merged via the queue into main with commit df3e6ba Jan 15, 2026
110 checks passed
@matallui matallui deleted the predict/game-details branch January 15, 2026 23:48
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Jan 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.63.0 Issue or pull request that will be included in release 7.63.0 size-L team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants