Skip to content

chore(runway): cherry-pick fix(perps): use native stack navigator to fix navigation jitter on navigation v6#28968

Merged
chloeYue merged 1 commit into
release/7.74.00from
cherry-pick-7-74-0-cf10d95
Apr 17, 2026
Merged

chore(runway): cherry-pick fix(perps): use native stack navigator to fix navigation jitter on navigation v6#28968
chloeYue merged 1 commit into
release/7.74.00from
cherry-pick-7-74-0-cf10d95

Conversation

@runway-github

@runway-github runway-github Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Description

React Navigation v6's JS-based @react-navigation/stack creates
Reanimated shared values during render before the Fabric commit is
finalized. Under the New Architecture (newArchEnabled=true, RN
0.76.9), this causes animations to fall back to the JS thread, producing
a freeze-then-snap jitter when navigating into the Perps stack.

The fix replaces createStackNavigator with
createNativeStackNavigator (from @react-navigation/native-stack@^6)
for PerpsScreenStack. Native stack transitions run as pure UIKit (iOS)
/ Fragment (Android) animations with zero Reanimated/JS-thread
involvement, eliminating the timing issue entirely.

Concretely:

  • Added @react-navigation/native-stack@^6 as a dependency (compatible
    with the existing react-native-screens@3.37.0)
  • Replaced createStackNavigatorcreateNativeStackNavigator for the
    inner Perps navigator in routes/index.tsx
  • Updated screen option syntax for the two transparent-modal screens:
    cardStylecontentStyle, animationEnabled: falseanimation: 'none', and replaced JS-stack-only header/headerLeft callbacks with
    headerShown/headerBackVisible
  • Updated the Perps ROOT entry in MainNavigator.js to use
    TransitionPresets.SlideFromRightIOS, replacing the hand-rolled
    cardStyleInterpolator that used Animated.Value.interpolate with
    layouts.screen.width (which can be 0 on first render under Fabric's
    async layout)

Changelog

CHANGELOG entry: Fixed jittery navigation transitions when opening Perps
on devices running the New Architecture

Related issues

Fixes:

Manual testing steps

Feature: Perps navigation transition

  Scenario: User navigates to Perps from wallet home
    Given the user is on the Wallet home screen with the Perps tab visible
    And the device is running the New Architecture (newArchEnabled=true)

    When the user taps "New Trade" or any button that navigates to Perps
    Then the screen transitions immediately with a smooth slide-from-right animation
    And no freeze-then-snap jitter occurs during the transition
    And the Perps home screen content appears correctly after the transition

  Scenario: User navigates between Perps screens
    Given the user is on the Perps home screen

    When the user taps on a market to open market details
    Then the transition to the market details screen is smooth and immediate
    And navigating back to Perps home is also smooth

Screenshots/Recordings

Before

N/A

After

Screen.Recording.2026-04-17.at.03.06.54.mov
Screen.Recording.2026-04-17.at.03.10.02.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.

Made with Cursor


Note

Medium Risk
Changes navigation primitives and header behavior for the Perps flow,
which can affect transitions, modal presentation, and confirmation
screen UX if options are mis-mapped between stack implementations.

Overview
Fixes Perps navigation jitter under React Navigation v6 / RN New
Architecture by switching the Perps inner navigator from JS
@react-navigation/stack to @react-navigation/native-stack.

Updates Perps screen options to native-stack equivalents
(contentStyle, animation: 'none', presentation: 'transparentModal') and adds a scoped NavigationContext override in
PerpsConfirmScreen to prevent Confirm from re-enabling a header when
showPerpsHeader is false. Also ensures the Perps root entry in
MainNavigator explicitly disables the header.

Bumps mobile build numbers (versionCode / CURRENT_PROJECT_VERSION)
and Bitrise VERSION_NUMBER to 4532, and adds the
@react-navigation/native-stack dependency.

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


Co-authored-by: metamaskbot metamaskbot@users.noreply.github.com cf10d95

@runway-github runway-github Bot requested review from a team as code owners April 17, 2026 10:20
@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.

@metamaskbotv2 metamaskbotv2 Bot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Apr 17, 2026
@github-actions github-actions Bot added the risk-high Extensive testing required · High bug introduction risk label Apr 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - PR targets a release branch (release/*)

All E2E tests pre-selected.

View GitHub Actions results

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

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​react-navigation/​native-stack@​6.11.010010075100100

View full report

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@github-actions

Copy link
Copy Markdown
Contributor

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

@chloeYue chloeYue enabled auto-merge (squash) April 17, 2026 11:04
@chloeYue chloeYue added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Apr 17, 2026
@chloeYue chloeYue disabled auto-merge April 17, 2026 12:03
@chloeYue chloeYue merged commit 68bb8aa into release/7.74.00 Apr 17, 2026
118 of 122 checks passed
@chloeYue chloeYue deleted the cherry-pick-7-74-0-cf10d95 branch April 17, 2026 12:03
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

risk-high Extensive testing required · High bug introduction risk size-M skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants