From b1b784fede9bc0dd90c11bbec24d855027ac55a7 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sun, 15 Nov 2026 22:51:18 -0800 Subject: [PATCH 1/2] Hosted: checkout from a plan card shows that plan alone; founders opt-in above the plan details From a walkthrough of /enroll on production. A plan picked on a card no longer meets the radio list again: checkout names it alone, and "Back to the plans" changes it. Sold out meanwhile, the list returns. On /billing the founders-row opt-in sat below the plan details like a footnote; it now leads them. Co-Authored-By: Claude Opus 5.5 --- hosted/src/App.test.tsx | 4 +- hosted/src/Checkout.tsx | 106 +++++++++++++--------- hosted/src/HostedPage.tsx | 10 +- hosted/src/stories/Enrollment.stories.tsx | 5 +- 4 files changed, 76 insertions(+), 49 deletions(-) diff --git a/hosted/src/App.test.tsx b/hosted/src/App.test.tsx index 4e82761b7..a39a538f8 100644 --- a/hosted/src/App.test.tsx +++ b/hosted/src/App.test.tsx @@ -300,7 +300,9 @@ describe("an account with no plan", () => { vi.mocked(api.getBilling).mockResolvedValue(NO_PLAN); await mount(ENROLLMENT); await act(async () => buyButton("Hosted monthly")!.click()); - expect(container.querySelector('input[value="monthly"]')!.checked).toBe(true); + // The card chose: checkout names that plan alone, with no others to pick. + expect(container.querySelector('input[name="plan"]')).toBeNull(); + expect(text()).toContain("Hosted monthly$10/month"); await tick("agree-terms"); await tick("agree-renewal"); await click("Continue to payment"); diff --git a/hosted/src/Checkout.tsx b/hosted/src/Checkout.tsx index 51d838276..542c820fc 100644 --- a/hosted/src/Checkout.tsx +++ b/hosted/src/Checkout.tsx @@ -33,6 +33,29 @@ function Terms({ offer }: { offer: Tier }) { ); } +/** A plan's name and price, and the line under it. */ +function OfferLine({ offer, billing }: { offer: Tier; billing: BillingSummary }) { + return ( + + + {offer.name} + + {offer.listPrice && ${offer.listPrice}} + {perInterval(offer.price, planInterval(offer.id))} + + + {offer.id === "founding" && billing.founding && ( + + Locked while you stay subscribed. {billing.founding.seatsLeft} left at this price. + + )} + {offer.id === "yearly" && ( + Two months free against monthly. + )} + + ); +} + /** * The plans on sale, what each commits the buyer to, and the purchase action * behind affirmative agreement to the current terms and to automatic renewal. @@ -40,12 +63,15 @@ function Terms({ offer }: { offer: Tier }) { export function Checkout({ billing, plan, + picked = false, busy, onPurchase, }: { billing: BillingSummary; /** The plan the link named, chosen first when on sale. */ plan: Plan | null; + /** Chosen already, on a plan card: shown alone while on sale, the others a step back. */ + picked?: boolean; busy: string; /** With the price shown beside the renewal the buyer agreed to. */ onPurchase: (plan: Plan, price: number) => void; @@ -57,56 +83,48 @@ export function Checkout({ const [terms, setTerms] = useState(false); const [renewal, setRenewal] = useState(false); const offer = offers.find((each) => each.id === chosen)!; + // Sold out since its card was clicked, the plan offers the rest to choose from. + const alone = picked && offer.id === plan; function submit(event: FormEvent) { event.preventDefault(); if (terms && renewal && !busy) onPurchase(chosen, offer.price); } return (
-
- Choose a plan - {billing.foundingLapsed && ( -

Your founding price ended with your earlier subscription, so subscribing again is at the list price.

- )} - {offers.map((each) => ( - - ))} -
+ {alone ? ( +
+ +
+ ) : ( +
+ Choose a plan + {billing.foundingLapsed && ( +

Your founding price ended with your earlier subscription, so subscribing again is at the list price.

+ )} + {offers.map((each) => ( + + ))} +
+ )}