Skip to content

Read plan identity from billing and offer plan sizes in Research - #1564

Merged
AnthonyRonning merged 1 commit into
masterfrom
codex-maxplus-maple
Nov 14, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
codex-maxplus-maple

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Research decided what plan an account is on by parsing the plan's name in about twenty places, and the pricing page could only show the four plans it has hand-written cards for. This reads the plan from fields billing now sends, and lets the pricing page offer a plan it has no card for.

What changes

One place that knows what a plan is. billing/plan.ts answers whether a plan is free, an individual paid plan or a team, its rank, and the name to show. It reads billing's plan_group, plan_rank and display name when they are present and falls back to the name otherwise, exactly as before. That fallback covers an older billing server and a product billing does not recognize. Paid gating (hasApiAccess), Team detection, plan labels and the Bitcoin upgrade button all use it.

Plan sizes on the pricing page. Each card is matched to its product by plan key (by name as before when there is no key). When billing lists an individual plan that has no card of its own, the highest-ranked paid card below it offers it as a larger size:

  • a price switch appears in that card, one button per size;
  • the title, description, monthly credits, price and button follow the selected size;
  • a subscriber on a larger size sees it selected and marked as current, because the current plan is matched by product ID first.

The page still has four cards and the same grid. With today's product list nothing renders differently.

Bitcoin upgrades. The upgrade button was offered only from the first paid plan to the second. It is now offered to any higher individual plan, and names the plan it upgrades to.

Not changed

  • The iOS and Android plan pages.
  • Upgrade prompt copy in chat, which still names the second paid plan as the top one.
  • The card copy and styling. The size switch is deliberately plain.

Validation

  • Pre-commit hook for the Research frontend: format check, lint, typecheck and bun run test (1,130 pass, 0 fail). New tests cover the plan helpers, card and size placement, and the upgrade targets.
  • Ran the web app against a local billing service that lists a larger plan above Max. The switch appears in the Max card; selecting the larger size changes the title, description, credits line and price, in light and dark and at phone width. Checked signed out only.

Not exercised: a signed-in subscriber on a larger size, checkout or the portal for it, a Bitcoin upgrade, and the Tauri desktop and mobile builds.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Maple development preview: https://e609c177.maple-ca8.pages.dev

Commit: 9b5e837a29a9a6738f757ca382ad50c52ebccd32

Uses development API, billing, flags and PCR configuration. Cloudflare Access applies.

Billing can describe each plan with a key, a group (free, individual or
team), a rank and a display name. Read those instead of parsing the plan
name, and fall back to the name for an older billing server or a product
it does not recognize. Paid gating, Team detection, the plan label and the
Bitcoin upgrade button all go through one module, `billing/plan.ts`.

On the pricing page, match each card to its product by key. When billing
lists an individual plan that has no card of its own, the highest-ranked
paid card below it offers it as a larger size, with a price switch in the
card; the title, description, credits, price and button follow the size.
The current plan is matched by product, so a subscriber on a larger size
sees it selected. Nothing changes while billing lists the same plans.

Bitcoin subscribers are offered an upgrade to any higher individual plan,
not only from the first paid plan to the second.

Co-Authored-By: Claude <noreply@anthropic.com>
@AnthonyRonning
AnthonyRonning merged commit c2e752b into master Nov 14, 2026
22 checks passed
@AnthonyRonning
AnthonyRonning deleted the codex-maxplus-maple branch November 14, 2026 08:19

This branch was successfully deployed

1 active deployment
pages-pr-1564 — 9b5e837a Deployed Nov 14, 2026 by github-actions[bot]
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.

1 participant