Skip to content

refactor(clerk-js): Improve switching between plans flows #5883

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

Conversation

octoper
Copy link
Member

@octoper octoper commented May 8, 2025

Description

Resubscribe button improvements

BEFORE:

  • User is initially on the Free plan
  • They subscribe to any paid annual plan
  • Then they downgrade to Free
  • And finally, they click on resubscribe back the paid plan they were before

Now they are subscribed to the monthly plan not the annual which would be the expected

CleanShot.2025-05-08.at.16.47.17.mp4

AFTER:

New flow

  • User is initially on the Free plan
  • They subscribe to any paid annual plan
  • Then they downgrade to Free

Now if they move back to switch plans they will only see the resubscribe button only on the annual plan and not the monthly one

CleanShot.2025-05-08.at.16.49.46.mp4

Show Active or Upcoming badge based on selected plan period if the plan has subscriptions for both statuses

Steps to reproduce

  • User is initially on the Free plan
  • They subscribe to any paid annual plan
  • Then they switch the the same plan but with the monthly interval

Now the card on the pricing table is confusing when switching between the plan periods, because on is active and one is upcoming but that's not reflected correctly on the badge

Before

CleanShot.2025-05-08.at.16.58.17.mp4

After

CleanShot.2025-05-08.at.17.01.52.mp4

No subscriptions

CleanShot 2025-05-08 at 17 05 49@2x

1 active subscription

CleanShot 2025-05-08 at 17 06 43@2x

1 active subscription & 1 upcoming subscription

CleanShot 2025-05-08 at 17 07 15@2x

1 annual active subscription & 1 upcoming subscription & trying to switch to monthly period of current's active plan

CleanShot 2025-05-08 at 17 08 07@2x

1 active subscription & 1 upcoming subscription on the same plan

Monthly plan period (Upcoming) Annual plan period (Active)
CleanShot 2025-05-08 at 17 10 19@2x CleanShot 2025-05-08 at 17 11 31@2x

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented May 8, 2025

🦋 Changeset detected

Latest commit: d5799c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented May 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 11, 2025 3:45pm

@octoper octoper requested a review from alexcarpenter May 8, 2025 11:59
@octoper octoper changed the title refactor(clerk-js): Simplify plans action localization logic refactor(clerk-js): Improve logic and copies for switching plans flows May 8, 2025
@octoper octoper self-assigned this May 8, 2025
@octoper octoper requested a review from brkalow May 8, 2025 12:45
@alexcarpenter alexcarpenter requested a review from aeliox May 8, 2025 14:42
@octoper octoper marked this pull request as ready for review May 8, 2025 14:55
@octoper octoper changed the title refactor(clerk-js): Improve logic and copies for switching plans flows refactor(clerk-js): Improve switching plans flows May 8, 2025
@octoper octoper changed the title refactor(clerk-js): Improve switching plans flows refactor(clerk-js): Improve switching between plans flows May 8, 2025
@octoper octoper force-pushed the vaggelis/com-763-cant-switch-to-monthly-subscription-for-the-same-plan-if branch from 015cdc9 to 88fee13 Compare May 8, 2025 16:26
Copy link
Member

@alexcarpenter alexcarpenter left a comment

Choose a reason for hiding this comment

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

@octoper and I reviewed the code together and handled the documented flows in the PR description, but would love to get both @aeliox and/or @brkalow eyes on this one.

@alexcarpenter alexcarpenter mentioned this pull request May 8, 2025
9 tasks
Copy link
Contributor

@aeliox aeliox left a comment

Choose a reason for hiding this comment

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

LGTM

@aeliox aeliox merged commit bde228d into main May 12, 2025
32 checks passed
@aeliox aeliox deleted the vaggelis/com-763-cant-switch-to-monthly-subscription-for-the-same-plan-if branch May 12, 2025 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants