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

Add Cart Variant Dropdown Selector for A/B Test #61174

Merged
merged 24 commits into from
Mar 17, 2022

Conversation

cbauerman
Copy link
Contributor

@cbauerman cbauerman commented Feb 16, 2022

Changes proposed in this Pull Request

  • Restructure <ItemVariantPicker /> component to render either radio buttons or dropdown.
  • Add A/B Test calypso_jetpack_cart_with_dropdown_variant_selector_2 to Calypso to control which variant picker type is used.
  • Miscellaneous supporting changes.

Testing instructions

  1. Boot branch as Calypso Blue
  2. Add a product for a Jetpack Site to the cart
  3. Verify the cart matches production in design
  4. Use the Abacus link from pbxNRc-1rJ-p2 to add yourself to the treatment of the test
  5. Refresh the cart and verify it now matches the design ( iIYWCXVJSm06ZfzbeEWUT0-fi-1834%3A23596 ) for the test: Screen Shot 2022-03-16 at 20 59 53 Screen Shot 2022-03-16 at 21 00 20
  6. Test the functionality of the dropdown selector
    • Clicking and keyboard controls should work
    • Space should open the sector, enter should select an option

@github-actions
Copy link

github-actions bot commented Feb 16, 2022

@matticbot
Copy link
Contributor

matticbot commented Feb 16, 2022

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

Sections (~1269 bytes added 📈 [gzipped])

name      parsed_size           gzip_size
checkout      +3859 B  (+0.3%)    +1269 B  (+0.3%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~1269 bytes added 📈 [gzipped])

name                                             parsed_size           gzip_size
async-load-calypso-my-sites-checkout-modal           +3859 B  (+0.4%)    +1269 B  (+0.5%)
async-load-calypso-blocks-editor-checkout-modal      +3859 B  (+0.4%)    +1269 B  (+0.5%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

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.

@cbauerman cbauerman force-pushed the add/cart-dropdown-variant-selector branch 2 times, most recently from cc63200 to 841da18 Compare February 24, 2022 17:54
@cbauerman cbauerman force-pushed the add/cart-dropdown-variant-selector branch 2 times, most recently from ad90ccd to e7f3737 Compare March 8, 2022 17:59
@cbauerman cbauerman force-pushed the add/cart-dropdown-variant-selector branch from 174579b to 816e310 Compare March 14, 2022 19:39
@cbauerman cbauerman force-pushed the add/cart-dropdown-variant-selector branch from 816e310 to af13fd9 Compare March 14, 2022 22:08
@cbauerman cbauerman changed the base branch from trunk to update/variant-picker-price March 15, 2022 18:45
@cbauerman cbauerman changed the base branch from update/variant-picker-price to trunk March 15, 2022 18:47
@cbauerman cbauerman force-pushed the add/cart-dropdown-variant-selector branch 2 times, most recently from 34e6114 to 36b7da5 Compare March 15, 2022 18:49
@cbauerman cbauerman changed the base branch from trunk to update/variant-picker-price March 15, 2022 18:49
@cbauerman cbauerman added [Feature] Shopping Cart Anything related to the shopping cart in Calypso, like adding items to the cart, the mini-cart, etc. ABTest [Size] M Medium sized issue labels Mar 15, 2022
Base automatically changed from update/variant-picker-price to trunk March 15, 2022 21:48
@cbauerman cbauerman force-pushed the add/cart-dropdown-variant-selector branch from 9beeeff to 89a868d Compare March 17, 2022 03:50
@cbauerman cbauerman marked this pull request as ready for review March 17, 2022 04:12
@cbauerman cbauerman requested a review from a team as a code owner March 17, 2022 04:12
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 17, 2022
@cbauerman cbauerman requested review from a team March 17, 2022 04:12
Copy link
Contributor

@elliottprogrammer elliottprogrammer left a comment

Choose a reason for hiding this comment

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

Tested and works very good as described. Looks good comparing to design. Code looks good & I don't spot any issues, except for 2 small nit-picks I describe in the comments below.
LGTM! 👍

@cbauerman cbauerman force-pushed the add/cart-dropdown-variant-selector branch from 8c7e627 to fe884cd Compare March 17, 2022 19:55
<ItemVariationRadioButtons { ...props } />
);
export const ItemVariationPicker: FunctionComponent< ItemVariationPickerProps > = ( props ) => {
if ( props.isLoading ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a temporary construct, once the A/B Test is complete it can be safely removed.

? 'dropdown'
: 'buttons'
}
isLoading={ isJetpackCheckout && isLoadingExperimentAssignment }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried separating the loading logic between here and the composite-checkout placeholder, but it still briefly flashed the radio buttons. isLoading is a temporary fix and can be removed once the test is complete.

@@ -0,0 +1,43 @@
import { keyframes } from '@emotion/react';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This whole component is part of a temporary fix and can be removed once the A/B test is complete.

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.

I didn't test it but the code looks good and I have no concerns from a payments perspective.

@cbauerman cbauerman merged commit b3b0aca into trunk Mar 17, 2022
@cbauerman cbauerman deleted the add/cart-dropdown-variant-selector branch March 17, 2022 22:40
@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 Mar 17, 2022
@a8ci18n
Copy link

a8ci18n commented Mar 17, 2022

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

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

@a8ci18n
Copy link

a8ci18n commented Mar 24, 2022

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
ABTest [Feature] Shopping Cart Anything related to the shopping cart in Calypso, like adding items to the cart, the mini-cart, etc. [Size] M Medium sized issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants