Skip to content

feat: billing plan and startup program badges on billing page#30242

Merged
pawel-cebula merged 57 commits intomasterfrom
billing-plan-badges
Mar 25, 2025
Merged

feat: billing plan and startup program badges on billing page#30242
pawel-cebula merged 57 commits intomasterfrom
billing-plan-badges

Conversation

@pawel-cebula
Copy link
Contributor

@pawel-cebula pawel-cebula commented Mar 20, 2025

Problem

  • Customers couldn't see on the billing page what billing plan are they on and/or if they're part of the startup program
  • Only those on the free plan would see a CTA to upgrade

Changes

  • Adapts the BillingCTAHero into BillingHero, where content changes depending on the billingPlan and startupProgramLabel
  • If startupProgramLabel is present, it takes priority over the billingPlan
  • In each variation we render a different badge, copy, CTAs, background

These UI changes dependent on a billing PR (https://github.com/PostHog/billing/pull/1162), which needs to be merged first.

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

Cloud only

How did you test this code?

Desktop layout
image

Mobile layout
image

⚠️ Note that all screenshots below are from before removing paragraph about all plans coming with all products/features except for the free plan.

Free plan
SCR-20250320-lzny
Paid plan
SCR-20250320-mcgl
Teams plan
SCR-20250320-malr
Enterprise plan
SCR-20250320-mawq
Startup plan
SCR-20250320-lzgc
YC plan
SCR-20250320-lzks

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR introduces significant changes to the billing page UI, focusing on plan visibility and startup program status. Here's a summary of the key changes:

  • Replaces BillingCTAHero with a new BillingHero component that adapts content based on billing plan and startup program status
  • Introduces new BillingSummary component to display detailed billing information like current totals and projections
  • Adds new billing plan badges (Free, Paid, Teams, Enterprise) and startup program badges (YC, Startup)
  • Implements responsive layouts for both desktop and mobile views
  • Moves styling from SCSS to Tailwind classes for better maintainability

Key points to note:

  • Cloud-only changes with comprehensive testing across different billing plans
  • New billingPlan and startupProgramLabel selectors in billingLogic
  • Improved UX with plan-specific messaging and CTAs
  • Proper handling of Stripe portal integration through new StripePortalButton component

The changes appear well-structured and thoroughly tested across different scenarios and screen sizes.

💡 (5/5) You can turn off certain types of comments like style here!

8 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 21, 2025

Size Change: +4.27 kB (+0.04%)

Total Size: 9.76 MB

Filename Size Change
frontend/dist/toolbar.js 9.76 MB +4.27 kB (+0.04%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@pawel-cebula
Copy link
Contributor Author

@zlwaterfield I think I've implemented all the feedback. I've also improved the layout of the credits CTA component a bit. Had to fix some unrelated type errors too that suddenly popped up, and fix an E2E test. Should be good for another review.

Copy link
Contributor

@zlwaterfield zlwaterfield left a comment

Choose a reason for hiding this comment

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

Added two comments but looks good other than that (neither are blockers but nice to haves IMO)

},
[BillingPlan.Teams]: {
title: 'Good call!',
subtitle: "You're on the Teams plan.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we update this to say You're on the Ridiculously Cheap™ plan (with Teams) or something like that until we have the badge, it's a big confusing.

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks to be squshing the summary, are we able avoid that with a min width?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually wanted to leave more space for the credits banner/CTA so I wanted to limit the width of the summary based on current bill total and wrap rest, if needed. Otherwise the credits banner could be quite narrow and could end up taking a lot of height, with lots of empty space on the left (below summary).

I could modify it so that e.g. a date doesn't wrap but that could look a bit odd with spacing and end up taking 3 lines 🤔 Will try to see what it looks like and decide.

@pawel-cebula pawel-cebula merged commit 976378c into master Mar 25, 2025
112 checks passed
@pawel-cebula pawel-cebula deleted the billing-plan-badges branch March 25, 2025 08:30
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