Skip to content

fix: private key scroll#27891

Merged
gantunesr merged 9 commits into
mainfrom
gar/fix/private-keys-ux
Apr 2, 2026
Merged

fix: private key scroll#27891
gantunesr merged 9 commits into
mainfrom
gar/fix/private-keys-ux

Conversation

@gantunesr

@gantunesr gantunesr commented Mar 24, 2026

Copy link
Copy Markdown
Member

Description

Fix scroll in the "Private Key" list for Android devices

Changelog

CHANGELOG entry: fix scroll in the "Private Key" list for Android devices

Related issues

Fixes: #27192
Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1552

Manual testing steps

  1. Use a device/emulator with small screen
  2. Go to the private key list
  3. Try to scroll without dismissing the bottom sheet

Screenshots/Recordings

Before

Check #27192

After

Screen.Recording.2026-03-24.at.6.11.56.PM.mov

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
Touches shared BottomSheet/BottomSheetDialog gesture handling by forwarding arbitrary PanGestureHandler props, which could subtly change swipe-to-dismiss behavior across consumers (especially on Android). Changes are localized but affect a common UI primitive.

Overview
Fixes Android scrolling in the Private Key list bottom sheet by allowing callers to pass PanGestureHandler configuration down into BottomSheetDialog and wiring PrivateKeyList to use simultaneousHandlers with the list’s RNGH ScrollView ref so scroll gestures don’t trigger sheet dismissal.

Updates/extends tests to cover the new panGestureHandlerProps plumbing and adds broader PrivateKeyList behavior assertions (error reset, banner content, cancel navigation, SOL-only filtering, and Android-specific rendering).

Written by Cursor Bugbot for commit f72fa25. This will update automatically on new commits. Configure here.

@gantunesr gantunesr marked this pull request as ready for review March 24, 2026 21:17
@gantunesr gantunesr requested review from a team as code owners March 24, 2026 21:17
@metamaskbot metamaskbot added the team-accounts-framework Accounts team label Mar 24, 2026
Comment thread app/components/Views/MultichainAccounts/PrivateKeyList/PrivateKeyList.tsx Outdated
@github-actions github-actions Bot added the risk-medium Moderate testing recommended · Possible bug introduction risk label Mar 26, 2026
@github-actions github-actions Bot added size-M risk-medium Moderate testing recommended · Possible bug introduction risk and removed size-S risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 27, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 27, 2026

@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 2 potential issues.

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.

Comment thread app/components/Views/MultichainAccounts/PrivateKeyList/PrivateKeyList.test.tsx Outdated
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.63%. Comparing base (eb330c5) to head (60323bf).
⚠️ Report is 103 commits behind head on main.

Files with missing lines Patch % Lines
...ltichainAccounts/PrivateKeyList/PrivateKeyList.tsx 75.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #27891      +/-   ##
==========================================
+ Coverage   82.60%   82.63%   +0.03%     
==========================================
  Files        4839     4854      +15     
  Lines      124418   125103     +685     
  Branches    27726    27922     +196     
==========================================
+ Hits       102774   103378     +604     
- Misses      14580    14603      +23     
- Partials     7064     7122      +58     

☔ View full report in Codecov by Sentry.
📢 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 github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 30, 2026

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

Hey @gantunesr, thanks for extending the functionality of the BottomSheetDialog. I was wondering if we can make this somewhat more future proofed to allow for all PanGestureHandler props via a prop object? Some of my code suggestions may be sudo-code and need formatting or testing.

@MetaMask/design-system-engineers we will need to do this to the MMDS version as well

Comment thread app/component-library/components/BottomSheets/BottomSheet/BottomSheet.tsx Outdated
Comment thread app/component-library/components/BottomSheets/BottomSheet/BottomSheet.tsx Outdated
Comment thread app/components/Views/MultichainAccounts/PrivateKeyList/PrivateKeyList.tsx Outdated
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 30, 2026
@gantunesr gantunesr added the skip-e2e-flakiness-detection Skips the E2E flakiness detection (extra runs on new and modified E2E files) label Mar 31, 2026
@gantunesr

Copy link
Copy Markdown
Member Author

The new introduced code is 100% tested

@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 31, 2026
@gantunesr

gantunesr commented Mar 31, 2026

Copy link
Copy Markdown
Member Author

'BottomSheet' is deprecated.
Check warning: 'BottomSheet' is deprecated.

See more on https://sonarcloud.io/project/issues?id=metamask-mobile&issues=AZ0s1Zdt_bOZZnqPOCVa&open=AZ0s1Zdt_bOZZnqPOCVa&pullRequest=27891

The BottomSheet is not introduced in this PR, this can be ignored.

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

Looks good, haven't tested

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

LGTM! Approving on behalf of @MetaMask/design-system-engineers

Created same PR in MMDS

@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 1, 2026
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The PR makes two related changes:

  1. BottomSheet/BottomSheetDialog (additive, backward-compatible): Adds an optional panGestureHandlerProps prop that is spread onto the underlying PanGestureHandler. This is a purely additive change — all existing consumers are unaffected since the prop defaults to undefined. No regression risk for the broad set of BottomSheet consumers (confirmations, wallet actions, SDK modals, etc.).

  2. PrivateKeyList (Android gesture fix): Uses the new panGestureHandlerProps.simultaneousHandlers on Android to prevent the BottomSheet's pan gesture handler from capturing FlashList scroll gestures as dismiss-sheet pans. This is a targeted fix for the private key export flow in the MultichainAccounts feature.

The PrivateKeyList component is part of the multi-SRP/multichain accounts architecture, accessed via account action menus and the AccountGroupDetails screen. This directly maps to:

  • SmokeAccounts: Covers SRP export flows, private key export, account management, and the RevealPrivateCredential component. The PrivateKeyList is the core component being changed.
  • SmokeWalletPlatform: Covers multi-SRP wallet architecture, exporting SRP from Settings and account action menus, and managing separate account hierarchies per SRP.

No other tags are warranted since the BottomSheet change is non-breaking and additive, and the PrivateKeyList change is scoped to the private key/SRP export flow.

Performance Test Selection:
The changes are focused on gesture handling correctness (fixing an Android scroll/pan conflict) and adding an optional prop to BottomSheet. There are no changes to rendering performance, data loading, state management, or critical user flow timing. No performance tests are warranted.

View GitHub Actions results

@github-actions

github-actions Bot commented Apr 1, 2026

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

sonarqubecloud Bot commented Apr 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
70.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@gantunesr gantunesr added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Apr 1, 2026
@gantunesr gantunesr added this pull request to the merge queue Apr 2, 2026
Merged via the queue into main with commit 4955891 Apr 2, 2026
168 of 174 checks passed
@gantunesr gantunesr deleted the gar/fix/private-keys-ux branch April 2, 2026 12:29
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 2, 2026
@metamaskbot metamaskbot added the release-7.73.0 Issue or pull request that will be included in release 7.73.0 label Apr 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.73.0 Issue or pull request that will be included in release 7.73.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-M skip-e2e-flakiness-detection Skips the E2E flakiness detection (extra runs on new and modified E2E files) skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-accounts-framework Accounts team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Unable to scroll in Private key screen

5 participants