Launch site: send the Back button to the page the launch started from - #113953
Conversation
|
WordPress.com
Automattic for Agencies
|
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~42 bytes added 📈 [gzipped]) Details
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
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. |
090d09b to
7870f52
Compare
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
7870f52 to
e4f1771
Compare
…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
bogiii
left a comment
There was a problem hiding this comment.
Reviewed; it works as described. 👍
Worth mentioning that we should test and cover the same thing for the simple sites and atomic sites.
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.
|
Good catch @bogiii, I'll follow-up with that |

Fixes DOTOBRD-606
Proposed Changes
/start/launch-sitenow takes an optionalredirect_toquery dependency that sets the post-launch destination, leavingback_toto mean only "the page the user came from".useSiteLaunch()forwards its existingpostLaunchUrloption asredirect_to, so the option now covers the signup-flow path as well as the immediate-launch path.postLaunchUrl(the site home) rather than overridingback_towith it.SiteLaunchButton'sbackToprop had no other consumer, so it becomespostLaunchUrl.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_tofor 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 setback_toto 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-launchdropped 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
/sites/<site-slug>/settings/site-visibility./start/launch-site/domains-launch.Automated coverage:
yarn test-client client/signup/test/flows.js client/dashboard/sites/site-launch-buttonPre-merge Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01CfPtNr1ULYu5k2NjnKQqm4