Skip to content

fix(activity): cp-8.5.0 fix bottomsheet positioning when activity is a tab - #33794

Merged
wachunei merged 7 commits into
mainfrom
fix/activity-filter-bottomsheet-tab-positioning
Jul 27, 2026
Merged

fix(activity): cp-8.5.0 fix bottomsheet positioning when activity is a tab#33794
wachunei merged 7 commits into
mainfrom
fix/activity-filter-bottomsheet-tab-positioning

Conversation

@wachunei

@wachunei wachunei commented Jul 24, 2026

Copy link
Copy Markdown
Member

Description

Fix the bottomsheet positioning when activity is a tab (TMCU-1185).

With Activity redesign enabled and Money account off, Activity is presented as a tab. Filter bottom sheets (Type, Perps, Network) previously rendered under the tab bar because BottomSheet uses absolute fill within the tab screen. This change hosts those sheets on the app-level root modal flow so they cover the tab bar in both Money-account-on (stack) and Money-account-off (tab) presentations.

Changelog

CHANGELOG entry: Fixed Activity filter bottom sheets rendering under the tab bar when Activity is shown as a tab

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-1185

Manual testing steps

Feature: Activity filter bottom sheets above tab bar

  Scenario: user opens Type filter when Activity is a tab
    Given activity redesign is enabled
    And money account is off so Activity is shown as a tab
    When user opens Activity and taps the Type filter chip
    Then the Type filter bottom sheet appears above the tab bar
    And selecting an option updates the filter and closes the sheet

  Scenario: user opens Perps and Network filters when Activity is a tab
    Given activity redesign is enabled
    And money account is off so Activity is shown as a tab
    When user opens the Perps filter chip and the Network filter chip
    Then each bottom sheet appears above the tab bar

  Scenario: user opens filters when Activity is a stack screen
    Given activity redesign is enabled
    And money account is on so Activity is a standalone stack screen
    When user opens Type, Perps, and Network filter sheets
    Then each bottom sheet still positions and dismisses correctly

Screenshots/Recordings

Before

image image

After

image
after.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
UI/navigation-only change to Activity filters with no auth or transaction logic changes; risk is limited to filter selection and modal dismiss behavior regressions.

Overview
Activity Type, Perps, and Network filter UIs no longer render as inline bottom sheets on ActivityScreen. Chip taps now navigateWithDetails into ROOT_MODAL_FLOW with new sheet routes (ACTIVITY_TYPE_FILTER, ACTIVITY_PERPS_FILTER, ACTIVITY_NETWORK_FILTER) registered in App.tsx, so filters cover the tab bar when Activity is a tab.

Filter sheets read selection via useParams and write back through onSelect / onNetworkSelect callbacks in route params (OptionsSheet pattern). FilterOptionSheet gains optional goBack, onOpen, and isInteractable to pop the modal route and avoid instant dismiss when the modal flow uses animation: 'none'. Network filtering moves off TrendingTokenNetworkBottomSheet into a dedicated ActivityNetworkFilterSheet.

Navigation types and TransactionsViewParams are extended (initialPerpsFilter); component tests and the activity view test renderer mirror the modal stack setup.

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

Present Type, Perps, and Network filter bottom sheets above the tab bar when Activity is shown as a tab.
@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 Jul 24, 2026
@metamask-ci metamask-ci Bot added the team-mobile-ux Mobile UX team label Jul 24, 2026
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

🧪 Flaky unit test detection

Run history flaky detection

View recent run history

Historical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow.

Failures / runs sampled per window:

File 7d 15d 30d
app/components/Views/ActivityScreen/components/FilterOptionSheet/FilterOptionSheet.test.tsx 0/161 0/274 0/285

AI-detected flaky patterns

app/components/Views/ActivityScreen/components/FilterOptionSheet/FilterOptionSheet.test.tsx

  • J3 — Missing jest.clearAllMocks() / jest.resetAllMocks() (high)
    • The baseProps object is defined at module level and contains two jest.fn() instances — onSelect and onClose — that are never cleared between tests. Any test that calls renderSheet() without overriding these props will share the same mock instances, causing call-count state to bleed from one test into the next. For example, if a future test asserts expect(baseProps.onSelect).not.toHaveBeenCalled() after a test that triggered a press, it will fail intermittently depending on test execution order. The beforeEach only clears mockOnCloseBottomSheet, leaving the two shared fns dirty. The fix is to add jest.clearAllMocks() (or individually clear the shared fns) in beforeEach.
    • Suggested fix in app/components/Views/ActivityScreen/components/FilterOptionSheet/FilterOptionSheet.test.tsx:101:
      -const baseProps: FilterOptionSheetProps<TestOption> = {
      -  title: 'Pick one',
      -  options: OPTIONS,
      -  selected: 'alpha',
      -  getLabel: (option) => `Label ${option}`,
      -  onSelect: jest.fn(),
      -  onClose: jest.fn(),
      -  sheetTestID: SHEET_TEST_ID,
      -  getOptionTestID: optionTestId,
      -};
      -
      -// ...
      -
      -describe('FilterOptionSheet', () => {
      -  beforeEach(() => {
      -    mockOnCloseBottomSheet.mockClear();
      -  });
      +const baseProps: FilterOptionSheetProps<TestOption> = {
      +  title: 'Pick one',
      +  options: OPTIONS,
      +  selected: 'alpha',
      +  getLabel: (option) => `Label ${option}`,
      +  onSelect: jest.fn(),
      +  onClose: jest.fn(),
      +  sheetTestID: SHEET_TEST_ID,
      +  getOptionTestID: optionTestId,
      +};
      +
      +// ...
      +
      +describe('FilterOptionSheet', () => {
      +  beforeEach(() => {
      +    jest.clearAllMocks(); // clears mockOnCloseBottomSheet, baseProps.onSelect, baseProps.onClose
      +  });

This check is informational only and does not block merging.

@wachunei wachunei removed 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 Jul 24, 2026
@wachunei
wachunei marked this pull request as ready for review July 24, 2026 16:16
@wachunei
wachunei requested review from a team as code owners July 24, 2026 16:16
wachunei added 2 commits July 24, 2026 12:20
Keep the activity component-view renderer as .ts with createElement so the
.ts→.tsx rename no longer inflates the PR line count past the 1000 limit.
@github-actions github-actions Bot added size-L risk:medium AI analysis: medium risk and removed size-XL labels Jul 24, 2026
wachunei added 2 commits July 24, 2026 12:30
Bring back the stackTree JSX RootModalFlow host and ignore max-lines for this PR.
@github-actions github-actions Bot added size-XL risk:low AI analysis: low risk and removed size-L risk:medium AI analysis: medium risk labels Jul 24, 2026
Host filter sheets with createElement stackTree so we do not rename to .tsx.
@github-actions github-actions Bot added risk:medium AI analysis: medium risk and removed risk:low AI analysis: low risk labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeSeedlessOnboardingExtended, SmokeBrowser, SmokeSnaps
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: %
click to see 🤖 AI reasoning details

E2E Test Selection:
Fallback: AI analysis did not complete successfully. Running all tests.

Performance Test Selection:
Fallback: AI analysis did not complete successfully. Running all performance tests.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@weitingsun weitingsun 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.

mobile-platform codeowner navigation files LGTM

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Performance Test Results

ℹ️ Performance test results are currently non-blocking and will not block this PR.

5 tests failed · 20 tests · 1 device

📱 Devices tested (1)

Android: Google Pixel 8 Pro (v14.0)

❌ Failed Tests (5)

@metamask-mobile-platform

Test Platform Device Reason Recording
Measure Warm Start: Login To Wallet Screen Android Google Pixel 8 Pro (v14.0) Test error 📹 Watch

@team-predict

Test Platform Device Reason Recording
Predict Market Details - Complete Flow Performance Android Google Pixel 8 Pro (v14.0) Quality gates exceeded 📹 Watch

@metamask-onboarding-team

Test Platform Device Reason Recording
Seedless Onboarding: Apple Login New User Android Google Pixel 8 Pro (v14.0) Timed out
Seedless Onboarding: Google Login New User Android Google Pixel 8 Pro (v14.0) Timed out

@mm-perps-engineering-team

Test Platform Device Reason Recording
Perps open position and close it Android Google Pixel 8 Pro (v14.0) Test error 📹 Watch
✅ Passed Tests (15)
Test Platform Device Duration Team Recording
Cross-chain swap flow - ETH to SOL - 50+ accounts, SRP 1 + SRP 2 + SRP 3 Android Google Pixel 8 Pro (v14.0) 4.73s @swap-bridge-dev-team 📹 Watch
Aggregated Balance Loading Time, SRP 1 + SRP 2 + SRP 3 Android Google Pixel 8 Pro (v14.0) 300.48s @assets-dev-team
Asset View, SRP 1 + SRP 2 + SRP 3 Android Google Pixel 8 Pro (v14.0) 4.35s @assets-dev-team 📹 Watch
Import SRP with +50 accounts, SRP 1, SRP 2, SRP 3 Android Google Pixel 8 Pro (v14.0) 3.82s @Accounts-team 📹 Watch
Swap flow - ETH to LINK, SRP 1 + SRP 2 + SRP 3 Android Google Pixel 8 Pro (v14.0) 300.01s @swap-bridge-dev-team
Cold Start: Measure ColdStart To Login Screen Android Google Pixel 8 Pro (v14.0) 4.85s @metamask-mobile-platform 📹 Watch
Measure Warm Start: Warm Start to Login Screen Android Google Pixel 8 Pro (v14.0) 0.00s @metamask-mobile-platform 📹 Watch
Perps add funds Android Google Pixel 8 Pro (v14.0) 10.34s @mm-perps-engineering-team 📹 Watch
Predict Available Balance - Complete Flow Performance Android Google Pixel 8 Pro (v14.0) 2.73s @team-predict 📹 Watch
Predict Deposit - Complete Flow Performance Android Google Pixel 8 Pro (v14.0) 10.85s @team-predict 📹 Watch
Fresh SRP wallet creation performance Android Google Pixel 8 Pro (v14.0) 13.00s @metamask-onboarding-team 📹 Watch
Measure Cold Start To Onboarding Screen Android Google Pixel 8 Pro (v14.0) 2.87s @metamask-mobile-platform 📹 Watch
Onboarding Import SRP with +50 accounts, SRP 3 Android Google Pixel 8 Pro (v14.0) 7.93s @metamask-onboarding-team 📹 Watch
Cold Start after importing a wallet Android Google Pixel 8 Pro (v14.0) 1.57s @metamask-mobile-platform 📹 Watch
Account creation after fresh install Android Google Pixel 8 Pro (v14.0) 4.54s @metamask-onboarding-team 📹 Watch

Branch: fix/activity-filter-bottomsheet-tab-positioning · Build: Normal · Commit: 571a08c · View full run

@wachunei
wachunei added this pull request to the merge queue Jul 27, 2026
Merged via the queue into main with commit bb0fb36 Jul 27, 2026
218 of 220 checks passed
@wachunei
wachunei deleted the fix/activity-filter-bottomsheet-tab-positioning branch July 27, 2026 13:40
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 27, 2026
@metamask-ci metamask-ci Bot added the release-8.6.0 Issue or pull request that will be included in release 8.6.0 label Jul 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.6.0 Issue or pull request that will be included in release 8.6.0 risk:medium AI analysis: medium risk size-XL team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants