Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

alshakero
Copy link
Member

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

  1. Go to /setup/onboarding.
  2. Reach the user step.
  3. Click back, you should go to the designSetup step.
  4. Edit useGoalsFirstExperiment hook to return false. This makes the user step the first step in the flow.
  5. Go to /setup/onboarding.
  6. The user step shouldn't have a back button.

@alshakero alshakero requested a review from a team as a code owner December 25, 2024 16:46
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 25, 2024
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/back-button-in-user-step on your sandbox.

@matticbot
Copy link
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~23 bytes added 📈 [gzipped])

name           parsed_size           gzip_size
entry-stepper        +26 B  (+0.0%)      +23 B  (+0.0%)

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.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

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 );
Copy link
Contributor

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

@alshakero
Copy link
Member Author

Closing in favor of #97775

@alshakero alshakero closed this Jan 23, 2025
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants