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

Hide free plan for domain upsell flow #74897

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

agrullon95
Copy link
Contributor

@agrullon95 agrullon95 commented Mar 24, 2023

Related to #74416

Testing / Review Estimation

Test: short
Review: short

Proposed Changes

  • Hides free plan on the plan selection screen for domain upsell flow

Testing Instructions

  • Checkout branch
  • Create or use an existing launchpad-enabled site (Write/build/free flow)
  • Click the "Choose a domain" task
  • Select a random domain and verify the plan selection screen does not display a free plan.
  • Go back to the domain selection screen. Click "Use a domain I own" and go through the steps until you reach the plans screen again. Verify the plan selection screen does not display a free plan.

CleanShot 2023-03-24 at 11 18 38@2x

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

@agrullon95 agrullon95 self-assigned this Mar 24, 2023
@agrullon95 agrullon95 requested a review from a team March 24, 2023 15:19
@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 24, 2023
@matticbot
Copy link
Contributor

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

Sections (~7 bytes added 📈 [gzipped])

name                     parsed_size           gzip_size
update-design-flow            +110 B  (+0.0%)      +21 B  (+0.0%)
tailored-ecommerce-flow        -22 B  (-0.0%)      -14 B  (-0.0%)
newsletter-flow                -22 B  (-0.0%)      -14 B  (-0.0%)
link-in-bio-tld-flow           -22 B  (-0.0%)      -14 B  (-0.0%)
link-in-bio-flow               -22 B  (-0.0%)      -14 B  (-0.0%)
copy-site-flow                 -22 B  (-0.0%)      -14 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.

}

setHideFreePlan( hideFreePlan );
setHideFreePlan( Boolean( suggestion.product_slug ) || shouldHideFreePlan );
Copy link
Contributor

@edanzer edanzer Mar 24, 2023

Choose a reason for hiding this comment

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

Just want to clarify what's happening here. Looks like we're taking out special logic for the DOMAIN_UPSELL_FLOW. I think we can do that here - without affecting other flows - because we're invoking setHideFreePlan( true ); on line 51 in domain-upsell.ts.

So basically, we just update that value in state when working within the domain-upsell flow, and the rest of the logic just works down stream.

Assuming that's right, I wonder whether there would be any unanticipated effects of updating that state value? For example, once we invoke setHideFreePlan( true ); that means as long as that state value persist, we'd never show the free plans. Is it possible that a user would end up back on the domains page via some other route/flow where they SHOULD see the free plan, but not see it because we've updated that state value?

Worth noting I can't think of one, but I just want to be sure we don't introduce unexpected changes to the domains page when not intended.

Copy link
Contributor Author

@agrullon95 agrullon95 Mar 27, 2023

Choose a reason for hiding this comment

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

We're moving the "hide free plan" logic into the domain-upsell flow itself, instead of having that logic inside the domains step. It's essentially the same thing, but this change allows us to ensure that the Free plan is always hidden for the domain-upsell flow without modifying other code in the plans or domain step (until we decide we want to show the free plan for specific scenarios within the domain-upsell flow).

Assuming that's right, I wonder whether there would be any unanticipated effects of updating that state value? For example, once we invoke setHideFreePlan( true ); that means as long as that state value persist, we'd never show the free plans. Is it possible that a user would end up back on the domains page via some other route/flow where they SHOULD see the free plan, but not see it because we've updated that state value?

This is definitely possible if the same redux state value is retrieved/read in another plans-related component, but that will happen regardless of these changes. The only reference for getHideFreePlan (to retrieve the "hide free plan" value from redux) in stepper plans/plans-wrapper.tsx. This plans component is only used in Link-in-bio, newsletter, and the domain-upsell flow. The link-in-bio and newsletter will not be affected by these changes since they use the "old" plans component design (vs the new plans grid design we see on the /plans screen when going the domain-upsell flow)

@sharpirate
Copy link
Contributor

This tests well, I'll hold off on approval due to Erick's comment

@agrullon95 agrullon95 merged commit dfcf3d0 into trunk Mar 28, 2023
@agrullon95 agrullon95 deleted the update/stepper-domain-upsell-flow-hide-free-plan branch March 28, 2023 13:30
@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 28, 2023
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.

4 participants