Skip to content

fix: Fix dismissing perps modify sheet#28888

Merged
Cal-L merged 1 commit into
mainfrom
fix/perps-modify-sheet
Apr 23, 2026
Merged

fix: Fix dismissing perps modify sheet#28888
Cal-L merged 1 commit into
mainfrom
fix/perps-modify-sheet

Conversation

@Cal-L

@Cal-L Cal-L commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes the perps modify bottom sheet dismissal when tapping on the overlay

Changelog

CHANGELOG entry:

Related issues

Fixes: https://consensys.slack.com/archives/C08U6DYNJ1G/p1776265582646229

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

https://consensys.slack.com/archives/C08U6DYNJ1G/p1776265582646229

After

perps-modify.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.

@Cal-L Cal-L requested a review from a team as a code owner April 15, 2026 22:38
@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.

@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label Apr 15, 2026
@github-actions github-actions Bot added size-S risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokePredictions, SmokeWalletPlatform, SmokeConfirmations, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeMultiChainAPI, SmokeTrade
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The change fixes a bug in BottomSheet.tsx's onCloseCB callback logic. The fix ensures that when overlay or hardware-back triggers onCloseDialog directly (bypassing onCloseBottomSheet), the postCallback is still executed by re-reading it after onClose is called. This is a targeted bug fix explicitly motivated by Perps' handleClose pattern.

Direct impact:

  • SmokePerps: The fix is explicitly for Perps' handleClose → onCloseBottomSheet pattern. Multiple Perps bottom sheets (PerpsLeverageBottomSheet, PerpsOrderTypeBottomSheet, PerpsNotificationBottomSheet, PerpsAdjustMarginActionSheet, PerpsFlipPositionConfirmSheet, etc.) use this component.
  • SmokePredictions: PredictOrderRetrySheet, PredictAddFundsSheet, PredictUnavailable all import BottomSheet directly.
  • SmokeWalletPlatform: TokenSortBottomSheet, RemoveTokenBottomSheet, TrendingTokensBottomSheet components, WhatsNewModal, and Perps/Predictions sections in Trending all use BottomSheet.
  • SmokeConfirmations: Many confirmation flows use BottomSheet for modals; MultichainTransactionDetailsSheet uses it directly.
  • SmokeNetworkAbstractions: NetworkVerificationInfo and DeepLinkModal use BottomSheet.

Dependent tags per tag descriptions:

  • SmokePerps → requires SmokeWalletPlatform + SmokeConfirmations
  • SmokePredictions → requires SmokeWalletPlatform + SmokeConfirmations
  • SmokeNetworkAbstractions → requires SmokeNetworkExpansion + SmokeMultiChainAPI
  • SmokeTrade: TradeWalletActions and swap/bridge flows use BottomSheet-based modals

The change is a behavioral fix to close callback execution order, which could affect any flow that relies on post-close callbacks in BottomSheet. The fix is surgical and well-reasoned, but since BottomSheet is a widely-used shared component, broad testing is warranted.

Performance Test Selection:
The change is a bug fix to callback execution order in BottomSheet's close logic. It does not affect rendering performance, data loading, list rendering, animations, or any performance-sensitive code paths. No performance tests are needed.

View GitHub Actions results

@Cal-L Cal-L added No QA Needed Apply this label when your PR does not need any QA effort. no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed no changelog required No changelog entry is required for this change needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Apr 15, 2026
@github-project-automation github-project-automation Bot moved this to Needs dev review in PR review queue Apr 15, 2026
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
11 value mismatches detected (expected — fixture represents an existing user).
View details

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

Approving to unblock but I think we should have a look at the architecture of the BottomSheet to see if we can make any improvements to ensure there is just one close pipeline

@Cal-L Cal-L added this pull request to the merge queue Apr 23, 2026
@github-project-automation github-project-automation Bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Apr 23, 2026
Merged via the queue into main with commit be61dfb Apr 23, 2026
229 of 236 checks passed
@Cal-L Cal-L deleted the fix/perps-modify-sheet branch April 23, 2026 21:53
@github-project-automation github-project-automation Bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue Apr 23, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 23, 2026
@github-actions github-actions Bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Apr 23, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.76.0 Issue or pull request that will be included in release 7.76.0 label Apr 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no changelog required No changelog entry is required for this change No QA Needed Apply this label when your PR does not need any QA effort. no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.76.0 Issue or pull request that will be included in release 7.76.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-S team-mobile-platform Mobile Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants