chore(runway): cherry-pick fix(predict): stop game details jump and chart overlap on tab switch cp-7.81.0#31472
Merged
Conversation
…hart overlap on tab switch cp-7.81.0 (#31436) ## **Description** <!-- mms-check: type=text required=true --> This PR makes the Predict **game details** screen (`PredictGameDetailsContent`) behave like the standard `PredictMarketDetails` screen when switching between outcome-group chips (game lines / exact score / halftime) or the Positions/Outcomes tabs. It fixes two visual issues: 1. **Screen jumping on tab/chip change.** The component drove an imperative `scrollTo` on every chip selection (plus a follow-up `InteractionManager.runAfterInteractions` pass) to force the sticky header to the top, propped up by a `windowHeight`-based `minHeight` on the tab content. This caused the screen to jump downward on every switch. The regular market details screen never does this — it relies solely on the `ScrollView`'s `stickyHeaderIndices`. Removed the manual scroll machinery (`scrollRef`, `stickyHeaderY`, `pendingChipScroll`, the layout handler, and the effect) and the `minHeight` wrapper, so switching chips/tabs now only swaps the content below the sticky header and preserves scroll position. 2. **Chart overlapping the outcomes.** `PredictGameChartContent` used `flex-1` on its loaded/error/empty containers. Inside a `ScrollView`, `flex-1` collapses to zero height, so the fixed 200px chart `View` overflowed downward onto the chip bar and the first outcome card. Switched the containers to `w-full` so they size to their content — matching the market details chart (`PredictDetailsChart`), which never used `flex-1`. Both changes are layout-only. Existing unit tests for `PredictGameChart` and `PredictGameDetailsContent` (218 tests) pass unchanged, including the `reserves chart height only while loading` test. ## **Changelog** <!-- mms-check: type=changelog required=true --> CHANGELOG entry: Fixed the Predict sports game details screen jumping and the price chart overlapping the outcomes when switching between markets ## **Related issues** <!-- mms-check: type=issue-link required=true --> Fixes: https://consensyssoftware.atlassian.net/browse/PRED-954 ## **Manual testing steps** <!-- mms-check: type=manual-testing required=true --> ```gherkin Feature: Predict game details market/tab switching Scenario: Switching outcome-group chips does not jump or overlap the chart Given I open a sports game market with extended outcomes (e.g. game lines, exact score, halftime) And the price chart has loaded above the chip bar When I tap a different chip (e.g. "Exact Score") Then the screen does not jump to pin the chip bar to the top And the chart keeps its height and does not overlap the outcomes list And the outcomes for the selected chip render below the chip bar Scenario: Switching Positions/Outcomes tabs preserves scroll position Given I open a sports game market that shows the Positions/Outcomes tab bar When I switch between the Positions and Outcomes tabs Then the scroll position is preserved (no downward jump) And the chart does not overlap any content ``` ## **Screenshots/Recordings** <!-- mms-check: type=screenshot required=true --> ### **Before** <!-- Attach the recording showing the screen jumping on tab/chip change and the chart overlapping the first outcome card (e.g. "Mexico 0 - 3 South Africa"). --> ### **After** https://github.com/user-attachments/assets/ce638894-f133-40ce-89c8-77b4d38868cc <!-- Attach a recording switching between chips/tabs with no downward jump and no chart overlap. --> ## **Pre-merge author checklist** <!-- mms-check: type=checklist required=true --> - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [x] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [x] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [x] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Layout-only Tailwind and scroll wiring changes in Predict game details UI with no auth, data, or business-logic impact. > > **Overview** > Fixes Predict **game details** layout when users switch outcome chips or Positions/Outcomes tabs. > > **Game details scroll behavior:** Removes imperative `scrollTo` on chip change (`scrollRef`, `stickyHeaderY`, `pendingChipScroll`, layout measurement, and `InteractionManager` follow-up) and drops the `windowHeight`-based `minHeight` wrapper around tab content. Chip selection now calls `handleChipSelect` directly, relying on `ScrollView` `stickyHeaderIndices` like standard market details so scroll position is preserved and the screen no longer jumps. > > **Chart in `ScrollView`:** In `PredictGameChartContent`, replaces `flex-1` with `w-full` on loaded, error, and empty chart containers so height follows content instead of collapsing inside the scroll view, preventing the fixed-height chart from overlapping the chip bar and outcome list. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b15f4a1. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - PR targets a release or stable branch (release/* or stable) All E2E tests pre-selected. |
sleepytanya
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR makes the Predict game details screen
(
PredictGameDetailsContent) behave like the standardPredictMarketDetailsscreen when switching between outcome-group chips(game lines / exact score / halftime) or the Positions/Outcomes tabs. It
fixes two visual issues:
Screen jumping on tab/chip change. The component drove an
imperative
scrollToon every chip selection (plus a follow-upInteractionManager.runAfterInteractionspass) to force the stickyheader to the top, propped up by a
windowHeight-basedminHeightonthe tab content. This caused the screen to jump downward on every
switch. The regular market details screen never does this — it relies
solely on the
ScrollView'sstickyHeaderIndices. Removed the manualscroll machinery (
scrollRef,stickyHeaderY,pendingChipScroll, thelayout handler, and the effect) and the
minHeightwrapper, soswitching chips/tabs now only swaps the content below the sticky header
and preserves scroll position.
Chart overlapping the outcomes.
PredictGameChartContentusedflex-1on its loaded/error/empty containers. Inside aScrollView,flex-1collapses to zero height, so the fixed 200px chartViewoverflowed downward onto the chip bar and the first outcome card.
Switched the containers to
w-fullso they size to their content —matching the market details chart (
PredictDetailsChart), which neverused
flex-1.Both changes are layout-only. Existing unit tests for
PredictGameChartand
PredictGameDetailsContent(218 tests) pass unchanged, includingthe
reserves chart height only while loadingtest.Changelog
CHANGELOG entry: Fixed the Predict sports game details screen jumping
and the price chart overlapping the outcomes when switching between
markets
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/PRED-954
Manual testing steps
Screenshots/Recordings
Before
After
Screen.Recording.2026-06-09.at.18.05.28.mov
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Performance checks (if applicable)
SRPs
to import wallets with many accounts and tokens
performance metrics
trace()for usage andaddTokenfor an example
For performance guidelines and tooling, see the Performance
Guide.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Low Risk
Layout-only Tailwind and scroll wiring changes in Predict game details
UI with no auth, data, or business-logic impact.
Overview
Fixes Predict game details layout when users switch outcome chips
or Positions/Outcomes tabs.
Game details scroll behavior: Removes imperative
scrollToonchip change (
scrollRef,stickyHeaderY,pendingChipScroll, layoutmeasurement, and
InteractionManagerfollow-up) and drops thewindowHeight-basedminHeightwrapper around tab content. Chipselection now calls
handleChipSelectdirectly, relying onScrollViewstickyHeaderIndiceslike standard market details so scroll position ispreserved and the screen no longer jumps.
Chart in
ScrollView: InPredictGameChartContent, replacesflex-1withw-fullon loaded, error, and empty chart containers soheight follows content instead of collapsing inside the scroll view,
preventing the fixed-height chart from overlapping the chip bar and
outcome list.
Reviewed by Cursor Bugbot for commit
b15f4a1. Bugbot is set up for automated
code reviews on this repo. Configure
here.