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

Fix view cart cta display issue #92009

Merged
merged 5 commits into from
Jun 26, 2024
Merged

Conversation

CodeyGuyDylan
Copy link
Contributor

@CodeyGuyDylan CodeyGuyDylan commented Jun 20, 2024

Proposed Changes

  • On the Jetpack pricing page, move the billing timeframe below the price to avoid bad display of the cart CTAs
  • Reduce line height on buttons for when they do have to split into two lines (on tablet sized screens) (@ballio2000 suggestion)
  • Update billing term language according to p1HpG7-rW0-p2#comment-71343

Why are these changes being made?

The "View Cart" button was wrapping to two lines on all screen sizes because of the very long billing timeframe copy

image

Testing Instructions

  1. Using the Calypso live link, go to /pricing
  2. Make sure you are logged in and that you have a site in context. To do this you can either manually construct the URL ({base_url}/pricing/{blog_id}) or you can create a jurassic ninja site, connect jetpack, and click "Purchase a plan" from the My Jetpack Footer
  3. Add an item to the cart and make sure the "View Cart" button doesn't wrap to two lines even on the largest screensize
    image
  4. On tablet sizes, make sure the text wrapping looks better with less line-height between the words
    image
  5. Make sure it looks good on mobile as well
    image
  6. Make sure the billing term has been updated correctly on the pricing page
    image
  7. Make sure the term copy looks good in the lightbox as well
    image
  8. If you want, you can check the /features/comparison page as well
    image
    image

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-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented Jun 20, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/view-cart-cta-display-issue on your sandbox.

@CodeyGuyDylan CodeyGuyDylan added the [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR label Jun 20, 2024
@github-actions github-actions bot added the [Status] Design Input Requested Label automatically added to PRs where design feedback is requested label Jun 20, 2024
@matticbot
Copy link
Contributor

matticbot commented Jun 20, 2024

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

Sections (~298 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
scan                                    +272 B  (+0.0%)     +103 B  (+0.0%)
plans                                   +272 B  (+0.0%)     +105 B  (+0.0%)
jetpack-search                          +272 B  (+0.0%)     +103 B  (+0.1%)
jetpack-connect                         +272 B  (+0.0%)     +105 B  (+0.0%)
jetpack-cloud-pricing                   +272 B  (+0.0%)     +105 B  (+0.0%)
jetpack-cloud-overview                  +272 B  (+0.1%)     +101 B  (+0.1%)
jetpack-cloud-manage-pricing            +272 B  (+0.1%)     +103 B  (+0.1%)
jetpack-cloud-features-comparison       +272 B  (+0.0%)     +104 B  (+0.0%)
jetpack-cloud-agency-sites-v2           +272 B  (+0.0%)     +103 B  (+0.0%)
backup                                  +272 B  (+0.0%)     +103 B  (+0.0%)
a8c-for-agencies-sites                  +272 B  (+0.0%)     +103 B  (+0.0%)
settings-jetpack                        +200 B  (+0.0%)      +91 B  (+0.1%)
jetpack-cloud-settings                  +200 B  (+0.0%)      +91 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.

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.

@robertsreberski
Copy link
Contributor

robertsreberski commented Jun 21, 2024

Thanks for working on the change, the desktop looks good now! I was thinking how we can improve the code further in other views, especially since e.g. here there is no reason to break the line:
image

I found out that adding these css rules will make it look nice in all modes:

.simple-item-card__cta {
  white-space: nowrap;
  flex-shrink: 0;
}

CleanShot 2024-06-21 at 12 14 57@2x

Let me know what you think about it.


Second thing, since we don't need to care about length of billing timeframe label now, we can unify wording among them.

Currently it's per month for the first year, then billed yearly and /month, billed yearly. I think we can unify them to remove the slash from the second timeframe label:

  • per month for the first year, then billed yearly
  • per month, billed yearly

Third thing, Code style (Web app) tests seem to be failing 🤔

@CodeyGuyDylan CodeyGuyDylan force-pushed the fix/view-cart-cta-display-issue branch from 1e28f2e to bf12d92 Compare June 21, 2024 15:42
@CodeyGuyDylan
Copy link
Contributor Author

I found out that adding these css rules will make it look nice in all modes:

.simple-item-card__cta {
  white-space: nowrap;
  flex-shrink: 0;
}

Let me know what you think about it.

This is a good improvement, thank you for the suggestion!

Second thing, since we don't need to care about length of billing timeframe label now, we can unify wording among them.

Currently it's per month for the first year, then billed yearly and /month, billed yearly. I think we can unify them to remove the slash from the second timeframe label:

  • per month for the first year, then billed yearly
  • per month, billed yearly

I like this idea, I've updated the text. Honestly we could've done this before the style change since we already had a very long string as one of the options

Third thing, Code style (Web app) tests seem to be failing 🤔

These seems to have been flaky, it is passing now 😄

Copy link
Contributor

@robertsreberski robertsreberski left a comment

Choose a reason for hiding this comment

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

I really like how it looks now 😌

@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 Jun 24, 2024
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.

Very nice, looks great on all screen sizes. Code looks all good.
LGTM! 👍

@CodeyGuyDylan CodeyGuyDylan merged commit 2d6a655 into trunk Jun 26, 2024
11 checks passed
@CodeyGuyDylan CodeyGuyDylan deleted the fix/view-cart-cta-display-issue branch June 26, 2024 14:56
@github-actions github-actions bot removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR [Status] Design Input Requested Label automatically added to PRs where design feedback is requested labels Jun 26, 2024
@a8ci18n
Copy link

a8ci18n commented Jun 26, 2024

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

Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

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

@a8ci18n
Copy link

a8ci18n commented Jun 30, 2024

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.

None yet

5 participants