Skip to content

chore(runway): cherry-pick fix(perps): remove loading delay from tutorial screen#21144

Merged
Cal-L merged 2 commits into
release/7.57.0from
runway-cherry-pick-7.57.0-1760460800
Oct 14, 2025
Merged

chore(runway): cherry-pick fix(perps): remove loading delay from tutorial screen#21144
Cal-L merged 2 commits into
release/7.57.0from
runway-cherry-pick-7.57.0-1760460800

Conversation

@runway-github

@runway-github runway-github Bot commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

Description

Perps tutorial was taking >5 seconds to load due to being wrapped in
PerpsConnectionProvider, which blocks rendering until WebSocket
connection completes.

Solution: Moved Tutorial to app-level navigation (outside provider)
while keeping all connected screens inside. Connection now initializes
in background during tutorial, eliminating the loading delay.

Changelog

CHANGELOG entry: Fixed Perps tutorial taking over 5 seconds to load

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1840

Manual testing steps

Feature: Perps Tutorial Loading Performance

  Scenario: First-time user navigates to tutorial
    Given user is a first-time Perps user
    When user taps "Trade" button from wallet actions
    Then tutorial displays instantly without "Connecting to perps" screen
    And WebSocket connection initializes in background

  Scenario: Tutorial to Markets navigation
    Given user is viewing tutorial
    When user completes or skips tutorial
    Then user navigates to Markets view
    And Markets loads with active WebSocket connection

  Scenario: Deeplink to tutorial for first-time user
    Given user is a first-time Perps user
    When user opens perps deeplink
    Then tutorial displays instantly

Screenshots/Recordings

Before

  • Tutorial showed "Connecting to perps" loading screen for 5+ seconds

After

  • Tutorial displays instantly
  • Connection establishes in background during tutorial (no loader ever
    displayed since now connected when reaching marketlist screen)
Screen.Recording.2025-10-08.at.1.28.05.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.

Technical Details

Files changed:

  • MainNavigator.js: Added Tutorial as sibling to PERPS.ROOT
  • routes/index.tsx: Removed Tutorial from PerpsScreenStack
  • PerpsTutorialCarousel.tsx: Added background connection
    initialization
  • Navigation updates: handlePerpsUrl.ts, WalletActions.tsx,
    TradeWalletActions.tsx, PerpsGTMModal.tsx, WaysToEarn.tsx,
    PerpsTabView.tsx

Navigation patterns:

  • Tutorial: Direct navigate(Routes.PERPS.TUTORIAL) (app level)
  • Markets/other: Nested navigate(Routes.PERPS.ROOT, { screen: Routes.PERPS.MARKETS }) (inside provider)

Note

Moves Perps tutorial to app-level route, initializes connection in the background, and updates navigation/deeplinks to target the tutorial directly.

  • Navigation/Routes:
    • Move Routes.PERPS.TUTORIAL out of PerpsScreenStack to app-level MainNavigator; remove tutorial screen from UI/Perps/routes.
    • Update navigation calls to use navigate(Routes.PERPS.TUTORIAL) for first-time users; keep markets under navigate(Routes.PERPS.ROOT, { screen: Routes.PERPS.MARKETS }).
    • Export PerpsTutorialCarousel from UI/Perps/index.
  • Tutorial Performance:
    • PerpsTutorialCarousel: start background connection via PerpsConnectionManager.connect() and log via DevLogger; minor layout fixes (remove extra fragment, correct keys).
  • Entry Points Updated:
    • Adjust navigation in PerpsTabView, WalletActions, TradeWalletActions, WaysToEarn, and PerpsGTMModal to target Routes.PERPS.TUTORIAL directly (with params where needed).
    • Deeplink handler: for first-time users navigate directly to Routes.PERPS.TUTORIAL; maintain markets/tabs/asset routing for returning users.
  • Tests:
    • Update expectations across affected tests to reflect direct tutorial navigation and route changes.

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


Co-authored-by: Nicholas Smith nick.smith@consensys.net 3d3f00e

…rial screen (#20918)

## **Description**

Perps tutorial was taking >5 seconds to load due to being wrapped in
`PerpsConnectionProvider`, which blocks rendering until WebSocket
connection completes.

**Solution:** Moved Tutorial to app-level navigation (outside provider)
while keeping all connected screens inside. Connection now initializes
in background during tutorial, eliminating the loading delay.

## **Changelog**

CHANGELOG entry: Fixed Perps tutorial taking over 5 seconds to load

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1840

## **Manual testing steps**

```gherkin
Feature: Perps Tutorial Loading Performance

  Scenario: First-time user navigates to tutorial
    Given user is a first-time Perps user
    When user taps "Trade" button from wallet actions
    Then tutorial displays instantly without "Connecting to perps" screen
    And WebSocket connection initializes in background

  Scenario: Tutorial to Markets navigation
    Given user is viewing tutorial
    When user completes or skips tutorial
    Then user navigates to Markets view
    And Markets loads with active WebSocket connection

  Scenario: Deeplink to tutorial for first-time user
    Given user is a first-time Perps user
    When user opens perps deeplink
    Then tutorial displays instantly
```

## **Screenshots/Recordings**

### **Before**
- Tutorial showed "Connecting to perps" loading screen for 5+ seconds

### **After**
- Tutorial displays instantly
- Connection establishes in background during tutorial (no loader ever
displayed since now connected when reaching marketlist screen)


https://github.com/user-attachments/assets/78c2f507-e9bc-4ee7-a51b-62b3955474c2


## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

## **Technical Details**

**Files changed:**
- `MainNavigator.js`: Added Tutorial as sibling to PERPS.ROOT
- `routes/index.tsx`: Removed Tutorial from PerpsScreenStack
- `PerpsTutorialCarousel.tsx`: Added background connection
initialization
- Navigation updates: `handlePerpsUrl.ts`, `WalletActions.tsx`,
`TradeWalletActions.tsx`, `PerpsGTMModal.tsx`, `WaysToEarn.tsx`,
`PerpsTabView.tsx`

**Navigation patterns:**
- Tutorial: Direct `navigate(Routes.PERPS.TUTORIAL)` (app level)
- Markets/other: Nested `navigate(Routes.PERPS.ROOT, { screen:
Routes.PERPS.MARKETS })` (inside provider)



<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Moves Perps tutorial to app-level navigation and initializes the perps
connection in the background; updates all navigation calls and related
tests.
> 
> - **Navigation**:
> - Move `Routes.PERPS.TUTORIAL` out of `PerpsScreenStack` into
`MainNavigator` and remove it from `UI/Perps/routes`.
> - Update callers to navigate directly to `Routes.PERPS.TUTORIAL`
(first-time users) and keep nested `Routes.PERPS.ROOT` for
markets/others:
> - `PerpsTabView`, `WalletActions`, `TradeWalletActions`,
`Rewards/WaysToEarn`, `PerpsGTMModal`, `handlePerpsUrl`.
> - **Tutorial**:
> - `PerpsTutorialCarousel`: start background connection via
`PerpsConnectionManager.connect()` with debug logging; minor view
cleanup.
> - Export `PerpsTutorialCarousel` from `UI/Perps/index` for app-level
use.
> - **Tests**:
> - Adjust expectations to direct `navigate(Routes.PERPS.TUTORIAL)`
across updated specs (PerpsTabView, GTM modal, Rewards WaysToEarn,
WalletActions, deeplink handler).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
6aade3b. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Nicholas Smith <nick.smith@consensys.net>
@runway-github runway-github Bot requested review from a team as code owners October 14, 2025 16:53
@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-runway-bot-deprecated DEPRECATED: please use "team-bots" instead label Oct 14, 2025
@Cal-L Cal-L added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Oct 14, 2025
@sonarqubecloud

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

@Cal-L Cal-L 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

@Cal-L Cal-L merged commit e6b30b5 into release/7.57.0 Oct 14, 2025
132 of 140 checks passed
@Cal-L Cal-L deleted the runway-cherry-pick-7.57.0-1760460800 branch October 14, 2025 21:59
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 14, 2025
@metamaskbot metamaskbot added the release-7.57.0 Issue or pull request that will be included in release 7.57.0 label Oct 14, 2025
@metamaskbot

Copy link
Copy Markdown
Collaborator

No release label on PR. Adding release label release-7.57.0 on PR, as PR was cherry-picked in branch 7.57.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.57.0 Issue or pull request that will be included in release 7.57.0 size-M skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-runway-bot-deprecated DEPRECATED: please use "team-bots" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants