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

Plans 2023: Implement storage add on dropdown #79041

Merged
merged 57 commits into from
Aug 2, 2023

Conversation

jeyip
Copy link
Contributor

@jeyip jeyip commented Jul 5, 2023

Related to https://github.com/Automattic/martech/issues/1907

Proposed Changes

  • User should be able to select additional storage for Business and Ecommerce plans:

    • Hide dropdown behind feature flag because we're waiting for storage caps to actually be lowered
    • Render storage selection dropdown
    • Ensure that dropdown is only displayed for Business / Ecommerce yearly plans
  • What will be implemented in follow-up PRs:

    • Dropdown Functionality ( Plans 2023: Add functionality to storage add-on dropdown #79104 )
      • Addon is added to the plans checkout cart automatically
      • Plans prices in the UI update accordingly
      • Storage values in the plans comparison grid update accordingly
    • Add tracking event when user interacts with storage selection dropdown

GIF

Onboarding

2023-07-06 16 29 05

/plans

2023-07-06 19 19 27

Testing Instructions

  • Check out this branch
  • yarn && yarn start
  • Navigate to any onboarding flow ( Ex. calypso.localhost:3000/start ) and complete steps until at plans pricing page
  • Verify that the dropdown renders and different storage options can be selected
  • Verify that the dropdown renders only for business and ecommerce plans for yearly plans
  • Navigate to the /plans page and repeat the same verifications above
  • Verify that the feature flag is working by either:
    • Navigating to /start/plans/?flags=-plans/upgradeable-storage
    • commenting out "plans/upgradeable-storage" in config/development.json and restarting the dev environment

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-ajp-p2)?

@jeyip jeyip self-assigned this Jul 5, 2023
@github-actions
Copy link

github-actions bot commented Jul 5, 2023

@jeyip
Copy link
Contributor Author

jeyip commented Jul 5, 2023

Notes:

Hoping to have a PR or two that satisfies all requirements outlined here for Plans 2023 onboarding pages sometime tomorrow 🤞

Need to work on:

  • Fixing width of dropdown
  • Figuring out how to integrate usage of PRODUCT_1GB_SPACE in the pricing plans grid ( this is a bit of a heavier lift so I'm spelunking through the codebase )

@matticbot
Copy link
Contributor

This PR modifies the release build for editing-toolkit

To test your changes on WordPress.com, run install-plugin.sh editing-toolkit add/plans-2023-upgradeable-storage on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-mMA-p2

@matticbot
Copy link
Contributor

This PR modifies the release build for happy-blocks

To test your changes on WordPress.com, run install-plugin.sh happy-blocks add/plans-2023-upgradeable-storage on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-r7r-p2

@matticbot
Copy link
Contributor

matticbot commented Jul 5, 2023

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

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

name                   parsed_size           gzip_size
entry-stepper               +473 B  (+0.0%)     +131 B  (+0.0%)
entry-main                  +473 B  (+0.0%)     +127 B  (+0.0%)
entry-subscriptions         +126 B  (+0.0%)      +36 B  (+0.0%)
entry-login                 +126 B  (+0.0%)      +36 B  (+0.0%)
entry-domains-landing       +126 B  (+0.0%)      +36 B  (+0.0%)
entry-browsehappy           +126 B  (+0.1%)      +36 B  (+0.1%)

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

Sections (~589 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
update-design-flow                      +835 B  (+0.1%)     +189 B  (+0.1%)
plugins                                 +835 B  (+0.0%)     +190 B  (+0.0%)
plans                                   +835 B  (+0.1%)     +203 B  (+0.1%)
link-in-bio-tld-flow                    +835 B  (+0.1%)     +190 B  (+0.1%)
site-setup-flow                         +295 B  (+0.0%)      +61 B  (+0.0%)
site-purchases                          +295 B  (+0.0%)      +61 B  (+0.0%)
settings-jetpack                        +295 B  (+0.1%)      +61 B  (+0.0%)
scan                                    +295 B  (+0.0%)      +61 B  (+0.0%)
purchases                               +295 B  (+0.0%)      +61 B  (+0.0%)
purchase-product                        +295 B  (+0.2%)      +61 B  (+0.1%)
marketing                               +295 B  (+0.0%)      +61 B  (+0.0%)
jetpack-search                          +295 B  (+0.1%)      +61 B  (+0.1%)
jetpack-connect                         +295 B  (+0.0%)      +61 B  (+0.0%)
jetpack-cloud-settings                  +295 B  (+0.1%)      +61 B  (+0.0%)
jetpack-cloud-pricing                   +295 B  (+0.0%)      +61 B  (+0.0%)
jetpack-cloud-plugin-management         +295 B  (+0.0%)      +61 B  (+0.0%)
jetpack-cloud-partner-portal            +295 B  (+0.0%)      +61 B  (+0.0%)
jetpack-cloud-features-comparison       +295 B  (+0.1%)      +61 B  (+0.0%)
jetpack-cloud-agency-dashboard          +295 B  (+0.0%)      +61 B  (+0.0%)
import-hosted-site-flow                 +295 B  (+0.0%)      +61 B  (+0.0%)
import-flow                             +295 B  (+0.0%)      +61 B  (+0.0%)
free-flow                               +295 B  (+0.0%)      +61 B  (+0.0%)
domains                                 +295 B  (+0.0%)      +61 B  (+0.0%)
checkout                                +295 B  (+0.0%)      +61 B  (+0.0%)
backup                                  +295 B  (+0.0%)      +61 B  (+0.0%)
activity                                +295 B  (+0.0%)      +61 B  (+0.0%)

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 (~10548 bytes added 📈 [gzipped])

name                                                            parsed_size            gzip_size
async-load-calypso-my-sites-plan-features-2023-grid                +54238 B  (+37.6%)   +17518 B  (+37.2%)
async-load-signup-steps-plans-theme-preselected                      +835 B   (+0.4%)     +188 B   (+0.3%)
async-load-signup-steps-plans                                        +835 B   (+0.4%)     +188 B   (+0.3%)
async-load-signup-steps-plans-atomic-store                           +295 B   (+0.2%)      +61 B   (+0.1%)
async-load-calypso-my-sites-stats-jetpack-upsell-section             +295 B   (+0.4%)      +61 B   (+0.4%)
async-load-calypso-my-sites-checkout-modal                           +295 B   (+0.0%)      +61 B   (+0.0%)
async-load-calypso-blocks-editor-checkout-modal                      +295 B   (+0.0%)      +61 B   (+0.0%)
async-load-signup-steps-woocommerce-install-step-business-info       +103 B   (+0.2%)      +23 B   (+0.1%)

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.

@jeyip jeyip added the 2023 Pricing Page ⚡ Changes for pricing page optimisation 2023 label Jul 5, 2023
@jeyip jeyip changed the title Plans 2023: Add storage upgrade dropdown Plans 2023: Add storage add on dropdown Jul 6, 2023
@jeyip jeyip changed the title Plans 2023: Add storage add on dropdown Plans 2023: Implement storage add on dropdown Jul 6, 2023
@jeyip jeyip marked this pull request as ready for review July 6, 2023 23:30
@jeyip jeyip requested a review from a team as a code owner July 6, 2023 23:30
@jeyip jeyip requested a review from aneeshd16 July 6, 2023 23:30
@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 Jul 6, 2023
@jeyip jeyip requested a review from gmovr July 6, 2023 23:30
@jeyip jeyip force-pushed the add/plans-2023-upgradeable-storage branch 2 times, most recently from a38dc55 to 9caaedc Compare July 11, 2023 02:56
@jeyip
Copy link
Contributor Author

jeyip commented Jul 11, 2023

@chriskmnds Addressed the first wave of comments 😄

This PR could use another look.

I'll touch base with designers about the styling deviations with what was in the mocks and with the @wordpress/components dropdown we're going with when the PR is looking more finalized.

Copy link
Contributor

@chriskmnds chriskmnds left a comment

Choose a reason for hiding this comment

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

Code-wise looks great. The dropdown will probably need some restyling, but obviously something to go through designer input. If we keep using the Core component, then maybe the restyled one can go straight into @automattic/components, and let that propagate in the app and gradually deprecate the local/unpackaged Calypso component. Not sure if we are just adding more complexity though by keeping both and not just migrating the existing Calypso one under @automattic/components 🤷‍♂️

I tested in start and plans as outlined. A few points I noticed:

  1. Without feature flag, title/"Storage" missing in respective columns:
Screenshot 2023-07-11 at 2 01 51 PM
  1. With feature flag, "Storage"/title over dropdown should probably be bold like the rest:
Screenshot 2023-07-11 at 2 04 49 PM
  1. I don't see any change in price in the UI when selecting different storage, or additional product added to cart when going to checkout. Is this something to come after backend changes?

@jeyip jeyip force-pushed the add/plans-2023-upgradeable-storage branch from 01ddff4 to aa00ccc Compare August 2, 2023 18:38
@jeyip jeyip merged commit 58a4bdd into trunk Aug 2, 2023
@jeyip jeyip deleted the add/plans-2023-upgradeable-storage branch August 2, 2023 19:14
@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 Aug 2, 2023
@a8ci18n
Copy link

a8ci18n commented Aug 2, 2023

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

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

slug: string;
// Determines if the storage option is an add-on that can be purchased. There are a mixture of patterns
// to identify add-ons for now, and we're temporarily adding one more
isAddOn: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

could this be set to optional and avoid all the isAddOn: false assertions above (that make up most cases)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! I'll make a note of this and take care of it in either an upcoming or separate PR

@a8ci18n
Copy link

a8ci18n commented Aug 13, 2023

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
2023 Pricing Page ⚡ Changes for pricing page optimisation 2023
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants