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

Keep consistent punctuation (or lack thereof) in onboarding modals #97965

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

autumnfjeld
Copy link
Contributor

@autumnfjeld autumnfjeld commented Jan 6, 2025

Keep consistent punctuation (or lack thereof) in onboarding modals: no periods at end of feature snippets

Fixes this:
pdtkmj-3es-p2#comment-6090

Related to #

Proposed Changes

BEFORE (English) AFTER (English)
image image

Check that a non-English locale uses the old translation (has the periods at the end of the sentance):
image

Why are these changes being made?

To have consistent punctuation in plan snippets (the microcopy for plan details)

Testing Instructions

  • Go to /setup/onboarding
  • Go through flow, selecting a paid domain
  • On the plans page click "start with a free plan"
  • See the modal with:
    • updated copy for English
    • old copy for other languages

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 UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
    • NO because code handles waiting for translations
  • 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 Jan 6, 2025

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 update/onboarding-modal-punctuation on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Jan 6, 2025

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

Sections (~29 bytes added 📈 [gzipped])

name                  parsed_size           gzip_size
update-design-flow         +122 B  (+0.0%)      +29 B  (+0.0%)
plugins                    +122 B  (+0.0%)      +29 B  (+0.0%)
plans                      +122 B  (+0.0%)      +29 B  (+0.0%)
link-in-bio-tld-flow       +122 B  (+0.0%)      +29 B  (+0.0%)
jetpack-app                +122 B  (+0.0%)      +29 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 (~29 bytes added 📈 [gzipped])

name                                             parsed_size           gzip_size
async-load-signup-steps-plans-theme-preselected       +122 B  (+0.0%)      +29 B  (+0.0%)
async-load-signup-steps-plans                         +122 B  (+0.0%)      +29 B  (+0.0%)

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.

@autumnfjeld autumnfjeld changed the title Keep consistent punctuation (or lack thereof) in onboarding modals, n… Keep consistent punctuation (or lack thereof) in onboarding modals Jan 6, 2025
@autumnfjeld autumnfjeld requested a review from p-jackson January 6, 2025 03:57
@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 Jan 6, 2025
Copy link
Member

@p-jackson p-jackson left a comment

Choose a reason for hiding this comment

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

Tested, lgtm 👍

@@ -23,6 +24,12 @@ export default function PaidDomainSuggestedPlanSection( props: {
const translate = useTranslate();
const { paidDomainName, onPlanSelected, isBusy } = props;

const previousCopy = translate( 'Free for one year. Includes Premium themes.' );
const updatedCopy = translate( 'Free for one year, includes Premium themes' );
const hasTranslationForUpdatedCopy = useHasEnTranslation()(
Copy link
Member

@p-jackson p-jackson Jan 6, 2025

Choose a reason for hiding this comment

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

This works fine, but I did give it a double take because it's not really idiomatic React. At least not in our code base. We'd usually call the hook near the top of the function (like useTranslate) even in this special case where it's only used once.

I'm not sure why we do it this way. Maybe because React has all these special rules for how hooks get called, and so sometimes doing it this way actually doesn't work, even when there's only one call to the function.

I searched the code the code and found there are actually other components doing it this way too, but we mostly don't.

You should just merge it as is, not worth another CI round trip.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, now with idiomatic React. 😄
Thanks for the input!

@autumnfjeld autumnfjeld merged commit 59e071b into trunk Jan 6, 2025
11 checks passed
@autumnfjeld autumnfjeld deleted the update/onboarding-modal-punctuation branch January 6, 2025 05:20
@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 Jan 6, 2025
@a8ci18n
Copy link

a8ci18n commented Jan 6, 2025

Translation for this Pull Request has now been finished.

@simison
Copy link
Member

simison commented Jan 6, 2025

BTW pretty sure this would get marked as "fuzzy" in translation tools and keep using old translations since it's simple punctuation change, and thus not need the "has translation" check. Thanks for thinking about non-English experience tho!

@p-jackson
Copy link
Member

TIL!

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.

5 participants