Skip to content

fix: Reorged whatshappeningsection to prevent shift on bottomsheet opening - #34579

Merged
brianacnguyen merged 4 commits into
mainfrom
fix/whatshappening
Aug 11, 2026
Merged

fix: Reorged whatshappeningsection to prevent shift on bottomsheet opening#34579
brianacnguyen merged 4 commits into
mainfrom
fix/whatshappening

Conversation

@brianacnguyen

@brianacnguyen brianacnguyen commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

On Perps home, tapping the AI Generated info icon next to What's Happening briefly pushed the Watchlist section downward. The AI disclaimer bottom sheet was mounted as a sibling inside the section Box that uses gap: 12, so opening it inserted an extra flex child and added layout space above Watchlist.

This PR mounts MarketInsightsDisclaimerBottomSheet outside the gapped section content (for both Perps and Explore paths), matching how other screens render this sheet at the root level so the Modal host no longer participates in section layout.

What changed:

  • WhatsHappeningSection renders the AI disclaimer sheet as a sibling of the section content Box, not inside it

Changelog

CHANGELOG entry: Fixed What's Happening AI disclaimer opening causing the Watchlist section to shift down on Perps home

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-1046?atlOrigin=eyJpIjoiMzgzNGNlNWJlNGM5NDdiOGJkZGMxNjFjZmU0YzVmODUiLCJwIjoiamlyYS1zbGFjay1pbnQifQ

Manual testing steps

Feature: What's Happening AI disclaimer layout

  Scenario: user opens AI disclaimer on Perps home
    Given the Whats Happening feature flag is enabled
    And Perps home shows What's Happening cards above Watchlist

    When user taps the info icon next to "AI Generated"
    Then the AI generated content bottom sheet opens
    And Watchlist does not shift downward relative to the news cards
    And dismissing the sheet leaves the section layout unchanged
  1. Open Perps home with What's Happening visible above Watchlist.
  2. Note the spacing between the news carousel and Watchlist.
  3. Tap the info icon next to "AI Generated".
  4. Confirm the disclaimer sheet opens and Watchlist does not jump down.
  5. Dismiss via Got it / close and confirm layout stays stable.
  6. Optional unit check: yarn jest app/components/UI/WhatsHappening/WhatsHappeningSection.test.tsx

Screenshots/Recordings

Before

ScreenRecording_07-31-2026.11-07-30_1.MP4

After

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2026-08-10.at.17.24.26.mov

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

Low Risk
Localized layout/structure change in one UI component with no auth, data, or business-logic impact.

Overview
Fixes a layout jump on Perps home when users tap the AI Generated info icon: Watchlist no longer shifts down while the disclaimer opens.

WhatsHappeningSection now renders MarketInsightsDisclaimerBottomSheet as a sibling of the section content Box, not inside it. On the Perps path that Box uses gap: 12, so mounting the sheet inside it added an extra flex child and extra space above Watchlist when visible. Explore and Perps both return a fragment: gapped Box (header + carousel) plus the sheet outside, consistent with other screens that host this modal at the root.

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

@brianacnguyen brianacnguyen self-assigned this Aug 11, 2026
@brianacnguyen
brianacnguyen requested a review from a team as a code owner August 11, 2026 00:30
@brianacnguyen brianacnguyen added the team-design-system All issues relating to design system in Mobile label Aug 11, 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.

@github-actions github-actions Bot added size-S risk:low AI analysis: low risk labels Aug 11, 2026
@brianacnguyen brianacnguyen changed the title Reorged whatshappeningsection to prevent shift on bottomsheet opening fix: Reorged whatshappeningsection to prevent shift on bottomsheet opening Aug 11, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.14%. Comparing base (cbe5e23) to head (e8ab110).
⚠️ Report is 41 commits behind head on main.

Files with missing lines Patch % Lines
...onents/UI/WhatsHappening/WhatsHappeningSection.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #34579      +/-   ##
==========================================
+ Coverage   85.12%   85.14%   +0.01%     
==========================================
  Files        6350     6390      +40     
  Lines      173080   174053     +973     
  Branches    42804    43146     +342     
==========================================
+ Hits       147333   148195     +862     
- Misses      15708    15736      +28     
- Partials    10039    10122      +83     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform, SmokePerps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 72%
click to see 🤖 AI reasoning details

E2E Test Selection:
The change is a structural refactoring of WhatsHappeningSection.tsx that moves the MarketInsightsDisclaimerBottomSheet (AI disclaimer) outside of the Box wrapper in both the isExploreSection and default render paths. This is not a cosmetic change — it modifies the component tree structure which could affect rendering behavior (e.g., modal stacking, z-index, layout).

WhatsHappeningSection is used in:

  1. TrendingView/tabs/NowTab.tsx — part of the Trending tab → SmokeWalletPlatform
  2. Perps/Views/PerpsHomeView/PerpsHomeView.tsx — part of the Perps home view → SmokePerps

Per SmokePerps description: "also select SmokeWalletPlatform (Trending section)" — both tags are required together.

No text/label changes that would break E2E selectors. No logic changes. The risk is low but the structural change warrants validation of the affected UI areas.

Performance Test Selection:
The change is a structural UI refactoring of the WhatsHappeningSection component — moving a bottom sheet outside a Box wrapper. This does not affect app launch, login, onboarding, swap execution, account list rendering, or asset loading performance. No performance-sensitive code paths are modified.

View GitHub Actions results

@github-actions github-actions Bot added risk:medium AI analysis: medium risk and removed risk:low AI analysis: low risk labels Aug 11, 2026
@sonarqubecloud

Copy link
Copy Markdown

@brianacnguyen
brianacnguyen added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit c1ff598 Aug 11, 2026
105 checks passed
@brianacnguyen
brianacnguyen deleted the fix/whatshappening branch August 11, 2026 18:53
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 11, 2026
@metamask-ci metamask-ci Bot added the release-8.8.0 Issue or pull request that will be included in release 8.8.0 label Aug 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.8.0 Issue or pull request that will be included in release 8.8.0 risk:medium AI analysis: medium risk size-S team-design-system All issues relating to design system in Mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants