fix: perps leverage glitch#28960
Conversation
|
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. |
|
Hello @tommasini what is the purpose of this PR? Is it to fix the leverage bottomsheet only? Why is there a change to android/app/build.gradle, app/components/UI/Perps/routes/index.tsx, ios/MetaMask.xcodeproj/project.pbxproj, and bitrise.yml? |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Direct impact: SmokePerps - the leverage bottom sheet is a core part of the Perps trading flow (used in PerpsOrderView). The change affects how the bottom sheet opens/closes and resets state. Dependent tags per tag descriptions:
The change is low risk as it's isolated to a single component within the Perps feature, but the dependent tags are included per the tag relationship rules. Performance Test Selection: |
|
@michalconsensys it was branched of the branch of the native stack implementation, then when that branch was merged, github redirects this to merge into main, but do not update the files, we needed to pull from main to that happen. I believe it's a gh bug |
|
✅ E2E Fixture Validation — Schema is up to date |
|



Description
Fix perps glitch when pressing leverage.
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Low risk UI-state change confined to the leverage bottom sheet’s visibility effect; main risk is behavioral regression in how/when the sheet opens.
Overview
Prevents the Perps leverage bottom sheet from imperatively calling
bottomSheetRef.current?.onOpenBottomSheet()whenisVisiblebecomes true.The visibility effect now only runs the reset-to-initial logic when the sheet closes (
!isVisible), avoiding the open/reset sequencing that caused the leverage-press glitch.Reviewed by Cursor Bugbot for commit 156209e. Bugbot is set up for automated code reviews on this repo. Configure here.