Skip to content

Skip domain step if launch-site triggered from wp-admin #103746

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

Merged
merged 4 commits into from
May 28, 2025

Conversation

dzver
Copy link
Member

@dzver dzver commented May 27, 2025

Part of DOTCOM-13180

Proposed Changes

  • wp-admin links to start/launch-site for unlaunched sites
  • When a site already has a domain, we should skip the domain step
  • When a site completes the flow with or without a purchase of some kind, we should display a message that the site was launched

Why are these changes being made?

  • wp-admin triggered launch-site doesn't match the one from Calypso

Testing Instructions

  1. Unlaunching a site requires a sandbox - use your site instead of dzver13d
wp option --url=dzver13d.wordpress.com set launch-status unlaunched
  1. Enable the store sandbox
  2. Get a plan AND domain
  3. Go to wp-admin > Settings > Reading and click the button.
  4. Change the wordpress.com address with calypso.localhost:3000
  5. Complete the flow, domain step should be skipped, modal should be displayed
  6. Get a domain but make sure you're on FREE
  7. Repeat steps 4-6, this time you'll be asked to get a plan. No matter which plan you select, completing the flow should display the celebratory modal
  8. You can try the case with plan but no domain just in case

These are the launch buttons in the settings page, they are two and do the same:
Screenshot 2025-05-27 at 17 21 13

This is the modal that's currently only displayed if we launch from Calypso:
Screenshot 2025-05-27 at 16 00 07

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?
  • 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)?

@dzver dzver requested a review from chriskmnds May 27, 2025 14:31
Copy link

github-actions bot commented May 27, 2025

@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 May 27, 2025
@dzver dzver self-assigned this May 27, 2025
@matticbot
Copy link
Contributor

matticbot commented May 27, 2025

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

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

  • blaze-dashboard
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/launch-site-skip-domain-step-if-domain-present on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented May 27, 2025

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

Sections (~66 bytes added 📈 [gzipped])

name                        parsed_size           gzip_size
signup                           +231 B  (+0.1%)      +66 B  (+0.1%)
home                             +141 B  (+0.0%)      +47 B  (+0.0%)
async-step-unified-plans         +141 B  (+0.0%)      +47 B  (+0.0%)
async-step-unified-domains       +141 B  (+0.0%)      +47 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.

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.

Copy link
Contributor

@chriskmnds chriskmnds left a comment

Choose a reason for hiding this comment

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

Tested per the instructions, and it works. Took me ages to test. I haven't tested other flows though, whether this would have any effect on them (I see some more general changes, not launch-site specific). Left a couple of comments for clarity, but otherwise the outlined example tests out.

p.s. This flow will need to migrate to Stepper, so left a relevant comment on that too.

Comment on lines 1068 to 1073
const domainCart = undefined;

submitSignupStep( { stepName, domainItem }, { domainItem } );
submitSignupStep( { stepName, domainItem }, { domainItem, domainCart } );
recordExcludeStepEvent( stepName, tracksEventValue );

fulfilledDependencies = [ 'domainItem', 'siteId', 'siteSlug', 'themeItem' ];
fulfilledDependencies = [ 'domainItem', 'domainCart' ];
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand what these changes do. Why do we add the undefined domainCart item in the submit-step call?

Copy link
Member Author

Choose a reason for hiding this comment

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

Boils down to the function with the very-generic name isDomainFulfilled, which is only used for the launch-site flow. If domainCart is not fulfilled, it doesn't exclude the step.

So, why is the domainCart a dependency for the domain step? It doesn't need to be. However, we already have the code for domainItem written this way, and it just doesn't work because of the second dependency. Why undefined - not sure, I followed what's already done for domainItem.

// Add celebrateLaunch=true for launch-site flow so the celebration modal shows after checkout
const isLaunchSiteFlow = flowName === 'launch-site';
const finalCheckoutBackUrl = isLaunchSiteFlow
? addQueryArgs( { skippedCheckout: 1, celebrateLaunch: 'true' }, checkoutBackUrl )
Copy link
Contributor

Choose a reason for hiding this comment

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

Would Stepper handle this any differently, meaning without using a query arg? cc @alshakero The logic here and below is it shows a celebratory modal when sent to /home after having launched the site.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm actually, I think maybe it doesn't matter - or come into the picture of "no query args". The way I understand this, the flow itself isn't accepting any args, just sending back with an arg.

Comment on lines 283 to 287
// Re-check fulfilled steps when siteDomains data changes
// This ensures that isDomainFulfilled is called again when domain data loads
if ( siteDomains !== prevProps.siteDomains ) {
this.removeFulfilledSteps( this.props );
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this affect other flows?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removing fulfilled steps shouldn't (why would fulfilled steps be still there?) but it might be a good idea to restrict to the launch-site flow to ensure we don't need to test them. Nice find.

@dzver dzver force-pushed the update/launch-site-skip-domain-step-if-domain-present branch from 94e0163 to 3e6b999 Compare May 28, 2025 08:54
@dzver dzver merged commit f805210 into trunk May 28, 2025
11 checks passed
@dzver dzver deleted the update/launch-site-skip-domain-step-if-domain-present branch May 28, 2025 10:50
@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 May 28, 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