Onboarding: Fix back navigation from Plans step when returning from checkout #106908
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes https://linear.app/a8c/issue/CHE-259/back-button-on-plans-page-returns-me-to-shopping-cart
Proposed Changes
When going through the onboarding flow to checkout and back to the plans step, the "Back" button (on the Plans step) redirects to checkout. This is flagged as an issue to resolve; the back navigation from the "plans" step should be to "domains" (or the auxiliary "use-my-domain"). This is what the PR accomplishes.
This is a tricky one. The PR uses the deprecated
goBackmethod for fixing this. The flow ultimately defines the canonical step order and branching semantics (domains vs. use-my-domain). So it authoritatively decides that the predecessor for Plans is Domains when there’s no in-flow history, avoiding brittle heuristics. That's the essence of the approach, but hopefully there are other fixes (I only later saw thatgoBackis marked as deprecated).Deferring to @alshakero or @Automattic/quake team for direction (as I believe they own signup).
Why are these changes being made?
Fixes https://linear.app/a8c/issue/CHE-259/back-button-on-plans-page-returns-me-to-shopping-cart
Testing Instructions
/v2/sitesand create a new sitePre-merge Checklist