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

Gutenboarding: move design picker state in onboarding store #38757

Merged

Conversation

razvanpapadopol
Copy link

@razvanpapadopol razvanpapadopol commented Jan 9, 2020

Changes proposed in this Pull Request

Testing instructions

  • Selected page layouts should be persisted during one visit (including when selecting a different design or navigating to previous step and back)

Fixes one issue mentioned in #38583 (review)

Esc cancels all page selections and returns to design picker, just like clicking outside page selector does as well. I expected my page selections to remain tho; they got wiped out.

@razvanpapadopol razvanpapadopol added [Status] In Progress [Feature Group] Signup & Site Onboarding Tools for user registration and onboarding new users to the site. labels Jan 9, 2020
@razvanpapadopol razvanpapadopol requested a review from a team as a code owner January 9, 2020 20:23
@razvanpapadopol razvanpapadopol self-assigned this Jan 9, 2020
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Jan 9, 2020

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

App Entrypoints (~38 bytes added 📈 [gzipped])

name                 parsed_size           gzip_size
entry-gutenboarding       +268 B  (+0.0%)      +38 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

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.

Razvan Papadopol added 4 commits January 10, 2020 15:03
- connect PageLayoutSelector to store via hooks
- remove props selectedLayouts and selectLayout from PageLayoutSelector component
- remove selectedLayouts state from DesignSelector component
@razvanpapadopol razvanpapadopol force-pushed the update/onboarding-store-include-design-picker-state branch from 5be19b2 to 023a81e Compare January 10, 2020 13:09
@razvanpapadopol razvanpapadopol added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Jan 10, 2020
@chriskmnds
Copy link
Contributor

LGTM

  1. selected pages
  2. scrolled/open different designs - same pages selected
  3. went back/forth - same pages selected

@@ -43,7 +43,24 @@ const siteVertical: Reducer<
return state;
};

const reducer = combineReducers( { domain, siteTitle, siteVertical } );
const pageLayouts: Reducer< Set< string >, ReturnType< typeof Actions[ 'togglePageLayout' ] > > = (
state = new Set(),
Copy link
Member

Choose a reason for hiding this comment

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

I suspect we'll end up persisting this, Set won't serialize well, and we don't have fine-grained control over the wp-data persistence behavior.

Shall we add pageLayouts to the persistence array and see how this behaves?

Copy link
Author

Choose a reason for hiding this comment

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

Good catch. It should work now with Array. I've set it to persist and we can remove later if needed.

Copy link
Contributor

@chriskmnds chriskmnds Jan 10, 2020

Choose a reason for hiding this comment

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

& good to know :-)

- replace Set with Array to save page layouts
Copy link
Member

@sirreal sirreal left a comment

Choose a reason for hiding this comment

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

👍 Thanks!

client/landing/gutenboarding/stores/onboard/reducer.ts Outdated Show resolved Hide resolved
@@ -23,3 +30,8 @@ export const setSiteTitle = ( siteTitle: string ) => ( {
type: ActionType.SET_SITE_TITLE as const,
siteTitle,
} );

export const togglePageLayout = ( pageLayout: Template ) => ( {
Copy link
Member

Choose a reason for hiding this comment

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

I don't like toggle as an action and prefer add/remove, but this is fine for now 🙂

@sirreal sirreal added [Status] Ready to Merge [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jan 10, 2020
@razvanpapadopol razvanpapadopol merged commit 472d7b0 into master Jan 10, 2020
@razvanpapadopol razvanpapadopol deleted the update/onboarding-store-include-design-picker-state branch January 10, 2020 20:07
@matticbot matticbot removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] Ready to Merge labels Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Signup & Site Onboarding Tools for user registration and onboarding new users to the site.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants