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

Remove design picker from site-setup flow #97540

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

p-jackson
Copy link
Member

@p-jackson p-jackson commented Dec 17, 2024

Related to #97383

Proposed Changes

Builds on the changes in #97383 which moves the design picker to the onboarding flow.

In the "goals first" experiment:

CleanShot.2024-12-17.at.19.16.16.mp4

You still can't test premium themes/variations because this modal still blocks the user from moving forward. That can be removed in another PR.

CleanShot 2024-12-17 at 19 39 48@2x

Why are these changes being made?

For free sites with free themes it just needs to happen after site creation. It strikes me now that if a user chooses free everything we can do it in the onboarding flow before redirecting to /home
For paid themes, we need to be sure the user successfully completed checkout before we apply the design. That's why it has to be in a separate flow after the checkout.
This PR implements the separate flow, since that works for free and paid. But skipping the extra flow for free sites seems like a nice bit of polish.

Testing Instructions

  • Test by running through the /setup/onboarding flow
    • Need to test using sites with a free plan and sites with paid plans. Both should have the theme applied to the site once the flow is complete
  • Also make sure the /start flow hasn't changed! The /start flow eventually lands in the site-setup flow and it needs to still have the goals and design picker step working as expected

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

@matticbot
Copy link
Contributor

matticbot commented Dec 17, 2024

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 update/dp-before-site-creation-2 on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Dec 17, 2024

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

Sections (~548 bytes added 📈 [gzipped])

name             parsed_size           gzip_size
site-setup-wg        +2541 B  (+1.6%)     +548 B  (+1.7%)
site-setup-flow      +2541 B  (+1.6%)     +548 B  (+1.8%)

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.

@arthur791004
Copy link
Contributor

arthur791004 commented Dec 17, 2024

I'm curious why do we need to redirect to the site-setup flow after the onboarding in the "goals first" experiment?

@taipeicoder
Copy link
Contributor

taipeicoder commented Dec 17, 2024

According to this comment #97383 (comment) it's so that we can reuse the flow for theme activation. Perhaps we can use another flow for this, like /with-theme?

@p-jackson
Copy link
Member Author

@arthur791004 the issue is that we need somewhere to apply the design to the site.
For free sites with free themes it just needs to happen after site creation. It strikes me now that if a user chooses free everything we can do it in the onboarding flow before redirecting to /home
For paid themes, we need to be sure the user successfully completed checkout before we apply the design. That's why it has to be in a separate flow after the checkout.
This PR implements the separate flow, since that works for free and paid. But skipping the extra flow for free sites seems like a nice bit of polish.

@taipeicoder I'll take a look into the with-theme flow! I wasn't aware that there might already be a flow that could do this work for us. Part of me wonders whether it's better to use the main flow though, for the A/B test. There was some talk of disparities when trying to compare metrics between start and setup/onboarding. Maybe we want both variations of the experiment to use the exact same flow so that the metrics differ as little as possible?

@arthur791004
Copy link
Contributor

arthur791004 commented Dec 17, 2024

Perhaps we can use another flow for this, like /with-theme?

There is another flow called update-design to allow users to change their design from the launchpad 😅

@arthur791004 arthur791004 marked this pull request as ready for review December 17, 2024 06:37
@arthur791004
Copy link
Contributor

Oops...I misclicked the "Ready for review" 😓

@taipeicoder
Copy link
Contributor

Is there a step that does the theme activation? If so, would bringing that step to /setup/onboarding work better?


return setDesignOnSite( siteSlugOrId, selectedDesign, {
styleVariation: selectedStyleVariation,
globalStyles: {},
Copy link
Member Author

Choose a reason for hiding this comment

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

@arthur791004 to hack things together and get it working we just passed an empty object here for globalStyles. It works, but I'm not sure why or whether this is a problem.

The design picker passes a proper globalStyles object here, but the data is loaded very indirectly, so I don't know the easy way to pass the global styles in here.

Copy link
Contributor

@arthur791004 arthur791004 Dec 17, 2024

Choose a reason for hiding this comment

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

The empty object{} will clear the user's global styles on the selected theme because people may come from the existing sites.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm...the preselected global styles can be loaded via query parameters but it needs to go through the Design Preview step to load the data...

I think we can address this in the follow-up PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I tried to see if things would work by changing this to use selectedGlobalStyles which is now loading from the store but it's not loading, would need more investigation for this.

@arthur791004
Copy link
Contributor

Is there a step that does the theme activation? If so, would bringing that step to /setup/onboarding work better?

We don't have this step because the theme activation should happen when people finish the flow. If we activate the theme immediately, we have to do it again when people go back to the Design Picker....

Copy link
Contributor

@arthur791004 arthur791004 left a comment

Choose a reason for hiding this comment

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

Let's go 🚢

Base automatically changed from update/dp-before-site-creation to trunk December 17, 2024 08:19
@candy02058912 candy02058912 requested a review from a team as a code owner December 17, 2024 08:19
@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 17, 2024
@candy02058912 candy02058912 force-pushed the update/dp-before-site-creation-2 branch from 955b414 to d04f02e Compare December 17, 2024 08:25
@candy02058912 candy02058912 removed the request for review from a team December 17, 2024 08:25
Copy link
Contributor

@candy02058912 candy02058912 left a comment

Choose a reason for hiding this comment

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

Getting the globalStyles and styleVariation still needs to be worked in a follow-up PR, but this is good to 🚢 to keep things going.


return setDesignOnSite( siteSlugOrId, selectedDesign, {
styleVariation: selectedStyleVariation,
globalStyles: {},
Copy link
Contributor

Choose a reason for hiding this comment

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

I tried to see if things would work by changing this to use selectedGlobalStyles which is now loading from the store but it's not loading, would need more investigation for this.

@candy02058912 candy02058912 merged commit 926ead6 into trunk Dec 17, 2024
11 checks passed
@candy02058912 candy02058912 deleted the update/dp-before-site-creation-2 branch December 17, 2024 12:03
@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 Dec 17, 2024
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.

5 participants