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 purchase details into second column #41063

Merged
merged 30 commits into from
Apr 22, 2020

Conversation

michaeldcain
Copy link
Member

@michaeldcain michaeldcain commented Apr 13, 2020

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)
  • moves CheckoutStepBody component inside CheckoutSteps
  • 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

@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Apr 14, 2020

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

Sections (~1199 bytes added 📈 [gzipped])

name      parsed_size           gzip_size
checkout      +5641 B  (+0.4%)    +1199 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.

@michaeldcain michaeldcain force-pushed the update/checkout-two-column-layout branch 5 times, most recently from 9b9e07f to 9754cf8 Compare April 20, 2020 19:08
@michaeldcain michaeldcain force-pushed the update/checkout-two-column-layout branch from fb18e8a to 9c6479d Compare April 21, 2020 18:53
@michaeldcain michaeldcain force-pushed the update/checkout-two-column-layout branch from 9c6479d to 80786e3 Compare April 21, 2020 18:56
<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

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.

The code is looking good! Made some small suggestions. Tested both the demo and the calypso version and both look good to me!

packages/composite-checkout/README.md Outdated Show resolved Hide resolved
packages/composite-checkout/README.md Outdated Show resolved Hide resolved
packages/composite-checkout/src/lib/line-items.js Outdated Show resolved Hide resolved
@michaeldcain
Copy link
Member Author

@sirbrillig: thanks for the review. I believe I've addressed your feedback and this is ready for another go.

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.

Works as described! Thanks!

@michaeldcain michaeldcain merged commit 9ef61e7 into master Apr 22, 2020
@michaeldcain michaeldcain deleted the update/checkout-two-column-layout branch April 22, 2020 13:20
michaeldcain added a commit that referenced this pull request Apr 22, 2020
michaeldcain added a commit that referenced this pull request Apr 22, 2020
@michaeldcain michaeldcain restored the update/checkout-two-column-layout branch April 22, 2020 14:18
@manzoorwanijk
Copy link
Member

A false positive here. I linked a Jetpack issue to #98930 which as the same issue ID as this PR 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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