-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stepper: Fix back button in user step #97786
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~23 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
const lastPreAuthWalledStep = | ||
lastPreAuthWalledStepIndex < 0 ? null : flowSteps[ lastPreAuthWalledStepIndex ]; | ||
const flowStartsWithAuth = flowSteps[ 0 ].slug === 'user'; | ||
const hasHistory = location.key !== 'default'; | ||
|
||
return ( | ||
<StepComponent | ||
navigation={ { | ||
submit() { | ||
navigate( firstAuthWalledStep.slug, undefined, true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still made the flow become linear after the auth. The user will always be redirected to the first step that requires auth. However, there may be another path after the auth. For example, if the user comes from A2 step, we have to redirect them to B2 step after the auth. But the B1 step may be the first step that requires auth so that the user still goes to B2 step even if they are from the A2 step.
A1 -> auth -> B1
A2 -> auth -> B2
Closing in favor of #97775 |
An alternative proposal to #97775.
Related to #
Proposed Changes
This fixes the back button of the user step to go to the last step that was visited, not the step before it in the flow.
Why are these changes being made?
Because currently the back button assumed linearity and sometimes steps are skipped in Stepper.
Testing Instructions
designSetup
step.useGoalsFirstExperiment
hook to return false. This makes the user step the first step in the flow.