Skip to content

feat(predict): use PredictPositionDetail in picks for extended sports markets#28696

Merged
matallui merged 3 commits into
mainfrom
predict/PRED-803-phase-3-positions-tab-all-market-type-positions
Apr 13, 2026
Merged

feat(predict): use PredictPositionDetail in picks for extended sports markets#28696
matallui merged 3 commits into
mainfrom
predict/PRED-803-phase-3-positions-tab-all-market-type-positions

Conversation

@caieu

@caieu caieu commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Description

The Predict Picks section (used in game details) currently renders PredictPickItem — a simple row showing "Picked [outcome] at $X" with PnL. For sports markets with extended market types (spreads, totals, player props), we need the richer PredictPositionDetail component that already exists on the regular market details screen, which includes icons, real-time preview values, percentage PnL, privacy mode support, and a full-width cash-out button.

This PR conditionally renders PredictPositionDetail instead of PredictPickItem inside PredictPicks when the market's league is in the extendedSportsMarketsLeagues feature flag — following the same flag pattern used by useGameDetailsTabs. When the flag is disabled (or the market has no game/league), the existing PredictPickItem rendering is preserved.

Also includes a minor cleanup: removes an unnecessary useEffect in useGameDetailsTabs that was resetting activeTab when tabs changed.

Changelog

CHANGELOG entry: null

Related issues

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

Manual testing steps

Feature: PredictPositionDetail in sports prediction picks

  Scenario: user views positions for an extended sports market
    Given the user has open positions on a sports market with a league in extendedSportsMarketsLeagues (e.g. NBA)

    When user navigates to the game details screen
    Then positions are displayed using the rich PredictPositionDetail component
    And each position shows an icon, title, shares info, real-time current value, and percentage PnL
    And each open position has a full-width "Cash out" button

  Scenario: user views positions for a non-extended sports market
    Given the user has open positions on a sports market whose league is NOT in extendedSportsMarketsLeagues

    When user navigates to the game details screen
    Then positions are displayed using the original PredictPickItem component
    And each position shows "Picked [outcome] at $X" format with PnL value

  Scenario: user views positions for a non-sports market
    Given the user has open positions on a non-sports prediction market (no game property)

    When user navigates to the market details screen
    Then positions are displayed using the original PredictPickItem component

Screenshots/Recordings

Before

tabsafter.mp4

After

positionsafter.mp4

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

Medium Risk
Changes conditional rendering for the Picks list and adjusts tab state behavior; also removes polling on active positions, which could affect UI freshness and user interaction flows in game details.

Overview
Game details picks rendering is upgraded for extended sports markets. PredictPicks now checks selectExtendedSportsMarketsLeagues and, when the market’s game.league is enabled, renders PredictPositionDetail (including forcing CLOSED status for claimable positions) instead of PredictPickItem.

Behavioral tweaks and coverage. useGameDetailsTabs no longer resets activeTab when the tab set changes, tests were updated/added for the new picks rendering and tab behavior, and PredictGameDetailsContent stops polling active positions by removing the refetchInterval option.

Reviewed by Cursor Bugbot for commit f8c9faa. 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.

@metamaskbot metamaskbot added the team-predict Predict team label Apr 10, 2026
@caieu caieu marked this pull request as ready for review April 10, 2026 23:03
@caieu caieu requested a review from a team as a code owner April 10, 2026 23:03
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - draft PR

All E2E tests pre-selected.

View GitHub Actions results

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f8c9faa. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud

Copy link
Copy Markdown

@matallui matallui added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit 6a3034b Apr 13, 2026
126 checks passed
@matallui matallui deleted the predict/PRED-803-phase-3-positions-tab-all-market-type-positions branch April 13, 2026 21:06
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 13, 2026
@metamaskbot metamaskbot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label Apr 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-M team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants