feat(perps): enhance tutorial navigation with redirect options#27423
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|



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:
navigateToTutorialOrScreenwrapper that checksselectIsFirstTimePerpsUser. If the user hasn't completed the tutorial, all navigation actions (title press, tile press, position press, "View more") redirect to the tutorial withredirectScreenandredirectParamsso the user lands on the originally intended screen after completing the tutorial. If the user has already completed the tutorial, navigation proceeds directly.redirectScreenandredirectParamsfrom route params. After tutorial completion (or skip), navigates to the redirect target instead of always going to Perps Home. UsesStackActions.replaceinstead ofnavigateso the tutorial screen is removed from the navigation stack — pressing back won't return to the tutorial.redirectScreenandredirectParamstoPerpsTutorialroute 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
Screenshots/Recordings
Before
After
selectIsFirstTimePerpsUserwas mocked to be trueperps-tutorial.mov
Pre-merge author checklist
Pre-merge reviewer checklist
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/redirectParamsroute params.Updates the tutorial completion/skip flow to
StackActions.replaceintoRoutes.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.