- Improved error messaging around card errors and toast position to be
closer to the actual action (customers often miss it in the top right)
- For card errors when setting up payment methods with a direct error
via the Stripe API, map to an appropriate actionable error message
Right now, when customers upgrade from free → paid or even pro → team,
we simply redirect to the org billing page with a quick banner that
vanishes after 3 seconds confirming the plan was changed. it’s quite
unsatisfying and feels like a missed opportunity to display what the
customer now unlocked and next steps. I want to especially highlight
projects that are now upgradeable from nano → micro, but we can later
expand and make the “next steps” smarter and do it context-based.
Studio sends no events between the plan CTA click and the backend's
subscription update, so we can't see where people stop in the plan
change flow. The redesigned plan change screen from #53670 is also gated
by a ConfigCat flag, and ConfigCat flag values are not attached to
events, so its rollout can't be compared against the legacy dialog. I
added the missing events and a property for the flag state.
**Changed:**
- **Which screen a user gets**: I added `planUpdateRedesignEnabled` and
`origin` (the `source` query param the panel was opened with) to
`studio_pricing_plan_cta_clicked`.
- **Confirm and completion**: the redesigned screen now sends
`studio_pricing_plan_change_confirm_clicked` on the confirm button and
`studio_pricing_plan_change_completed` once the change succeeds. A
payment confirmation that the API answers with 202 (payment taken, plan
still syncing) counts as completed too.
- **Compute explainer and docs links**: expanding "Billed every hour,
even when idle" sends `studio_pricing_compute_billing_explainer_opened`,
and the compute and project transfer docs links send
`studio_pricing_plan_change_docs_link_clicked`.
- **Stale origin**: closing the pricing panel now removes `source` from
the URL. Before, reopening the panel from the billing page reported the
previous entry point as the origin.
**Note:** the legacy dialog gets no new events, and
`planUpdateRedesignEnabled` should be removed together with it.
## To test
Needs the `billingPlanUpdateRedesign` flag on. Watch the
`telemetry/event` requests in the network tab.
Tested on the PR preview:
- [x] Open `/org/<slug>/billing?panel=subscriptionPlan&source=backups`
on a Free org and click "Upgrade to Pro", expect
`studio_pricing_plan_cta_clicked` with `planUpdateRedesignEnabled: true`
and `origin: "backups"`. Observed, and the redesigned screen opened.
- [x] On the same panel, click the Enterprise card's "Contact us",
expect exactly one `studio_pricing_plan_cta_clicked` with `selectedPlan:
"Enterprise"`, `planUpdateRedesignEnabled: true` and `origin:
"backups"`. Observed, one event.
- [x] Expand "Billed every hour, even when idle", expect one
`studio_pricing_compute_billing_explainer_opened`. Collapse it, expect
no event. Observed, and a second expand sent a second event.
- [x] Click "Learn about compute", expect
`studio_pricing_plan_change_docs_link_clicked` with `docsLink:
"compute"`. Observed, and the "Transfer" link sent `docsLink:
"project_transfer"`.
- [x] Go back and close the pricing panel, expect `source` to be gone
from the URL. Observed: the URL ended at `/billing` with no `panel` or
`source`.
- [x] With the flag overridden off and the page reloaded, click "Upgrade
to Pro", expect `planUpdateRedesignEnabled: false` and the legacy
dialog. Observed.
- [x] Confirm with a declining card, expect
`studio_pricing_plan_change_confirm_clicked` and no
`studio_pricing_plan_change_completed`. Observed: the subscription
update returned 402 and no completion was sent.
- [x] Confirm the upgrade with a test card, expect
`studio_pricing_plan_change_confirm_clicked` then one
`studio_pricing_plan_change_completed` with `currentPlan: "Free"`,
`selectedPlan: "Pro"`, `origin: "backups"` and no project group.
Observed, with `groups` holding only `organization`.
- [x] Upgrade again with a card that requires 3D Secure, expect one
`studio_pricing_plan_change_completed`, sent only after the challenge.
Observed on a Pro to Team change.
I also confirmed ingestion by querying the staging PostHog project: all
five events from this run arrived from the preview host with the
properties above. The run included the CTA click with both `true` and
`false` for `planUpdateRedesignEnabled`, `docsLink` values `compute` and
`project_transfer`, completions for Free to Pro and Pro to Team, and
only an organization group on every event.
## Linear
- fixes GROWTH-1565
## Problem
- plan cards on the studio upgrade screen do not match recent plan cards
updates to the pricing page
- add-on illustrations on the pricing page sometimes show the light
image in dark mode
- spend cap bars on the pricing page flash when a user toggles the spend
cap
## Solution
- changes the upgrade screen plan cards to the pricing page design +
shows enterprise as a fourth column
- moves the lifted card style to the current plan of the organization +
gives it a neutral "current plan" badge
- moves the compare plans and pricing faq links below the plan cards +
removes the stagger animation on the cards
- changes the pricing page illustrations to pick the light or dark image
with css because the server render does not know the theme
- changes the spend cap animation to resize the bars instead of
remounting them
While we want to round up the price for compute, so it does not display
$9.87 or the likes, we do not want any type of rounding for taxes or
amount due.
A fully revamped plan change screen covering Free -> Paid Plan or Paid
Plan <> Paid Plan changes. Out of scope is the downgrade to Free Plan,
which is a separate modal and process. Besides a visual refresher of the
current modal, we are addressing common misconceptions about our pricing and being as transparent as possible.
The new modal is available behind the feature flag
`billingPlanUpdateRedesign`, which is enabled on local/staging and will
be rolled out gradually after further testing in production.