Skip to content

feat(perps): enhance tutorial navigation with redirect options#27423

Merged
PatrykLucka merged 1 commit into
mainfrom
TMCU-566-bug-clicking-on-perps-through-homescreen-section-does-not-trigger-tutorial
Mar 12, 2026
Merged

feat(perps): enhance tutorial navigation with redirect options#27423
PatrykLucka merged 1 commit into
mainfrom
TMCU-566-bug-clicking-on-perps-through-homescreen-section-does-not-trigger-tutorial

Conversation

@PatrykLucka

@PatrykLucka PatrykLucka commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Description

Problem: When a first-time perps user tapped any item in the Perpetuals homepage section (market tile, position row, "View more" card, or section title), they were navigated directly to the perps screens without seeing the tutorial first. The tutorial was only triggered via the main action button.

Solution:

  • PerpsSection: Added a navigateToTutorialOrScreen wrapper that checks selectIsFirstTimePerpsUser. If the user hasn't completed the tutorial, all navigation actions (title press, tile press, position press, "View more") redirect to the tutorial with redirectScreen and redirectParams so the user lands on the originally intended screen after completing the tutorial. If the user has already completed the tutorial, navigation proceeds directly.
  • PerpsTutorialCarousel: Reads redirectScreen and redirectParams from route params. After tutorial completion (or skip), navigates to the redirect target instead of always going to Perps Home. Uses StackActions.replace instead of navigate so the tutorial screen is removed from the navigation stack — pressing back won't return to the tutorial.
  • Navigation types: Added redirectScreen and redirectParams to PerpsTutorial route params.

Tests: Unit tests added/updated for PerpsSection (first-time user tutorial redirect for each interaction type) and PerpsTutorialCarousel (redirect with params, redirect without params, skip redirect, fallback to default).

Changelog

CHANGELOG entry: Fixed a bug where tapping perpetuals items on the homepage did not show the tutorial for first-time users

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-566

Manual testing steps

Feature: Homepage Perpetuals section triggers tutorial for first-time users

  Scenario: first-time user taps a market tile on the homepage perps section
    Given the user has never completed the perps tutorial
    And the Perpetuals section is visible on the homepage with trending markets

    When the user taps a market tile (e.g. SOL)
    Then the perps tutorial carousel is displayed
    And after completing or skipping the tutorial, the user lands on the Market Details screen for that market

  Scenario: first-time user taps "View more" on the homepage perps section
    Given the user has never completed the perps tutorial
    And the Perpetuals section is visible on the homepage

    When the user taps the "View more" card
    Then the perps tutorial carousel is displayed
    And after completing or skipping the tutorial, the user lands on the Market List screen

  Scenario: first-time user taps the Perpetuals section title
    Given the user has never completed the perps tutorial

    When the user taps the "Perpetuals" title
    Then the perps tutorial carousel is displayed
    And after completing or skipping the tutorial, the user lands on Perps Home

  Scenario: first-time user taps a position row on the homepage perps section
    Given the user has never completed the perps tutorial
    And the user has open positions shown in the Perpetuals section

    When the user taps a position row (e.g. BTC)
    Then the perps tutorial carousel is displayed
    And after completing or skipping the tutorial, the user lands on Market Details with the position tab selected

  Scenario: returning user navigates directly without tutorial
    Given the user has already completed the perps tutorial

    When the user taps any item in the Perpetuals section
    Then the user navigates directly to the target screen without seeing the tutorial

  Scenario: back navigation does not return to tutorial
    Given the user just completed the tutorial and was redirected to a perps screen

    When the user presses the back button
    Then the user does NOT return to the tutorial screen (it was replaced in the stack)

Screenshots/Recordings

Before

After

selectIsFirstTimePerpsUser was mocked to be true

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

Note

Medium Risk
Changes navigation behavior for first-time perps users and replaces screens in the navigation stack, which could impact routing/back behavior if params are wrong or screens aren’t in the expected stack.

Overview
Ensures first-time Perps users who tap items in the homepage Perpetuals section are routed through the tutorial first, then redirected to their originally intended Perps destination (home, market list, or market details) using new redirectScreen/redirectParams route params.

Updates the tutorial completion/skip flow to StackActions.replace into Routes.PERPS.ROOT (removing the tutorial from back stack) and adds test coverage for redirect cases and first-time-user homepage interactions.

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

@PatrykLucka PatrykLucka self-assigned this Mar 12, 2026
@PatrykLucka PatrykLucka marked this pull request as ready for review March 12, 2026 12:49
@PatrykLucka PatrykLucka requested a review from a team as a code owner March 12, 2026 12:49
@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-ux Mobile UX team label Mar 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: @PerformancePreps
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
Changes are limited to Perps UI components (PerpsTutorialCarousel, PerpsSection) and related navigation/types. These directly impact the Perps feature entry points and views. According to tag dependencies, selecting SmokePerps requires also selecting SmokeWalletPlatform (Perps is embedded in the Trending tab and homepage sections) and SmokeConfirmations (Add Funds flow triggers on-chain transactions). No evidence of changes to core controllers, Engine, network layer, or shared wallet infrastructure, so broader tags (Accounts, Identity, Network, MultiChainAPI, Card, Ramps, etc.) are not required.

Performance Test Selection:
UI changes in Perps components (tutorial carousel and homepage Perps section) could affect rendering performance and interaction timing within the Perps trading flows. Running @PerformancePreps ensures market loading, add funds flow, and Perps screen performance are not regressed. No changes suggest impact to launch, onboarding, login, swaps, or global asset loading performance.

View GitHub Actions results

@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

@sonarqubecloud

Copy link
Copy Markdown

@PatrykLucka PatrykLucka added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit 6b4798f Mar 12, 2026
119 checks passed
@PatrykLucka PatrykLucka deleted the TMCU-566-bug-clicking-on-perps-through-homescreen-section-does-not-trigger-tutorial branch March 12, 2026 14:15
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 12, 2026
@metamaskbot metamaskbot added the release-7.70.0 Issue or pull request that will be included in release 7.70.0 label Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.70.0 Issue or pull request that will be included in release 7.70.0 size-M team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants