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

composite-checkout: Make review step always visible (1) #42678

Merged

Conversation

sirbrillig
Copy link
Member

Changes proposed in this Pull Request

This PR is an experimental design change which modifies the first step of checkout so that it is always visible and active. This means that it no longer has a "Continue" button and will never be hidden when another step is active.

always-shown-review

Testing instructions

View composite checkout and make sure that it looks and works as expected. Notable things to try:

  • Change the plan length for a newly added plan.
  • Remove an item from the cart.
  • Add a coupon to the cart.

We make it always "inactive" and "complete" so that it displays a
checkmark as its icon and then show its content with
`completeStepContent`.
@matticbot
Copy link
Contributor

@sirbrillig sirbrillig self-assigned this May 26, 2020
@matticbot
Copy link
Contributor

matticbot commented May 26, 2020

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

Sections (~228 bytes removed 📉 [gzipped])

name      parsed_size           gzip_size
checkout      -1324 B  (-0.1%)     -228 B  (-0.1%)

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.

@fditrapani
Copy link
Contributor

fditrapani commented May 27, 2020

I made a minor style and copy tweak but otherwise looks great!

Here's an updated screenshot:

image

Copy link
Member

@michaeldcain michaeldcain left a comment

Choose a reason for hiding this comment

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

This LGTM.

Non-blocking, but without the busy continue button, there's no longer a loading state when the cart is updating. There are other loading indicators elsewhere in the UI (i.e. the summary) so let's create a separate task to follow-up on that.

loading-state

@michaeldcain michaeldcain added [Feature] Checkout The checkout screen and process for purchases made on WordPress.com. [Status] Ready to Merge labels May 27, 2020
@sirbrillig sirbrillig merged commit a3b590b into master May 27, 2020
@sirbrillig sirbrillig deleted the update/composite-checkout-review-step-always-active branch May 27, 2020 15:23
@a8ci18n
Copy link

a8ci18n commented May 27, 2020

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

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

michaeldcain added a commit that referenced this pull request Jun 2, 2020
@sirbrillig sirbrillig changed the title composite-checkout: Make review step always visible composite-checkout: Make review step always visible (1) Jun 3, 2020
michaeldcain added a commit that referenced this pull request Jun 3, 2020
* Bring back InactiveOrderReview from #42678

* Remove `totalStep` prop from `CheckoutStepBody`

This was only used for some computational CSS that was being overwritten in the same rule and could be achieved with a :last-of-type selector.

* stepNumber isn't required

* Add areStepsActive prop to CheckoutSteps component

* Allow checkout review to be editable and default to summary view

* Move nextStepNumber logic to CheckoutStep for progress control

* Prevent coupon field from redirecting steps on complete

This is leftover from when the first step was the Payment Method step. Adding a coupon happened in the final step, and could require more information from the payment method step. It doesn't break anything currently, but could be buggy in the future.

* Use WPCheckoutOrderReview and isSummaryVisible prop for inactive step

* Rename isSummaryVisible to isSummary

* Move summary styles to class selector

* Remove unused inactive step component

* goToNextStep should be undefined, when condition fails

* Pass couponFieldStateProps to WPCheckoutOrderReview in summary view

* Update strings

* Make inactive CheckoutStep(s) grey

* Update summary styles to match design

* Update those tests

* Updated font sizing and cleaned up spacing around coupon field

* Set CheckoutSteps to active when step is edited

* Use CheckoutSingleStep data provider to hide edit button on inactive steps

* Incorrect prop name

Co-authored-by: fditrapani <filippo.di.trapani@a8c.com>
@a8ci18n
Copy link

a8ci18n commented Jun 4, 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
[Feature] Checkout The checkout screen and process for purchases made on WordPress.com.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants