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

Replace the launchpad-first flag with the goals-first cumulative experiment #99914

Merged
merged 4 commits into from
Feb 19, 2025

Conversation

p-jackson
Copy link
Member

@p-jackson p-jackson commented Feb 18, 2025

Fixes #99879

Proposed Changes

I thought I would simply take the hook approach we've usually taken for experiments: replacing the shouldShowLaunchpadFirst() function with a useShouldShowLaunchpadFirst(). And it'd even be able to share logic with the useGoalsFirstCumulativeExperience() hook 👍.

The difference with this experiment though is that we need access to experiment assignment in the My Home control, and we can't use hooks there. So instead, this PR uses a promise-based approach to loading the experiment assignment, and wraps it in a hook when it needs to be used in React components.

  • Convert shouldShowLaunchpadFirst() into an async function
  • Replace the feature flag check with an experiment assignment
  • Add logic to ensure we only give users the launchpad first experience when their site was created after the goals-first experiment started
    • Otherwise we'll be treating them as if they were in the cumulative experience when they never created their site with the goals-first experiment at all
  • Create useGoalsFirstCumulativeExperience() hook for wrapping the shouldShowLaunchpadFirst()

With Experiment

CleanShot.2025-02-18.at.21.58.22.mp4

Control
(excuse the debugger 🙂)

CleanShot.2025-02-18.at.22.23.51.mp4

Why are these changes being made?

  • Switching from a feature flag to an experiment allows us to actually launch to customers.

Testing Instructions

  • Assign yourself to an experiment cohort here: 22180-explat-experiment
  • Test on a site you created a while ago (you should not get the focused launchpad)
  • Test on a fresh site (you should get the focused launchpad if you were in the cumulative variant)
  • Test with Big Sky, you should not see the launchpad

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.
  • 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 Feb 18, 2025

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

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

  • blaze-dashboard
  • odyssey-stats

To test WordPress.com changes, run install-plugin.sh $pluginSlug feature-flag-to-experiment on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Feb 18, 2025

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

Sections (~450 bytes added 📈 [gzipped])

name                  parsed_size           gzip_size
home                       +473 B  (+0.0%)     +247 B  (+0.0%)
write-flow                 +446 B  (+0.0%)     +203 B  (+0.0%)
link-in-bio-tld-flow       +446 B  (+0.0%)     +203 B  (+0.0%)
build-flow                 +446 B  (+0.0%)     +203 B  (+0.1%)

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.

@p-jackson p-jackson marked this pull request as ready for review February 18, 2025 08:50
@p-jackson p-jackson changed the title Replace the launchpad-first flag with the goals-first cumulative expe… Replace the launchpad-first flag with the goals-first cumulative experiment Feb 18, 2025
@p-jackson p-jackson requested a review from a team February 18, 2025 09:25
@p-jackson p-jackson self-assigned this Feb 18, 2025
@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 Feb 18, 2025
Copy link
Contributor

@candy02058912 candy02058912 left a comment

Choose a reason for hiding this comment

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

✅ Test on a site you created a while ago (you should not get the focused launchpad)
✅ Test on a fresh site (you should get the focused launchpad if you were in the cumulative variant)
✅ Test with Big Sky, you should not see the launchpad

Might circle back to check the code more in detail tomorrow, but tested all the scenarios and it's working 👍

Copy link
Contributor

@paulopmt1 paulopmt1 left a comment

Choose a reason for hiding this comment

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

It's working as expected, thanks @p-jackson!

Let's release it tomorrow morning :)

Comment on lines +20 to +23
const [ isFullLaunchpadDismissed, setIsFullLaunchpadDismissed ] = useState(
site.options?.launchpad_screen === undefined ||
site.options.launchpad_screen === 'skipped' ||
isSiteLaunched
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice improvement!

@paulopmt1 paulopmt1 force-pushed the feature-flag-to-experiment branch from cb559f3 to f93055d Compare February 19, 2025 12:03
@paulopmt1 paulopmt1 merged commit ee3c4b1 into trunk Feb 19, 2025
13 checks passed
@paulopmt1 paulopmt1 deleted the feature-flag-to-experiment branch February 19, 2025 13:46
@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 Feb 19, 2025
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.

Task: Prepare to launch Focused Launchpad
4 participants