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

feat: [1/n] Teams Downgrade Flow Experiment #27617

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

surbhi-posthog
Copy link
Contributor

@surbhi-posthog surbhi-posthog commented Jan 16, 2025

Problem

When a user unsubscribes from the teams feature, we want to show them a list of features that they are currently using and will lose access to.

Changes

In this PR, I'm doing the initial experiment setup and showing the user a basic modal before they can unsubscribe. Next I will add logic to check which features are actually used by the org and update the list.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

Cloud: Yes

How did you test this code?

This is an old video, but the flow is the same where the unsubscribe survey opens after the modal

Screen.Recording.2025-01-14.at.2.25.13.PM.mov

Verified modal pops up before they are allowed to unsubscribe.
Verified that the user only sees the new flow if they are in the experiment group

Copy link
Contributor

Size Change: +44 B (0%)

Total Size: 1.13 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.13 MB +44 B (0%)

compressed-size-action

@surbhi-posthog surbhi-posthog marked this pull request as ready for review January 16, 2025 20:50
@surbhi-posthog surbhi-posthog changed the title feat: [1/n] Teams Downgrade Flow Experiment Setupshowing downgrade modal feat: [1/n] Teams Downgrade Flow Experiment Jan 16, 2025
Copy link
Contributor

@joshsny joshsny left a comment

Choose a reason for hiding this comment

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

Looks great, the downgradeLogic is very clean 😄

@@ -36,6 +38,8 @@ export const BillingProductAddonActions = ({ addon, productRef }: BillingProduct
cancelTrial,
} = useActions(billingProductLogic({ product: addon }))
const { featureFlags } = useValues(featureFlagLogic)
const { showDowngradeModal } = useActions(downgradeLogic)
const { isUserInExperiment } = useValues(downgradeLogic)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: make this more specific e.g. isUserInDowngradeFlowExperiment

listeners(({ actions, values }) => ({
handleDowngrade: async () => {
if (values.currentAddon) {
const logic = billingProductLogic({ product: values.currentAddon })
Copy link
Contributor

Choose a reason for hiding this comment

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

Some random kea related questions:

How does this work with pulling in a logic directly, do we need to mount it?

Is this a common kea pattern, or is it more common to use connect? Not sure if using connect is possible here given you need to pass a product?

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.

2 participants