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

New Checkout: split layout (take 2) #41373

Merged
merged 35 commits into from
Apr 22, 2020

Conversation

michaeldcain
Copy link
Member

Originally attempted in #41063 and reverted in #41363

This does a few things with the ultimate goal of splitting out a summary into a separate column on desktop screens.

  • adds the floated CheckoutSummary component to composite-checkout (package, demo, documentation)
  • add CheckoutStepArea component to handle styling of CheckoutSteps + CheckoutStepBody
  • uses CheckoutSummary in WPcom's implementation of composite-checkout
  • moves the current site's address to the review step
  • adds a default set of purchase features to the summary (per-product features coming in a future PR)
  • hides CheckoutSummary on mobile screens (collapse mobile toggle coming in future PR)
Before After
before-desktop after-desktop
before-mobile after-mobile

Fixes: #41088

To test:

  • it might help to step through the PR, commit by commit, but no promises that I didn't change my mind later on in the PR
  • run the composite-checkout demo with yarn run composite-checkout-demo
  • verify that minimal CheckoutSummary is displayed
  • verify that the demo otherwise works as expected
  • from dev or calypso.live, and a plan and/or domain to your cart and visit Checkout with ?flags=composite-checkout-testing
  • verify that on desktop (>960px), the checkout summary is displayed, floated to the right, with a list of default features, and the tax (once calculated) and total
  • verify that on screens smaller than desktop, the checkout summary is hidden
  • verify that Checkout otherwise works as expected

- Move CheckoutStepBody inside CheckoutSteps
- Split real steps from not
- Move `checkout-content` back to Checkout component
- Update loading
- Update demo
- Remove props from Checkout Summary so that component just renders children
- Update demo and defaults
- Fix summary height when split into columns
- adds the component and shifts the step wrapper styles to it
- removes CheckoutSteps children splitting logic
- moves CheckoutSteps (and CheckoutStep children) and CheckoutStepBody to new component in default Checkout
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Apr 22, 2020

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

Sections (~1135 bytes added 📈 [gzipped])

name      parsed_size           gzip_size
checkout      +5415 B  (+0.4%)    +1135 B  (+0.4%)

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.

<CheckoutSummaryFeaturesList>
<CheckoutSummaryFeaturesListItem>
<WPCheckoutCheckIcon />
{ translate( 'Live chat and email support' ) }
Copy link

Choose a reason for hiding this comment

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

ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 29 times:
translate( 'Email and live chat support' ) ES Score: 9
See 2 additional suggestions in the PR translation status page

</CheckoutSummaryFeaturesListItem>
<CheckoutSummaryFeaturesListItem>
<WPCheckoutCheckIcon />
{ translate( 'Dozens of free themes' ) }
Copy link

Choose a reason for hiding this comment

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

ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 19 times:
translate( 'Dozens of free themes.' ) ES Score: 15
See 2 additional suggestions in the PR translation status page

</CheckoutSummaryFeaturesListItem>
<CheckoutSummaryFeaturesListItem>
<WPCheckoutCheckIcon />
{ translate( 'Money back guarantee' ) }
Copy link

Choose a reason for hiding this comment

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

ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 17 times:
translate( '30-day Money Back Guarantee' ) ES Score: 9

@michaeldcain michaeldcain added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 22, 2020
@fditrapani
Copy link
Contributor

This is looking great! the immediate thing that pops out is that the benefits in the right column are static and not reflecting the products in the cart. This is what I get for a domain only:

image

and this is the business plan:

image

If we want to start with static, that's ok but we'll need to make sure the benefits are generic enough for all our products.

====

I don't know if this is a regression but I'm upgrading my plan and it's defaulting to the two year length without giving me the choice of switching back to the one year. You can see it in the screenshot above.

Copy link
Member

@sirbrillig sirbrillig left a comment

Choose a reason for hiding this comment

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

LGTM! Tested and it appears to work correctly.

@michaeldcain michaeldcain merged commit 5bc3d40 into master Apr 22, 2020
@michaeldcain michaeldcain deleted the update/checkout-two-column-layout branch April 22, 2020 21:16
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 22, 2020
@michaeldcain
Copy link
Member Author

If we want to start with static, that's ok but we'll need to make sure the benefits are generic enough for all our products.

@fditrapani: I did this to get it out the door. The most generic are the support and money back points.

I don't know if this is a regression but I'm upgrading my plan and it's defaulting to the two year length without giving me the choice of switching back to the one year. You can see it in the screenshot above.

We talked about this in Slack, but it's the current Checkout behavior to default to the variation that you currently have selected. I agree that it'd be great to show the other available variations too. I'll look into what'd be required for that.

@a8ci18n
Copy link

a8ci18n commented May 22, 2020

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/3349298

Thank you @michaeldcain for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented May 26, 2020

Translation for this Pull Request has now been finished.

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.

Composite Checkout: split 'Order Summary' to side column on desktop. (4)
5 participants