Skip to content

refactor(Predict): remove temporary BTC up/down row flag and update imports cp-7.80.0 #30754

Merged
PatrykLucka merged 3 commits into
mainfrom
enable-btc-row-in-world-cup-section
May 29, 2026
Merged

refactor(Predict): remove temporary BTC up/down row flag and update imports cp-7.80.0 #30754
PatrykLucka merged 3 commits into
mainfrom
enable-btc-row-in-world-cup-section

Conversation

@PatrykLucka

@PatrykLucka PatrykLucka commented May 28, 2026

Copy link
Copy Markdown
Contributor

Description

Enables the live BTC 5-minute up/down row in the Predict homepage discovery section (HomepagePredictWorldCupDiscovery).

The row was previously gated behind a temporary SHOW_BTC_UP_DOWN_5M_ROW kill switch while waiting on the shared useCurrentCryptoUpDownMarketData hook. That hook is now wired up, so the row shows live BTC spot price, price-to-beat, and a countdown. Tapping the row opens the active BTC market details when available; otherwise it falls back to the crypto category market list.

Why: Surface live crypto up/down markets on the homepage discovery treatment and remove dead placeholder/TODO wiring.

Changes:

  • Remove SHOW_BTC_UP_DOWN_5M_ROW from btcUpDown5mSeries.ts
  • Wire useCurrentCryptoUpDownMarketData + usePredictNavigation in HomepagePredictWorldCupDiscovery
  • Always render BtcLiveRow (no longer conditional on kill switch)
  • Navigate to live market on row tap when btcMarketId is available

Changelog

CHANGELOG entry: Added a live BTC up/down row to the Predict homepage discovery section with real-time price, price-to-beat, and countdown.

Related issues

Fixes:

Manual testing steps

Feature: Predict homepage discovery BTC live row

  Scenario: BTC row displays live data when Predict is enabled
    Given Predict is enabled
    And the user is in the homepage discovery treatment (world cup discovery layout)
    When the user views the Predict section on the homepage
    Then the BTC live row is visible
    And it shows BTC spot price, price-to-beat, and a live countdown

  Scenario: Tapping BTC row opens the active market
    Given Predict is enabled
    And a live BTC 5-minute up/down market is available
    When the user taps the BTC live row
    Then the app navigates to that market's details screen
    And the entry point is HOME_SECTION

  Scenario: Tapping BTC row falls back when no live market
    Given Predict is enabled
    And no live BTC market is available
    When the user taps the BTC live row
    Then the app navigates to the Predict crypto category market list

Screenshots/Recordings

Before

Screenshot 2026-05-28 at 13 26 58

After

Screenshot 2026-05-28 at 17 41 35

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

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
User-visible homepage Predict navigation and live market data depend on external feeds; misconfiguration could send users to the wrong market or show stale prices, but scope is limited to discovery UI.

Overview
Removes the temporary SHOW_BTC_UP_DOWN_5M_ROW kill switch and turns on the BTC 5-minute up/down discovery row on the Predict homepage.

HomepagePredictWorldCupDiscovery now loads live window data via useCurrentCryptoUpDownMarketData (series BTC_UP_OR_DOWN_5M_SERIES, gated by selectPredictEnabledFlag) and always renders BtcLiveRow with spot price, price-to-beat, and countdown. Tapping the row opens the active market through navigateToMarketDetails when btcMarketId exists (including transactionActiveAbTests when present); otherwise it still navigates to the crypto market list. Placeholder constants and commented TODO wiring are deleted.

PredictionsSection.test.tsx mocks useCurrentCryptoUpDownMarketData so tests stay stable without live market data.

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

@PatrykLucka PatrykLucka self-assigned this May 28, 2026
@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.

@PatrykLucka PatrykLucka marked this pull request as ready for review May 28, 2026 15:42
@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label May 28, 2026
@PatrykLucka PatrykLucka requested a review from a team as a code owner May 28, 2026 15:42
@metamaskbotv2 metamaskbotv2 Bot added the team-mobile-ux Mobile UX team label May 28, 2026
@PatrykLucka PatrykLucka enabled auto-merge May 28, 2026 15:54

@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 452665b. Configure here.

@PatrykLucka PatrykLucka added skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. and removed pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels May 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: @PerformancePredict
  • Risk Level: medium
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes activate the BTC Up/Down 5-minute live row in the Predictions section of the Homepage by:

  1. Removing the SHOW_BTC_UP_DOWN_5M_ROW = false kill switch from btcUpDown5mSeries.ts — this was the only thing preventing the BTC row from rendering.
  2. Wiring up the real useCurrentCryptoUpDownMarketData hook in HomepagePredictWorldCupDiscovery/index.tsx (previously commented out as a TODO), enabling live BTC market data display.
  3. Enabling direct navigation to BTC market details via usePredictNavigation when a btcMarketId is available.
  4. Adding the corresponding test mock in PredictionsSection.test.tsx.

SmokePredictions: Directly impacted — the Predictions section UI now renders a live BTC row unconditionally, changing the component's behavior and navigation flow.
SmokeWalletPlatform: Required per SmokePredictions tag description — Predictions is a section inside the Trending tab, and changes to Predictions views (headers, lists, full views) affect Trending.
SmokeConfirmations: Required per SmokePredictions tag description — opening/closing positions are on-chain transactions that go through the confirmation flow.

No changes to core controllers, Engine, navigation infrastructure, or other shared components that would warrant broader test coverage. The changes are scoped to the Predictions feature area.

Performance Test Selection:
The BTC live row is now always rendered (previously hidden behind a false flag) and wires up a real data hook useCurrentCryptoUpDownMarketData that fetches live market data. This adds a new data-fetching hook to the Predictions section of the Homepage, which could impact rendering performance of the Predictions/Trending area. @PerformancePredict covers prediction market list loading and balance display, making it relevant to validate that the new live data hook doesn't degrade performance.

View GitHub Actions results

@PatrykLucka PatrykLucka added this pull request to the merge queue May 29, 2026
@PatrykLucka PatrykLucka removed this pull request from the merge queue due to a manual request May 29, 2026
@PatrykLucka PatrykLucka changed the title refactor(Predict): remove temporary BTC up/down row flag and update imports refactor(Predict): remove temporary BTC up/down row flag and update imports cp-7.80.0 May 29, 2026
@PatrykLucka PatrykLucka enabled auto-merge May 29, 2026 13:43
@PatrykLucka PatrykLucka added this pull request to the merge queue May 29, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 29, 2026
@PatrykLucka PatrykLucka added this pull request to the merge queue May 29, 2026
Merged via the queue into main with commit dffcf7c May 29, 2026
504 of 512 checks passed
@PatrykLucka PatrykLucka deleted the enable-btc-row-in-world-cup-section branch May 29, 2026 14:23
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.81.0 Issue or pull request that will be included in release 7.81.0 label May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.81.0 Issue or pull request that will be included in release 7.81.0 size-M skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants