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

Reader Onboarding: Do not render if user registered before Oct 1 2024 #95624

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

DustyReagan
Copy link
Member

@DustyReagan DustyReagan commented Oct 23, 2024

Related to https://github.com/Automattic/loop/issues/197

Proposed Changes

  • This PR add a check for user registration. It will not render onboarding if the user registered before Oct 1, 2024.
  • It moves the check for the feature flag inside the ReaderOnboarding component
  • It adds a prop to ReaderOnboarding called onRender that alerts the parent component if the ReaderOnboarding component will render.
  • Using the new onRender prop state, we can conditionally show the FollowingIntro component on /read

Why are these changes being made?

  • The date check is part of the project criteria
  • Adding the onRender state property allows us to keep the "gatekeeping" logic inside the ReaderOnboarding component so the parent component doesn't need to know the rules for displaying the component. That will allow us to easily reuse the ReaderOnboarding component in other places without duplicating the display rules everywhere it is used.

Testing Instructions

  • Using Calypso Live and an account created before Oct 1 2024
  • Go to /read - The onboarding banner should NOT show up because the feature flag is missing
  • Go to /read?flags=reader/onboarding - The onboarding banner should NOT show up because your user account is older than Oct 1 2024
  • Create a new account or use an account created after Oct 1 2024
  • Using Calypso Live
  • Go to /read - The onboarding banner should NOT appear because the feature flag is missing AND you should see the "Welcome!" banner
  • Go to /read?flags=reader/onboarding - The onboarding banner SHOULD appear because the feature flag is there and your account is newer than Oct 1 2024. The "Welcome!" banner should NOT appear because the onboarding banner takes precedence.
  • Still on /read?flags=reader/onboarding complete both onboarding tasks. The Reader Onboarding banner should disappear, and the "Welcome!" banner should take its place.

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

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 add/reader-onboarding-gatekeeping on your sandbox.

@DustyReagan DustyReagan self-assigned this Oct 23, 2024
@matticbot
Copy link
Contributor

matticbot commented Oct 23, 2024

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

Sections (~73 bytes added 📈 [gzipped])

name    parsed_size           gzip_size
reader        +94 B  (+0.0%)      +73 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.

@DustyReagan DustyReagan changed the title Do not render if user registered before Oct 1 2024 Reader Onboarding: Do not render if user registered before Oct 1 2024 Oct 23, 2024
@DustyReagan DustyReagan marked this pull request as ready for review October 23, 2024 19:02
@DustyReagan DustyReagan requested a review from a team as a code owner October 23, 2024 19:02
@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 Oct 23, 2024
Copy link
Contributor

@eoigal eoigal left a comment

Choose a reason for hiding this comment

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

Works as advertised !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants