fix: perps safe area design regressions#30970
Conversation
…m sheet, fix safe area view padding
…t on back navigation button
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
The risk is medium because while changes are scoped to Perps, the design system migration involves many enum value changes that could cause runtime errors if any values are incorrect, and the PerpsLeverageBottomSheet has significant structural refactoring. Performance Test Selection: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ef51989. Configure here.
geositta
left a comment
There was a problem hiding this comment.
Looks good, did not find any issues.

Description
Fix Perps UI layout and rendering issues
This PR addresses a collection of visual bugs found across the Perps order flow on iOS and Android.
What changed
Order header back button overlap The header was applying top: topInset as a relative offset, which visually shifted it down without affecting the layout box. This caused the back button to render on top of the amount input, making taps on the back button focus the input instead. Changed to paddingTop: topInset so the header grows correctly in the flex layout.
Android safe area for the order button The fixed "Place Order" button was jumping on re-render on Android. The root cause was spreading a StyleSheet object into a plain object inside useMemo, which made the base style reference unstable and caused Fabric to flash the un-overridden bottom: 0 before the dynamic value resolved. Separated the stable StyleSheet reference from the dynamic safe area padding using a style array.
TPSL back button vertical alignment The absolutely-positioned back button was missing top/bottom anchors, so it defaulted to top: 0 and ignored the parent's alignItems. Added top: 0, bottom: 0, and justifyContent: center so the icon sits centered with the header title.
Leverage bottom sheet button off-screen on iOS The bottom sheet's overflow: hidden was clipping the footer button when content exceeded the available height. Wrapped the scrollable content in a ScrollView with flexShrink: 1 and moved the footer outside it so the button is always visible and never clipped.
Leverage price icon color The Icon component's color prop was not being applied because a raw hex string was passed via the style prop instead of the color prop. Moved the color to the correct prop.
i18n and test coverage
Also replaced several instances of deprecated component library components. Namely
TextandIconChangelog
CHANGELOG entry: SafeArea view style polish
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before:

After:

Also after (back arrow aligned):

Also after (order button not cut off on Samsung Galaxy):

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
Visual and layout-only changes across Perps trading UI with no trading logic or auth changes; test mocks updated for design-system imports.
Overview
Fixes Perps order-flow layout and safe-area regressions on iOS/Android, and aligns several screens with
@metamask/design-system-react-nativeforText/Icon(replacing deprecated component-library tokens likeBodyMD→BodyMd,TextColor.Default→TextColor.TextDefault).Order & TP/SL:
PerpsOrderViewwiresonBackonPerpsOrderHeaderand tightens info-section margins;PerpsAmountDisplayreduces top/horizontal padding. TP/SL header back control is repositioned (bottom+justifyContent: 'center') and gets a balancing empty column for title centering.Leverage sheet: Content moves into a
ScrollViewso the confirm action stays visible; footer uses design-systemBottomSheetFooterwithprimaryButtonProps; warning row layout andminHeighton the price block reduce jumps when price is missing; unavailable price copy isperps.order.leverage_modal.price_unavailableinen.jsonand tests.Shared components:
PerpsCloseSummary,PerpsFeesDisplay, andPerpsFlipPositionConfirmSheetget the same design-system migration; flip-confirm tests mockIconfrom the design-system package.Reviewed by Cursor Bugbot for commit ef51989. Bugbot is set up for automated code reviews on this repo. Configure here.