Skip to content

Launch site: send the Back button to the page the launch started from - #113953

Merged
paulopmt1 merged 2 commits into
trunkfrom
emdash/back-button-site-visibility-fix-rsgiw
Sep 1, 2026
Merged

Launch site: send the Back button to the page the launch started from#113953
paulopmt1 merged 2 commits into
trunkfrom
emdash/back-button-site-visibility-fix-rsgiw

Conversation

@paulopmt1

@paulopmt1 paulopmt1 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes DOTOBRD-606

Proposed Changes

  • /start/launch-site now takes an optional redirect_to query dependency that sets the post-launch destination, leaving back_to to mean only "the page the user came from".
  • useSiteLaunch() forwards its existing postLaunchUrl option as redirect_to, so the option now covers the signup-flow path as well as the immediate-launch path.
  • Site visibility settings passes postLaunchUrl (the site home) rather than overriding back_to with it. SiteLaunchButton's backTo prop had no other consumer, so it becomes postLaunchUrl.

The omnibar/masterbar launch buttons are unchanged: they pass an explicit backTo (the site overview), which is what that option is for.

Why are these changes being made?

The launch flow uses back_to for two different things: the Back button on the first step (domains-launch) and the destination after the site is live. The dashboard's site visibility settings set back_to to the site home so that launching would land the user there, which also repointed the Back button — so clicking Back from /start/launch-site/domains-launch dropped the user on the site home instead of the site visibility page they came from.

Splitting the two meanings fixes Back without changing where anyone lands after a successful launch.

Testing Instructions

  1. Pick an unlaunched site.
  2. Go to its site visibility settings in the dashboard: /sites/<site-slug>/settings/site-visibility.
  3. Click "Launch your site". You land on /start/launch-site/domains-launch.
  4. Click "Back" — you should return to the site visibility page, not the site home.
  5. Go through the flow and launch the site — you should still land on the site home with the launch celebration.
  6. Repeat 3–5 from the "Launch site" button in the omnibar/masterbar to confirm it is unaffected: Back and a successful launch both go to the site overview, as before.

Automated coverage: yarn test-client client/signup/test/flows.js client/dashboard/sites/site-launch-button

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • For UI changes, have you tested the affected components in dark mode?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

🤖 Generated with Claude Code

https://claude.ai/code/session_01CfPtNr1ULYu5k2NjnKQqm4

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

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

Sections (~42 bytes added 📈 [gzipped])

Details
Name Parsed Gzip
signup +181 B +0.1% +42 B +0.1%
async-step-unified-plans +99 B +0.0% +22 B +0.0%

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~24 bytes added 📈 [gzipped])

Details
Name Parsed Gzip
async-load-calypso-layout-masterbar-omnibar +54 B +0.0% +24 B +0.0%

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

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.

@paulopmt1
paulopmt1 marked this pull request as ready for review August 31, 2026 19:48
@paulopmt1
paulopmt1 requested a review from a team as a code owner August 31, 2026 19:48
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 31, 2026
@paulopmt1
paulopmt1 force-pushed the emdash/back-button-site-visibility-fix-rsgiw branch from 090d09b to 7870f52 Compare August 31, 2026 20:01
The site visibility settings passed `backTo` to steer where the user lands
after launching, but `back_to` also drives the flow's Back button, so Back
went to the site home instead of the settings page the user came from.

Give the post-launch landing its own query arg, `redirect_to`, and leave
`back_to` meaning "the page the Back button returns to".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfPtNr1ULYu5k2NjnKQqm4
@paulopmt1
paulopmt1 force-pushed the emdash/back-button-site-visibility-fix-rsgiw branch from 7870f52 to e4f1771 Compare August 31, 2026 20:04
…unch

`postLaunchUrl` already decided where an immediate launch leaves the user, so
forwarding it as the flow's `redirect_to` made the site visibility page navigate
away on the hosting-trial, staging and pre-launch-modal paths. Split the two: a
new `flowDestination` feeds `redirect_to` (normalised through
`dashboardLinkWithBackport()` like `backTo`), and `postLaunchUrl` keeps its
original meaning.

Also re-read `redirect_to` from the query on every launch-site entry, so an
abandoned flow's value can't linger in the signup dependency store and decide
where the next launch lands.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS45ELrLYWcFsZz2mefDC9
@paulopmt1
paulopmt1 requested a review from a team August 31, 2026 21:47

@bogiii bogiii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed; it works as described. 👍

Worth mentioning that we should test and cover the same thing for the simple sites and atomic sites.

Example (Simple site):
Image

Image

In this scenario, the heading "Back to sites" seems wrong, since I came there from the simple site wp-admin.

Also, one comment from the agent reviewer:

Consistency: redirect_to gets a store reset, back_to doesn't (low)

client/signup/controller.js:309 resets stale redirect_to on flow entry because the signup dependency store persists between visits. back_to has the same persistence property but no reset. Not currently exploitable — the launch-site entry points always set back_to (settings form defaults to redirectToDashboardLink; omnibar sets siteOverviewUrl), so it's never absent — but the asymmetry is a latent trap if a future caller omits back_to. Worth a one-line comment noting why only redirect_to needs the reset.

@paulopmt1
paulopmt1 merged commit c5bf549 into trunk Sep 1, 2026
13 checks passed
@paulopmt1
paulopmt1 deleted the emdash/back-button-site-visibility-fix-rsgiw branch September 1, 2026 17:36
@paulopmt1

Copy link
Copy Markdown
Contributor Author

Good catch @bogiii, I'll follow-up with that

@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 Sep 1, 2026
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