Skip to content

FE-3045 docs(adr): billing-web hosts checkout only; hosts own plan selection - #19096

Merged
christian-byrne merged 1 commit into
mainfrom
jaewon/adr-billing-web-checkout-only
Sep 28, 2026
Merged

christian-byrne merged 1 commit into
mainfrom
jaewon/adr-billing-web-checkout-only

Conversation

@dante01yoon

Copy link
Copy Markdown
Collaborator

Why

Records the 2026-09-27 owner decision: billing-web hosts only the embedded-checkout experience (payment, 3DS, result) using the same shared packages/account-ui checkout as the cloud app. Each host app owns plan selection (pricing table, Monthly/Yearly, plan changes, team credit stop) and opens /v1/checkout with plan (plus workspace, team_credit_stop_id).

Root cause

The Milestone 2 live run on 2026-09-27 found that the billing-web plan grid and plan-change quote (#17798, #17937) had been built without a design source and had drifted from the in-app UX: yearly credits were labelled "monthly credits", and the quote showed credits as dollars. A second plan-selection UI for the same journey drifts by default.

How

  • New docs/adr/BILLING-WEB-0038-checkout-only-hosts-own-plan-selection.md (Accepted): /v1/checkout requires plan; /v1/pricing and a plan-less /v1/checkout redirect to the host via return_to; SubscriptionPanel plan cards, PlanCard and SubscriptionQuote are removed; /v1/subscription keeps cancel/resubscribe; /v1/payment-methods, /v1/invoices, /v1/result and /sign-in stay. Rejected alternatives: polishing the billing-web grid, or a separate billing-web design spec.
  • BILLING-WEB-0031: amendment note replacing the stale "flag redirects Plans & pricing" line.
  • PACKAGES-ACCOUNT-UI-0034: rule 4 amendment note allowing design-system token classes so both hosts render identically.
  • Cross-links AUTH-BILLING-0032. ADR index updated; pnpm adr:check passes.

AS IS / TO BE

Docs only.

@dante01yoon dante01yoon added needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch core/1.55 Backport PRs for core 1.55 labels Sep 27, 2026
@dante01yoon
dante01yoon requested a review from a team September 27, 2026 13:29
@dante01yoon dante01yoon added cloud/1.55 Backport PRs for cloud 1.55 needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch core/1.55 Backport PRs for core 1.55 labels Sep 27, 2026
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

This candidate changes nothing the matrix measures, so every expensive stage was skipped.

Reproduce locally
# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
  npx vitest run --config vitest.matrix.config.mts

Full docs: scripts/registry-census/README.md

🌾 Fallow: ✅ Passed

Fallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened.

No new findings in the changed files.

Reproduce locally
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
  --changed-since ec7764faa20087cab1e5f5f28adef2c079e09daf

Full docs: ADR-DEVEX-LINT-0015

@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 27, 2026
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b9a3d911-9101-434d-adef-4a3034b04d82

📥 Commits

Reviewing files that changed from the base of the PR and between ec7764f and ba90d0f.

📒 Files selected for processing (4)
  • docs/adr/BILLING-WEB-0031-static-spa-boundary.md
  • docs/adr/BILLING-WEB-0038-checkout-only-hosts-own-plan-selection.md
  • docs/adr/PACKAGES-ACCOUNT-UI-0034-payment-ui-belongs-to-the-shared-account-ui-package.md
  • docs/adr/README.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The changes add an accepted ADR assigning plan selection to host apps and checkout to billing-web. They also amend related ADRs and add the new decision to the ADR index.

Changes

Checkout policy

Layer / File(s) Summary
Plan selection and checkout routing
docs/adr/BILLING-WEB-0038-checkout-only-hosts-own-plan-selection.md
The ADR assigns plan selection to host apps and defines checkout and pricing redirects, retained subscription routes, rejected alternatives, and stated consequences.
Related ADR amendments and index
docs/adr/BILLING-WEB-0031-static-spa-boundary.md, docs/adr/PACKAGES-ACCOUNT-UI-0034-payment-ui-belongs-to-the-shared-account-ui-package.md, docs/adr/README.md, docs/adr/BILLING-WEB-0038-checkout-only-hosts-own-plan-selection.md
The related ADRs record routing and shared UI amendments. The ADR index lists the accepted decision.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Suggested reviewers: christian-byrne

Merge Risk: ⚪ Minimal · up to ba90d

The routing implementation remains unchanged, while the accepted ADR documents the intended policy rather than claiming rollout is complete. No new runtime risk requiring a merge hold was identified.

Architecture Summary

Architecture risk: 🔵 Low · up to ba90d

The change affects 1 system.

Changed systems: docs

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — docs (service) was modified; 4 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in docs/adr/BILLING-WEB-0031-static-spa-boundary.md: Added an amendment stating that the flag no longer redirects Plans & pricing: the host app retains plan selection and opens billing-web’s /v1/checkout with a plan, while billing-web hosts checkout rather than a plan grid.
  • observed — Modified behavior in docs/adr/BILLING-WEB-0038-checkout-only-hosts-own-plan-selection.md: Adds the accepted ADR’s date and context, documenting the plan-selection UI drift between billing-web and the cloud app, and contrasting that with shared embedded-checkout presentation.
  • observed — Modified behavior in docs/adr/BILLING-WEB-0038-checkout-only-hosts-own-plan-selection.md: Declares that host apps own plan selection and open /v1/checkout with a required plan and applicable workspace and team credit-stop values. Plan-less checkout and /v1/pricing redirect through return_to rather than showing a picker; the billing-web plan grid and quote are removed. /v1/subscription retains cancel and resubscribe, and the other listed routes remain unchanged.
  • observed — Modified behavior in docs/adr/BILLING-WEB-0038-checkout-only-hosts-own-plan-selection.md: Records rejection of polishing the billing-web plan grid or commissioning a separate design spec.
🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
End-To-End Regression Coverage For Fixes ✅ Passed The PR title and commit subject use documentation language, not bug-fix language. The changed files are documentation files only. The check does not require end-to-end tests for documentation-only cha…
Website End-To-End Regression Coverage ✅ Passed The pull request changes only documentation files under docs/adr/. It does not change runtime files under apps/website/src/ or apps/website/public/. This check is not applicable.
Adr Compliance For Entity/Litegraph Changes ✅ Passed PASS. The changed-file list contains only documentation files under docs/adr/. It contains no files under src/lib/litegraph/, src/ecs/, or graph-entity-related implementation paths. The entity/litegra…
Title check ✅ Passed The title clearly identifies the documentation change and its main architectural decision: billing-web hosts checkout only, while host apps own plan selection.
Description check ✅ Passed The description is detailed and explains the decision, motivation, implementation scope, alternatives, related ADRs, validation, and documentation-only impact. It does not use the repository template …
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@dante01yoon dante01yoon changed the title docs(adr): billing-web hosts checkout only; hosts own plan selection FE-3045 docs(adr): billing-web hosts checkout only; hosts own plan selection Sep 27, 2026

@christian-byrne christian-byrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The checkout-only boundary is ready to land.

  • Host apps own subscription plan selection; billing-web owns payment, challenge, and result through the shared account UI.
  • The older static-SPA and account-UI ADRs carry explicit amendment notes, so readers do not inherit contradictory rules.
  • The remaining subscription, payment-method, invoice, result, and sign-in routes are named rather than implicitly preserved.
Full context for agent readers

This is consistent with the existing package split: payment presentation remains shared, while host-specific plan selection does not grow a second design surface in billing-web. It also does not change the SDK-owned top-up contract, which governs top-up routing, recovery, polling, and observability rather than subscription plan choice. There are no unresolved review threads and CI is settled for this docs-only head.

@christian-byrne
christian-byrne added this pull request to the merge queue Sep 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 28, 2026
@dante01yoon
dante01yoon added this pull request to the merge queue Sep 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 28, 2026
@dante01yoon
dante01yoon added this pull request to the merge queue Sep 28, 2026
@dante01yoon
dante01yoon removed this pull request from the merge queue due to a manual request Sep 28, 2026
@christian-byrne
christian-byrne added this pull request to the merge queue Sep 28, 2026
Merged via the queue into main with commit 21a7889 Sep 28, 2026
126 of 127 checks passed
@christian-byrne
christian-byrne deleted the jaewon/adr-billing-web-checkout-only branch September 28, 2026 05:26
@comfy-pr-bot

Copy link
Copy Markdown
Member

@dante01yoon Successfully backported to #19199

@comfy-pr-bot

Copy link
Copy Markdown
Member

@dante01yoon Successfully backported to #19201

@comfy-pr-bot comfy-pr-bot removed the needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch label Sep 28, 2026
comfy-pr-bot added a commit that referenced this pull request Sep 28, 2026
…ly; hosts own plan selection (#19199)

Backport of #19096 to `core/1.55`

Automatically created by backport workflow.

Co-authored-by: Dante <bunggl@naver.com>
comfy-pr-bot added a commit that referenced this pull request Sep 28, 2026
…nly; hosts own plan selection (#19201)

Backport of #19096 to `cloud/1.55`

Automatically created by backport workflow.

Co-authored-by: Dante <bunggl@naver.com>
VoXoXoX pushed a commit to VoXoXoX/ComfyUI_frontend that referenced this pull request Sep 28, 2026
…esign-system (Comfy-Org#19098)

- Linear: FE-3046

**Merge order:** Comfy-Org#19096 (ADR 0034 amendment) merges first. Until it
does, ADR 0034 rule 4 still forbids account-ui from using the design
system, which B does.

## Why

`buttonVariants` lived in `src/components/ui/button/button.variants.ts`,
inside the private root package, so a workspace package could not render
a button with the app's exact classes. PR B (`@comfyorg/account-ui`
checkout surfaces) needs those classes to render the embedded checkout
identically in the cloud app and in billing-web. No visual change.

## How

- `git mv` of `button.variants.ts` into `packages/design-system/src/`,
content unchanged.
- `packages/design-system/package.json`: new export `./button.variants`,
a `files` entry, and `cva` (`catalog:`) as a dependency.
- Every importer in `src/` (Button.vue, Button.stories.ts,
CloudSocialAuthButtons.vue, InlinePromptEditor.vue, and the ten
components that import the `ButtonVariants` type) now reads from
`@comfyorg/design-system/button.variants`. The old path is deleted, no
re-export shim. `apps/website` keeps its own copy.

## Review Focus

The file content is byte-identical (rename only). The only decision is
the entry name `./button.variants`, mirroring `./workspaceAvatar`.

## Stack

| PR | branch | base | title |
|---|---|---|---|
| Comfy-Org#19097 | `jaewon/billing-web-remove-plan-grid` | `main` | `FE-3045
refactor(billing-web): drop the billing-web plan grid; hosts own plan
selection` |
| **A Comfy-Org#19098 (this PR)** | **`jaewon/design-system-button-variants`** |
**Comfy-Org#19097** | **`FE-3046 refactor(design-system): move buttonVariants
into @comfyorg/design-system`** |
| B Comfy-Org#19099 | `jaewon/account-ui-checkout-surfaces` | A | `FE-3046
feat(account-ui): shared checkout confirm, saved-method selector, card
form and success` |
| C Comfy-Org#19100 | `jaewon/workspace-adopt-account-ui-checkout` | B | `FE-3046
refactor(workspace): render the subscription checkout steps from
account-ui` |
| D Comfy-Org#19101 | `jaewon/billing-web-shared-checkout` | C | `FE-3046
feat(billing-web): render the shared embedded checkout` |
| E Comfy-Org#19104 | `jaewon/billing-web-success-invite` | D | `FE-3046
feat(billing-web): invite your team from the checkout success step` |
| F Comfy-Org#19105 | `jaewon/checkout-3ds-failure-copy` | E | `FE-3047
fix(account-ui): clear decline toasts once a retry succeeds` |
| G Comfy-Org#19106 | `jaewon/billing-web-return-close-tab` | F | `FE-3048
fix(billing-web): return to the host by closing the checkout tab` |
| H Comfy-Org#19115 | `jaewon/checkout-cta-reachable` | G | `FE-3050
fix(account-ui): keep the checkout CTA reachable when notices grow the
confirm step` |

```mermaid
graph LR
  P0[Comfy-Org#19097: remove plan grid] --> A[A: design-system buttonVariants]
  A --> B[B: account-ui checkout surfaces]
  B --> C[C: workspace adopts account-ui]
  C --> D[D: billing-web shared checkout]
  D --> E[E: billing-web success invite]
  E --> F[F: stale decline toasts]
  F --> G[G: close the billing tab]
  G --> H[H: reachable checkout CTA]
  style A fill:#f9d71c,stroke:Comfy-Org#333,color:#000
```

## AS IS / TO BE

Rename only, no rendered change, so no screenshots.

| AS IS | TO BE |
| --- | --- |
| `@/components/ui/button/button.variants` |
`@comfyorg/design-system/button.variants` |

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pull Bot pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Sep 28, 2026
…tor, card form and success (Comfy-Org#19099)

- Linear: FE-3046

**Merge order:** Comfy-Org#19096 (ADR 0034 amendment) merges first. Until it
does, ADR 0034 rule 4 still forbids account-ui from using the design
system, which B does.

## Why

billing-web is the cloud app's embedded checkout moved to a new tab,
with no UX change (ADR BILLING-WEB-0038, Comfy-Org#19096). Today billing-web
renders a checkout of its own (`EmbeddedCheckout`, `CheckoutPayment`,
`CheckoutSubmit`) that has drifted from the app's: different price
layout, no saved-card selection, different copy. For both to render the
same screens, the app's confirm, price breakdown, saved-card selector,
card form, terms notice and success step have to live where both can
import them. This PR adds them to `@comfyorg/account-ui`. Nothing
renders them yet, so no visual change.

## How

- New entry `@comfyorg/account-ui/billing/checkout`, ported line for
line from the app components. Same markup, same classes, same
conditions:
- `CheckoutSubscribeConfirm` ←
`SubscriptionAddPaymentPreviewWorkspace.vue` (plan header, credits,
total due, discounts, promo code, saved methods, card form, 3DS prompt,
parked-checkout recovery, terms).
- `CheckoutTransitionConfirm` ←
`SubscriptionTransitionPreviewWorkspace.vue` (immediate vs scheduled
change, reactivation banner and threshold checkbox).
- `CheckoutSavedMethods` + `CheckoutSavedMethodSelect` ← the
saved-method row / `SingleSelect` picker (Reka select with the app's
select classes).
- `CheckoutPaymentForm` ← `UnifiedStripePaymentSelector.vue` minus the
app bindings (key, theme and telemetry become props and a `phase`
event).
- `CheckoutSuccess` ← `SubscriptionSuccessWorkspace.vue`, with
`details`/`actions` slots for the app's team invite.
- `CheckoutTermsNote`, `CheckoutPromotionCode`,
`CheckoutPaymentNotices`, `CheckoutVerificationPrompt`: blocks both
confirms repeated. `CheckoutSubscribeSummary`/`CheckoutSubscribeActions`
and `CheckoutReactivationBanner`/`CheckoutTransitionSummary` split the
two confirm templates under the fallow complexity gate; the rendered
markup is the same.
- `checkoutQuote.ts`: the app's `subscriptionQuoteFormatting.ts` +
`planDuration.ts`.
- `@comfyorg/account-ui/billing/catalog` (TS-only entry): the tiers'
prices and monthly credit grants (the numbers in the app's
`TIER_PRICING`). The app's confirm reads the grant from this table
(`TIER_PRICING`), not from the quote's `new_plan.credits_cents`, so
billing-web reads the same table to show the same number; C points the
app at it. A separate entry so non-Vue consumers (the Playwright runner
imports `tierPricing`) never load the components.
- The package has no i18n runtime. Hosts pass a typed `CheckoutCopy`;
interpolated strings are functions, and sentences that wrap an element
(terms links, reactivation amount) keep `{token}`s that the component
splits.
- Hosts pass a resolved `CheckoutPlan` (name, monthly/yearly price,
credits, `pricedByQuote`) instead of the package reading the tier
catalog.
- `selectVariants` moves to `@comfyorg/design-system/select.variants`
(same move as `buttonVariants` in Comfy-Org#19098), so the picker renders the
app's select classes.
- Packaging: `design-system` variants and `tailwind-utils`'s `cn` are
bundled into the published build (dev dependencies). `tailwind-utils` is
not on npm and `design-system` ships TS source, so neither can be a
runtime dependency of a published package. `reka-ui` is a peer. The
rendered classes need the design-system theme and primeicons at runtime,
so `@comfyorg/design-system` and `primeicons` are peers too, and the
package description says to load their CSS and add the package's dist to
the consumer's Tailwind sources. The smoke test imports the new entry in
the typed consumer and treats it as bundler-only, like `billing/stripe`.

### Reactivation renewal date (live testcloud recording)

The reactivation notice and the summary could name different renewal
days for the same quote. On `m2-qa-0925-3ds` the notice said "renew … on
Oct 27" and the summary "Renews … on Oct 25, 2026".
- **Summary:** reads `renewal_at ?? new_plan.period_end`
(`resolveRenewalDate`).
- **Notice:** read `new_plan.period_end` only. When that was absent, it
computed `effective_at` + one period on the client (Sep 27 + 1 month =
Oct 27).
- **Not a server inconsistency:** the server sent one renewal date,
`renewal_at`, which the contract defines as "the next recurring charge
and target-plan period end".
- **Fix:** the notice now reads the same server date as the summary
(`resolveRenewalDate`: `renewal_at`, else the plan's server
`period_end`). The client-side computation is gone. With no server date,
the notice drops its renewal clause through new
`reactivation.withoutRenewalDate` copy, the way the summary drops its
date.
- **Contract:** `renewal_at` is optional in `PreviewSubscribeResponse`
("Optional in the schema for older clients"; "current servers always
return this"). The server should always send it; the client no longer
computes one when it doesn't.
- **Tests:**
  - A new test fails on the old code (Oct 27 vs Oct 25).
- The tests that pinned the client computation (account-ui and the app's
`SubscriptionTransitionPreviewWorkspaceReactivation.test.ts`, in C) are
replaced by a no-renewal-date test.
  - C adds the app's `withoutRenewalDate` strings.

## Review Focus

- The ports are meant to be verbatim. C (the next PR) swaps the app onto
these components and the app's existing component tests (about 2,100
lines across the two confirms and the success step) pass with only stub
names changed. That is the parity check.
- `CheckoutPlan.pricedByQuote` reproduces the app's price rules exactly,
including the odd ones: a tier plan shows the quote's price once one
arrives and `$0` on the success step without one; a team credit stop
always shows its own price.

## Stack

| PR | branch | base | title |
|---|---|---|---|
| Comfy-Org#19097 | `jaewon/billing-web-remove-plan-grid` | `main` | `FE-3045
refactor(billing-web): drop the billing-web plan grid; hosts own plan
selection` |
| A Comfy-Org#19098 | `jaewon/design-system-button-variants` | Comfy-Org#19097 | `FE-3046
refactor(design-system): move buttonVariants into
@comfyorg/design-system` |
| **B (this PR)** | **`jaewon/account-ui-checkout-surfaces`** | **A** |
**`FE-3046 feat(account-ui): shared checkout confirm, saved-method
selector, card form and success`** |
| C Comfy-Org#19100 | `jaewon/workspace-adopt-account-ui-checkout` | B | `FE-3046
refactor(workspace): render the subscription checkout steps from
account-ui` |
| D Comfy-Org#19101 | `jaewon/billing-web-shared-checkout` | C | `FE-3046
feat(billing-web): render the shared embedded checkout` |
| E Comfy-Org#19104 | `jaewon/billing-web-success-invite` | D | `FE-3046
feat(billing-web): invite your team from the checkout success step` |
| F Comfy-Org#19105 | `jaewon/checkout-3ds-failure-copy` | E | `FE-3047
fix(account-ui): clear decline toasts once a retry succeeds` |
| G Comfy-Org#19106 | `jaewon/billing-web-return-close-tab` | F | `FE-3048
fix(billing-web): return to the host by closing the checkout tab` |
| H Comfy-Org#19115 | `jaewon/checkout-cta-reachable` | G | `FE-3050
fix(account-ui): keep the checkout CTA reachable when notices grow the
confirm step` |

```mermaid
graph LR
  P0[Comfy-Org#19097: remove plan grid] --> A[A: design-system buttonVariants]
  A --> B[B: account-ui checkout surfaces]
  B --> C[C: workspace adopts account-ui]
  C --> D[D: billing-web shared checkout]
  D --> E[E: billing-web success invite]
  E --> F[F: stale decline toasts]
  F --> G[G: close the billing tab]
  G --> H[H: reachable checkout CTA]
  style B fill:#f9d71c,stroke:Comfy-Org#333,color:#000
```

## AS IS / TO BE

No rendered change: nothing renders these components in this PR. The
parity screenshots are on C (Comfy-Org#19100, app before/after, pixel-identical)
and D (Comfy-Org#19101, billing-web before/after next to the app).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
christian-byrne pushed a commit to christian-byrne/ComfyUI_frontend that referenced this pull request Sep 29, 2026
…-Org#19101)

- Linear: FE-3046

## Why

billing-web is the cloud app's embedded checkout moved to a new tab,
with no UX change (ADR BILLING-WEB-0038, Comfy-Org#19096). Its checkout was a
separate implementation (`EmbeddedCheckout`, `CheckoutPayment`,
`CheckoutSubmit`) with its own layout and copy, no saved-card selection
and no promo code. With the app now rendering
`@comfyorg/account-ui/billing/checkout` (Comfy-Org#19100), billing-web can render
the same steps.

## How

- `CheckoutView.vue` renders the shared steps inside
`CheckoutFrame.vue`, which reproduces the app's checkout dialog box (the
dialog content class from `useSubscriptionDialog` and the embedded-step
classes from `SubscriptionRequiredDialogContentUnified`):
- `new_subscription` quote → `CheckoutSubscribeConfirm` with the card
form, the saved methods from `usePaymentMethods` (default preselected;
Change / Add new payment method swap in the card form) and the promo
code.
- any other transition → `CheckoutTransitionConfirm`, single column, no
card form: the server charges the method on file (the Comfy-Org#18684 rule, now
through the same component as the app). A reactivation the quote or the
server demands shows the app's banner and threshold checkbox.
- success → `CheckoutSuccess` (plan card, credits per month); Close
returns to the product with the outcome.
- Through the payment it behaves like the app: the confirm stays with
the pay button busy and a processing (or "verify your payment") toast; a
verification that fails in the tab shows the confirm's inline notice; a
decline, timeout or refused subscribe shows the app's error toast with
its detail copy and leaves the confirm, and a card already typed, in
place. `CheckoutToast.vue` is that toast.
- Subscribe carries `saved_payment_method_id` for a saved method and
`promotion_code` for an applied promo, next to the existing token, quote
identity, proration and return URL.
- Plan: tier name and monthly credits from
`@comfyorg/account-ui/billing/catalog` (Comfy-Org#19099). A team stop's price and
credits come from the `/billing/plans` stop the link names, through the
same catalog functions as the app's slider and confirm.
- Copy: billing-web's `checkout.*` keys are replaced with the app's
English strings, key for key.
- Page environment: the frame applies what the app's page applies around
the dialog — its dark palette's `--interface-stroke`, `color-scheme:
dark`, and browser defaults for inputs, the select trigger and links
(the app has no Tailwind preflight). `styles.css` sources all of
account-ui's billing components (the Stripe form's layout classes were
missing); `primeicons` and `reka-ui` are added.
- Tests: `CheckoutView.test.ts` rewritten against the shared components
(saved method, Change, promo, reactivation, decline/3DS outcomes, Comfy-Org#18684
cases kept); `e2e/checkout.spec.ts` updated plus a saved-method e2e.
billing-web e2e 29/29 locally.

### billing-web-only UI deleted

- `EmbeddedCheckout`'s split card layout (5/12 summary sidebar, its own
card, muted `h1`, lucide back arrow and close X).
- Plan title `{tier} · {duration}` ("Pro · Monthly"), hero `$28.00` with
"USD per month"/"USD per year", "{amount} billed yearly", "Starting
today".
- "Credits refill every month" showing `credits_cents` as dollars
("$211.00" for 21,100 credits).
- The terms line "By subscribing, you agree to recurring charges until
cancellation." (no links).
- `CheckoutSubmit`'s pay button and its reactivation checkbox on the
card form ("Your subscription was cancelled. I confirm the {amount}
charge to reactivate it."); reactivation now uses the app's banner on
the plan-change confirm.
- Its own Stripe copy ("Choose how you would like to pay.", "The payment
form isn't available right now…", its Alipay note, "Something went
wrong. Please try again.").
- The inline failure paragraph above the pay button.
- The `CheckoutSteps` panel that replaced the checkout while paying and
after a failure ("Review payment", "Payment declined", "Payment could
not be processed", Try again / Use a different payment method / Contact
support).
- The success panel (tinted check circle, "Your plan was updated. A
receipt was sent to your email.", plan line, "Return to {product}" link
button).

### billing-web-only UI kept

- The way back to the host: Close (the dialog's X and the success step's
Close) leaves for the product's return URL instead of closing a dialog.
- "Loading…" while the quote loads, and the quote-refused panel with
Back (the app never opens the confirm without a quote).
- `CheckoutToast`, standing in for the app's toast host (outside the
checkout panel).

### Not closed here (see Review Focus)

- Team plan success: the app's "Invite your team" step lands in E
(Comfy-Org#19104).
- Stripe Payment/Address Element options differ in the live recording
(Google Pay and a full address on billing-web vs card/Alipay/US bank and
name-only in the app). Both hosts now render the same
`StripePaymentForm` with the same options; what remains comes from the
server's `payment_method_configuration_id` and Stripe's per-domain
wallet registration, which need a live backend check.

### Shared with the app, so the hosts can't drift (review fixes)

- **Decline copy:** `declineDetailKey(reason)` in account-core is one
exhaustive switch over the contract's `BillingDeclineReason`. The app's
SDK rail (`topupOperationView.declineDetail`) and billing-web both call
it. Before this, billing-web had its own list that omitted `generic`. A
reason-less decline (account-core defaults it to `generic`) therefore
read "We couldn't update your subscription." on billing-web and "Your
bank declined this payment." in the app. The list also carried 15
strings outside the enum.
- **Processing vs verify toast:** superseded below. The app's rule is
`awaitsHostedAction`, now shared, not `awaitsVerification`.
- **Team hero price:** `mapApiTeamCreditStops` and
`getStopDiscountedMonthlyUsd` move from the app into
`@comfyorg/account-ui/billing/catalog`. The app's pricing table, credit
slider and subscription dialog import them from there, and billing-web's
`teamCheckoutPlan` prices the stop with them instead of `price_cents /
months`.
- Tests: table tests for `declineDetailKey` (all 8 reasons) and
`awaitsVerification`, the moved stop tests, billing-web decline rows for
`generic` / `incorrect_cvc` / `processing_error`, and team
monthly/annual stop prices. The e2e that pinned the old reason-less copy
now expects the app's decline copy.
- Harness: new step P6a2, the server declines with no `decline_reason`.
Rerun on D: 0% copy/element difference on every step except P7T, whose
team invite is E. Rerun on G (top of stack): 0% on all 15 steps.

### Toasts and success frame (live testcloud recording)

- **Why a replica:** billing-web's toast is a measured replica of the
app's PrimeVue Aura toast, because AGENTS.md forbids new PrimeVue usage.
The parity harness compares every toast (size, colors, fonts, icon,
close button, each part's position) and fails on drift.
- **Assistive tech:** every toast is `role="alert"`,
`aria-live="assertive"`, `aria-atomic="true"`, as PrimeVue renders the
app's. The harness compares these too.
- **Anchor:** toasts sit top-right. The app anchors its message toasts
to the graph canvas panel, which billing-web does not have.
- **End date:** the reactivation notice's "set to end on" date now comes
from the billing status's `cancel_at`, the field the app reads, instead
of the quote's `current_plan.period_end`. Harness step P2e gives the two
server values different dates; both hosts show `cancel_at` (Oct 25 vs
the quote's Oct 27).

- **Toast:** `CheckoutToast` was a look-alike: neutral, no close button,
one at a time. It now renders the app's dark Aura PrimeVue toast.
- Styling: the severity tint, 36% border and shadow, `blur(10px)`, and a
28px close button.
- Layout: the two hosts the app uses. The operation toast is a spinner
or prompt beside one line; the message toast is a severity icon, summary
and detail.
- The numbers come from the app's computed styles, captured by the
harness. It is not PrimeVue itself, because AGENTS.md rules out new
PrimeVue use in billing-web.
- **Lifetimes match the app:**
- The progress toast stays while the payment is pending. A closed one
stays closed until the operation's state changes.
  - Errors stay until closed.
- "Subscription updated successfully" shows for 5 s after a subscribe
the server charged for, like the app's SDK rail (`requiredPayment`). A
plan the server activated on the spot gets none.
- **Prompt vs spinner:** the app shows the "Verify your payment" prompt
only when a hosted action page is waiting. An in-page 3DS challenge
keeps the spinner. `awaitsVerification` (adopted in review) also counted
the challenge, and the harness showed it disagreed with the app. The
app's rule is now `awaitsHostedAction` in account-core, used by the
app's `billingSdkStore` and by billing-web.
- **Success frame:** the app pins the success frame only after a new
subscription. After a plan change it uses the dialog's content-sized
box. `CheckoutFrame` gets that `fit` step, so the blank band above "Send
invites" is gone.
- **Harness:** it now captures the toast region and the frame box on
both sides, not just the panel. Toasts are paired by text and compared
on size, colors, fonts, icon, close button and each part's position. New
step P7C covers success after a plan change that took a payment. At the
stack top, all 19 steps show no copy or element difference, the same
toasts with the same measurements, and equal frame boxes.

**Toasts, app (left) vs billing-web (right): progress, decline,
success**

<img width="824" alt="D-toasts"
src="https://github.com/user-attachments/assets/06d04e8e-6aba-46a8-9287-f43d3019844a"
/>

**billing-web progress toast, AS IS | TO BE**

<img width="1092" alt="D-toast-web-asis-tobe"
src="https://github.com/user-attachments/assets/d860df11-e1eb-49e2-ba17-e30efec5723c"
/>

**P7C success after a plan change: billing-web AS IS | TO BE, then app |
billing-web**

<img width="1448" alt="D-frame-web"
src="https://github.com/user-attachments/assets/36c3a98f-591f-48ca-8a58-03a3273ae90f"
/>
<img width="1448" alt="D-frame-appweb"
src="https://github.com/user-attachments/assets/ecd2c4ee-fbbd-48ba-b55c-b0645b0b5662"
/>

### A checkout the server still holds (M2 QA N1)

- On mount the view adopts the operation the billing status names
(`lifecycle.recover()`), the way the app resumes
`pending_billing_op_id`. Before this, opening checkout while an earlier
subscription was pending showed a fresh card form or an enabled confirm.
Pressing it sent nothing and showed "Something went wrong."
- The confirm now gets the app's `action-url`, `authentication-error`
and `parked-checkout-recovery`, and `paying` follows the app's
`isPolling` rule. An operation parked on `awaiting_payment_method`
offers "Complete your payment", and a settling invoice holds the pay
action.
- A subscribe the core refuses with `OPERATION_ALREADY_PENDING` shows
the app's sentence ("A payment you started earlier is still going
through…") instead of the generic failure.
- Tests: view tests for a parked op and a settling-invoice op, both red
without the fix. Harness steps P8a (parked) and P8b (settling invoice)
match the app with 0% copy/element difference.
- Same on both hosts: the core refuses a second subscribe while the
status names a pending one, so on the SDK rail "Complete your payment"
answers with that sentence in the app and in billing-web alike.

**P8a: parked checkout, Cloud app (left) | billing-web (right)**

<img width="1448" alt="D-parked"
src="https://github.com/user-attachments/assets/7316e0da-e4df-4fe9-bf7b-5e8d34754efc"
/>

**P8b: settling invoice, Cloud app (left) | billing-web (right)**

<img width="1448" alt="D-held"
src="https://github.com/user-attachments/assets/1940763e-3f0a-4b91-9c71-c0d175b0c69a"
/>

**P6a2: reason-less decline, Cloud app (left) | billing-web (right)**

<img width="1448" alt="D-no-reason"
src="https://github.com/user-attachments/assets/75d0ed13-bb14-453d-8b73-eda7b23ff754"
/>

## Review Focus

- The two gaps above.

## Stack

| PR | branch | base | title |
|---|---|---|---|
| Comfy-Org#19097 | `jaewon/billing-web-remove-plan-grid` | `main` | `FE-3045
refactor(billing-web): drop the billing-web plan grid; hosts own plan
selection` |
| A Comfy-Org#19098 | `jaewon/design-system-button-variants` | Comfy-Org#19097 | `FE-3046
refactor(design-system): move buttonVariants into
@comfyorg/design-system` |
| B Comfy-Org#19099 | `jaewon/account-ui-checkout-surfaces` | A | `FE-3046
feat(account-ui): shared checkout confirm, saved-method selector, card
form and success` |
| C Comfy-Org#19100 | `jaewon/workspace-adopt-account-ui-checkout` | B | `FE-3046
refactor(workspace): render the subscription checkout steps from
account-ui` |
| **D (this PR)** | **`jaewon/billing-web-shared-checkout`** | **C** |
**`FE-3046 feat(billing-web): render the shared embedded checkout`** |
| E Comfy-Org#19104 | `jaewon/billing-web-success-invite` | D | `FE-3046
feat(billing-web): invite your team from the checkout success step` |
| F Comfy-Org#19105 | `jaewon/checkout-3ds-failure-copy` | E | `FE-3047
fix(account-ui): clear decline toasts once a retry succeeds` |
| G Comfy-Org#19106 | `jaewon/billing-web-return-close-tab` | F | `FE-3048
fix(billing-web): return to the host by closing the checkout tab` |
| H Comfy-Org#19115 | `jaewon/checkout-cta-reachable` | G | `FE-3050
fix(account-ui): keep the checkout CTA reachable when notices grow the
confirm step` |

```mermaid
graph LR
  P0[Comfy-Org#19097: remove plan grid] --> A[A: design-system buttonVariants]
  A --> B[B: account-ui checkout surfaces]
  B --> C[C: workspace adopts account-ui]
  C --> D[D: billing-web shared checkout]
  D --> E[E: billing-web success invite]
  E --> F[F: stale decline toasts]
  F --> G[G: close the billing tab]
  G --> H[H: reachable checkout CTA]
  style D fill:#f9d71c,stroke:Comfy-Org#333,color:#000
```

## AS IS / TO BE

### Live (testcloud) AS IS / TO BE

Real app and real billing-web against testcloud, not the harness. Same
account and plan change on both sides: Team Monthly team_700 → team_1400
($1,295/mo) on a cancelled team workspace, which reactivates it (the
"Confirm your upgrade" path). Both subscriptions were cancelled again
afterwards.

- **AS IS:** `main` ec7764f. Embedded = local app on testcloud with
`ff:hosted_billing_destination="stripe"`. billing-web = testcloud
(`billing_web`) → testbilling. Team Monthly team_700, new subscription.
- **TO BE:** stack top f02bdd6 (H Comfy-Org#19115, includes this PR) for both
surfaces. Local app
(`DEV_SERVER_COMFYUI_URL=https://testcloud.comfy.org/`, testcloud
`pk_test`) and local billing-web on :5174 (`VITE_BILLING_ENV=test`).
Embedded = `ff:hosted_billing_destination="stripe"` on `m2-qa-0925-3ds`
(saved card needs 3DS). billing-web = `"billing_web"` on
`m2-qa-0927-full`, handed off from the app's Change plan; the server's
`billing_web_url` was cleared in the page so the app opens the local
billing-web.

**TO BE video, embedded (left) | billing-web (right).** Plan picked in
the app → confirm → pay → (3DS on the embedded side's saved card) →
"You're all set" with Invite your team → Close. On billing-web, Close
closes the tab and the app shows the new credit balance.


https://github.com/user-attachments/assets/a4a527e4-9a89-4808-8e27-90b143cc9bce

Full-size recordings: embedded
https://github.com/user-attachments/assets/fd8f0ea7-6480-4b54-bb28-afc7fffbfdd6
· billing-web
https://github.com/user-attachments/assets/1da3540f-fcf6-4691-a075-997b07c364f1

**AS IS video, embedded (left) | billing-web (right)** (new
subscription, recorded separately so the timelines do not line up).


https://github.com/user-attachments/assets/b653c5ba-2e82-4bfa-bed5-f151109e580e

**TO BE per step, embedded (left) | billing-web (right)**

1. Plan chosen in the host app (same dialog; billing-web has no plan
picker)

<img width="1400" alt="1-plan-picker-in-host"
src="https://github.com/user-attachments/assets/2b59d096-c13f-4e8f-a96b-9e86ebee4f58"
/>

2. Confirm your upgrade: same notice, summary, discount, total, promo
and CTA

<img width="1400" alt="2-confirm-top"
src="https://github.com/user-attachments/assets/20bbd27d-361c-48d4-8857-ddd6bc71ced3"
/>

3. Confirm scrolled inside its frame: terms line reachable on both

<img width="1400" alt="3-confirm-scrolled-terms"
src="https://github.com/user-attachments/assets/2f3d6e40-6819-4f52-b2f8-b76d829fca1c"
/>

4. Paying: busy CTA and "Processing payment — setting up your
workspace…" toast

<img width="1400" alt="4-processing"
src="https://github.com/user-attachments/assets/f5372838-c85d-4113-aece-019ce940cf40"
/>

5. Embedded only: Stripe 3DS2 test page for the saved card
(billing-web's workspace card did not ask for 3DS)

<img width="700" alt="5-embedded-3ds-challenge"
src="https://github.com/user-attachments/assets/dbd3abe9-3d90-4da5-b398-945e6f9cefb2"
/>

6. You're all set: plan card, 295,400 / month, Invite your team, Send
invites, Close

<img width="1400" alt="6-success"
src="https://github.com/user-attachments/assets/42b820df-b6b8-4748-a768-5969d7474fb4"
/>

7. After Close: embedded dialog closes; billing-web tab closes and the
app shows 294,054 credits with no Resubscribe

<img width="1400" alt="7-after-close"
src="https://github.com/user-attachments/assets/4989f353-1d96-4255-b7a4-cd78a092f86e"
/>

**AS IS per step, embedded (left) | billing-web (right)**

<img width="1400" alt="AS IS P1 confirm"
src="https://github.com/user-attachments/assets/a027af94-3f09-4ed1-8d13-5a561cb7a788"
/>
<img width="1400" alt="AS IS P6 decline 0002"
src="https://github.com/user-attachments/assets/ec0e267a-8255-4460-98a7-5ef466dcbe8b"
/>
<img width="1400" alt="AS IS P7 success"
src="https://github.com/user-attachments/assets/381b0a9b-93fd-42ef-9200-adc39d42b179"
/>
<img width="1400" alt="AS IS P7 return to app"
src="https://github.com/user-attachments/assets/2754cf9e-e300-4a73-8889-76ed5dbab082"
/>

**Differences still visible live (TO BE)**

- Processing toast: the app's is the blue info toast with a close
button; billing-web's `CheckoutToast` is a neutral dark toast without
one.
- Success: the app's dialog fits its content; billing-web's frame keeps
the confirm step's fixed height, so a blank band sits between the email
field and Send invites. The app also shows a "Subscription updated
successfully" toast; billing-web does not.
- Embedded only (pre-existing, N4): a "Couldn't open the payment page —
please allow popups" warning appears during the in-page 3DS challenge.
- Embedded confirm on `m2-qa-0925-3ds`: the notice says it renews on Oct
27, 2026 while the summary says "Renews at $1,295.00 on Oct 25, 2026".
Not compared on billing-web, whose workspace has both dates on Oct 27.

**Not recorded live yet**

- ~~New subscription (card entry, decline 0002, 3DS 3184 complete and
fail).~~ Recorded on billing-web in the live rerun below (workspace
`m2-qa-0927-new`). An embedded new-subscription run on the same build
was not possible: the account has one free workspace, so the embedded
side is covered by the AS IS recording above and the upgrade
side-by-side below.
- Failed 3DS on the upgrade path: not run, because a failed reactivating
upgrade leaves the operation pending and the workspace cannot be
cancelled (N6).

#### Live rerun on stack top 9dab83d (2026-09-27)

**Upgrade, AS IS embedded (left) | TO BE billing-web (right):** Team
147.7K → 295.4K in the app dialog and Team 295.4K → 527.5K on
billing-web, both with 3DS complete; same confirm, 3DS and success
screens.


https://github.com/user-attachments/assets/d4d49d40-27bc-4bbe-8886-99f2df7acd8f

**TO BE billing-web, new Team Monthly subscription:** decline (0002) →
3DS fail (3184) → 3DS complete → "You're all set" with Invite your team
→ Close closes the tab and the app shows the plan.


https://github.com/user-attachments/assets/a4c58e5d-429a-4332-bfa4-e10d8621f082

### Mocked harness

Checkout parity harness (`temp/scripts/checkout-parity`, same fixtures
on both surfaces, fake `js.stripe.com` masking the Stripe elements;
mocked Cloud, not a live backend). Each image: **billing-web AS IS**
(`main` ec7764f) | **billing-web TO BE** (this PR, d24d242) |
**cloud app** (same build). Copy/element diff app vs billing-web TO BE:
none on all 11 steps. Panel pixel diff (app vs TO BE) below; the
non-zero ones are the busy button's spinner frame. The harness's style
notes that remain pair two same-named elements (the two Stripe masks,
the two Close buttons) and are identical in the structure dumps.

**P1-confirm-new-personal** — pixel diff 0%

<img width="1400" alt="P1-confirm-new-personal"
src="https://github.com/user-attachments/assets/062a2b68-9299-4920-b321-0a72b3102918"
/>

**P1T-confirm-new-team** — pixel diff 0%

<img width="1400" alt="P1T-confirm-new-team"
src="https://github.com/user-attachments/assets/786f38b6-5f02-4a43-ad63-6a44cb7465a8"
/>

**P2a-confirm-upgrade-immediate** — pixel diff 0%

<img width="1400" alt="P2a-confirm-upgrade-immediate"
src="https://github.com/user-attachments/assets/f4fc2395-9cc2-4668-b338-52051f84189f"
/>

**P2b-confirm-downgrade-zero-due** — pixel diff 0%

<img width="1400" alt="P2b-confirm-downgrade-zero-due"
src="https://github.com/user-attachments/assets/a4cef7bc-4f04-48e2-b740-85a50ad2b1de"
/>

**P3-saved-card-selector** — pixel diff 0%

<img width="1400" alt="P3-saved-card-selector"
src="https://github.com/user-attachments/assets/f4ef89a3-d681-4db3-9209-2f9e7350dae0"
/>

**P3b-no-saved-cards** — pixel diff 0.000%

<img width="1400" alt="P3b-no-saved-cards"
src="https://github.com/user-attachments/assets/ac51ce04-ea6b-4a06-a706-5092bbd77b5d"
/>

**P4-card-entry** — pixel diff 0.000%

<img width="1400" alt="P4-card-entry"
src="https://github.com/user-attachments/assets/705d93bf-e33c-4376-b357-d4be86f332d3"
/>

**P5-3ds-in-progress** — pixel diff 0.003%

<img width="1400" alt="P5-3ds-in-progress"
src="https://github.com/user-attachments/assets/39f72aaa-28b1-4266-bdd5-b14fe4b6a99b"
/>

**P6a-declined** — pixel diff 0%

<img width="1400" alt="P6a-declined"
src="https://github.com/user-attachments/assets/66ef6af7-c82b-4f76-b5ca-37896d734420"
/>

**P6b-3ds-failed** — pixel diff 0.003%

<img width="1400" alt="P6b-3ds-failed"
src="https://github.com/user-attachments/assets/e18807f0-b0d8-4584-a9fc-86ae86ec26f9"
/>

**P7-success** — pixel diff 0%

<img width="1400" alt="P7-success"
src="https://github.com/user-attachments/assets/ecd05652-cee7-4464-bae9-61da565904c8"
/>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
christian-byrne pushed a commit that referenced this pull request Sep 29, 2026
…tor, card form and success (#19099)

- Linear: FE-3046

**Merge order:** #19096 (ADR 0034 amendment) merges first. Until it
does, ADR 0034 rule 4 still forbids account-ui from using the design
system, which B does.

## Why

billing-web is the cloud app's embedded checkout moved to a new tab,
with no UX change (ADR BILLING-WEB-0038, #19096). Today billing-web
renders a checkout of its own (`EmbeddedCheckout`, `CheckoutPayment`,
`CheckoutSubmit`) that has drifted from the app's: different price
layout, no saved-card selection, different copy. For both to render the
same screens, the app's confirm, price breakdown, saved-card selector,
card form, terms notice and success step have to live where both can
import them. This PR adds them to `@comfyorg/account-ui`. Nothing
renders them yet, so no visual change.

## How

- New entry `@comfyorg/account-ui/billing/checkout`, ported line for
line from the app components. Same markup, same classes, same
conditions:
- `CheckoutSubscribeConfirm` ←
`SubscriptionAddPaymentPreviewWorkspace.vue` (plan header, credits,
total due, discounts, promo code, saved methods, card form, 3DS prompt,
parked-checkout recovery, terms).
- `CheckoutTransitionConfirm` ←
`SubscriptionTransitionPreviewWorkspace.vue` (immediate vs scheduled
change, reactivation banner and threshold checkbox).
- `CheckoutSavedMethods` + `CheckoutSavedMethodSelect` ← the
saved-method row / `SingleSelect` picker (Reka select with the app's
select classes).
- `CheckoutPaymentForm` ← `UnifiedStripePaymentSelector.vue` minus the
app bindings (key, theme and telemetry become props and a `phase`
event).
- `CheckoutSuccess` ← `SubscriptionSuccessWorkspace.vue`, with
`details`/`actions` slots for the app's team invite.
- `CheckoutTermsNote`, `CheckoutPromotionCode`,
`CheckoutPaymentNotices`, `CheckoutVerificationPrompt`: blocks both
confirms repeated. `CheckoutSubscribeSummary`/`CheckoutSubscribeActions`
and `CheckoutReactivationBanner`/`CheckoutTransitionSummary` split the
two confirm templates under the fallow complexity gate; the rendered
markup is the same.
- `checkoutQuote.ts`: the app's `subscriptionQuoteFormatting.ts` +
`planDuration.ts`.
- `@comfyorg/account-ui/billing/catalog` (TS-only entry): the tiers'
prices and monthly credit grants (the numbers in the app's
`TIER_PRICING`). The app's confirm reads the grant from this table
(`TIER_PRICING`), not from the quote's `new_plan.credits_cents`, so
billing-web reads the same table to show the same number; C points the
app at it. A separate entry so non-Vue consumers (the Playwright runner
imports `tierPricing`) never load the components.
- The package has no i18n runtime. Hosts pass a typed `CheckoutCopy`;
interpolated strings are functions, and sentences that wrap an element
(terms links, reactivation amount) keep `{token}`s that the component
splits.
- Hosts pass a resolved `CheckoutPlan` (name, monthly/yearly price,
credits, `pricedByQuote`) instead of the package reading the tier
catalog.
- `selectVariants` moves to `@comfyorg/design-system/select.variants`
(same move as `buttonVariants` in #19098), so the picker renders the
app's select classes.
- Packaging: `design-system` variants and `tailwind-utils`'s `cn` are
bundled into the published build (dev dependencies). `tailwind-utils` is
not on npm and `design-system` ships TS source, so neither can be a
runtime dependency of a published package. `reka-ui` is a peer. The
rendered classes need the design-system theme and primeicons at runtime,
so `@comfyorg/design-system` and `primeicons` are peers too, and the
package description says to load their CSS and add the package's dist to
the consumer's Tailwind sources. The smoke test imports the new entry in
the typed consumer and treats it as bundler-only, like `billing/stripe`.

### Reactivation renewal date (live testcloud recording)

The reactivation notice and the summary could name different renewal
days for the same quote. On `m2-qa-0925-3ds` the notice said "renew … on
Oct 27" and the summary "Renews … on Oct 25, 2026".
- **Summary:** reads `renewal_at ?? new_plan.period_end`
(`resolveRenewalDate`).
- **Notice:** read `new_plan.period_end` only. When that was absent, it
computed `effective_at` + one period on the client (Sep 27 + 1 month =
Oct 27).
- **Not a server inconsistency:** the server sent one renewal date,
`renewal_at`, which the contract defines as "the next recurring charge
and target-plan period end".
- **Fix:** the notice now reads the same server date as the summary
(`resolveRenewalDate`: `renewal_at`, else the plan's server
`period_end`). The client-side computation is gone. With no server date,
the notice drops its renewal clause through new
`reactivation.withoutRenewalDate` copy, the way the summary drops its
date.
- **Contract:** `renewal_at` is optional in `PreviewSubscribeResponse`
("Optional in the schema for older clients"; "current servers always
return this"). The server should always send it; the client no longer
computes one when it doesn't.
- **Tests:**
  - A new test fails on the old code (Oct 27 vs Oct 25).
- The tests that pinned the client computation (account-ui and the app's
`SubscriptionTransitionPreviewWorkspaceReactivation.test.ts`, in C) are
replaced by a no-renewal-date test.
  - C adds the app's `withoutRenewalDate` strings.

## Review Focus

- The ports are meant to be verbatim. C (the next PR) swaps the app onto
these components and the app's existing component tests (about 2,100
lines across the two confirms and the success step) pass with only stub
names changed. That is the parity check.
- `CheckoutPlan.pricedByQuote` reproduces the app's price rules exactly,
including the odd ones: a tier plan shows the quote's price once one
arrives and `$0` on the success step without one; a team credit stop
always shows its own price.

## Stack

| PR | branch | base | title |
|---|---|---|---|
| #19097 | `jaewon/billing-web-remove-plan-grid` | `main` | `FE-3045
refactor(billing-web): drop the billing-web plan grid; hosts own plan
selection` |
| A #19098 | `jaewon/design-system-button-variants` | #19097 | `FE-3046
refactor(design-system): move buttonVariants into
@comfyorg/design-system` |
| **B (this PR)** | **`jaewon/account-ui-checkout-surfaces`** | **A** |
**`FE-3046 feat(account-ui): shared checkout confirm, saved-method
selector, card form and success`** |
| C #19100 | `jaewon/workspace-adopt-account-ui-checkout` | B | `FE-3046
refactor(workspace): render the subscription checkout steps from
account-ui` |
| D #19101 | `jaewon/billing-web-shared-checkout` | C | `FE-3046
feat(billing-web): render the shared embedded checkout` |
| E #19104 | `jaewon/billing-web-success-invite` | D | `FE-3046
feat(billing-web): invite your team from the checkout success step` |
| F #19105 | `jaewon/checkout-3ds-failure-copy` | E | `FE-3047
fix(account-ui): clear decline toasts once a retry succeeds` |
| G #19106 | `jaewon/billing-web-return-close-tab` | F | `FE-3048
fix(billing-web): return to the host by closing the checkout tab` |
| H #19115 | `jaewon/checkout-cta-reachable` | G | `FE-3050
fix(account-ui): keep the checkout CTA reachable when notices grow the
confirm step` |

```mermaid
graph LR
  P0[#19097: remove plan grid] --> A[A: design-system buttonVariants]
  A --> B[B: account-ui checkout surfaces]
  B --> C[C: workspace adopts account-ui]
  C --> D[D: billing-web shared checkout]
  D --> E[E: billing-web success invite]
  E --> F[F: stale decline toasts]
  F --> G[G: close the billing tab]
  G --> H[H: reachable checkout CTA]
  style B fill:#f9d71c,stroke:#333,color:#000
```

## AS IS / TO BE

No rendered change: nothing renders these components in this PR. The
parity screenshots are on C (#19100, app before/after, pixel-identical)
and D (#19101, billing-web before/after next to the app).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
christian-byrne pushed a commit that referenced this pull request Sep 29, 2026
…tor, card form and success (#19099)

- Linear: FE-3046

**Merge order:** #19096 (ADR 0034 amendment) merges first. Until it
does, ADR 0034 rule 4 still forbids account-ui from using the design
system, which B does.

## Why

billing-web is the cloud app's embedded checkout moved to a new tab,
with no UX change (ADR BILLING-WEB-0038, #19096). Today billing-web
renders a checkout of its own (`EmbeddedCheckout`, `CheckoutPayment`,
`CheckoutSubmit`) that has drifted from the app's: different price
layout, no saved-card selection, different copy. For both to render the
same screens, the app's confirm, price breakdown, saved-card selector,
card form, terms notice and success step have to live where both can
import them. This PR adds them to `@comfyorg/account-ui`. Nothing
renders them yet, so no visual change.

## How

- New entry `@comfyorg/account-ui/billing/checkout`, ported line for
line from the app components. Same markup, same classes, same
conditions:
- `CheckoutSubscribeConfirm` ←
`SubscriptionAddPaymentPreviewWorkspace.vue` (plan header, credits,
total due, discounts, promo code, saved methods, card form, 3DS prompt,
parked-checkout recovery, terms).
- `CheckoutTransitionConfirm` ←
`SubscriptionTransitionPreviewWorkspace.vue` (immediate vs scheduled
change, reactivation banner and threshold checkbox).
- `CheckoutSavedMethods` + `CheckoutSavedMethodSelect` ← the
saved-method row / `SingleSelect` picker (Reka select with the app's
select classes).
- `CheckoutPaymentForm` ← `UnifiedStripePaymentSelector.vue` minus the
app bindings (key, theme and telemetry become props and a `phase`
event).
- `CheckoutSuccess` ← `SubscriptionSuccessWorkspace.vue`, with
`details`/`actions` slots for the app's team invite.
- `CheckoutTermsNote`, `CheckoutPromotionCode`,
`CheckoutPaymentNotices`, `CheckoutVerificationPrompt`: blocks both
confirms repeated. `CheckoutSubscribeSummary`/`CheckoutSubscribeActions`
and `CheckoutReactivationBanner`/`CheckoutTransitionSummary` split the
two confirm templates under the fallow complexity gate; the rendered
markup is the same.
- `checkoutQuote.ts`: the app's `subscriptionQuoteFormatting.ts` +
`planDuration.ts`.
- `@comfyorg/account-ui/billing/catalog` (TS-only entry): the tiers'
prices and monthly credit grants (the numbers in the app's
`TIER_PRICING`). The app's confirm reads the grant from this table
(`TIER_PRICING`), not from the quote's `new_plan.credits_cents`, so
billing-web reads the same table to show the same number; C points the
app at it. A separate entry so non-Vue consumers (the Playwright runner
imports `tierPricing`) never load the components.
- The package has no i18n runtime. Hosts pass a typed `CheckoutCopy`;
interpolated strings are functions, and sentences that wrap an element
(terms links, reactivation amount) keep `{token}`s that the component
splits.
- Hosts pass a resolved `CheckoutPlan` (name, monthly/yearly price,
credits, `pricedByQuote`) instead of the package reading the tier
catalog.
- `selectVariants` moves to `@comfyorg/design-system/select.variants`
(same move as `buttonVariants` in #19098), so the picker renders the
app's select classes.
- Packaging: `design-system` variants and `tailwind-utils`'s `cn` are
bundled into the published build (dev dependencies). `tailwind-utils` is
not on npm and `design-system` ships TS source, so neither can be a
runtime dependency of a published package. `reka-ui` is a peer. The
rendered classes need the design-system theme and primeicons at runtime,
so `@comfyorg/design-system` and `primeicons` are peers too, and the
package description says to load their CSS and add the package's dist to
the consumer's Tailwind sources. The smoke test imports the new entry in
the typed consumer and treats it as bundler-only, like `billing/stripe`.

### Reactivation renewal date (live testcloud recording)

The reactivation notice and the summary could name different renewal
days for the same quote. On `m2-qa-0925-3ds` the notice said "renew … on
Oct 27" and the summary "Renews … on Oct 25, 2026".
- **Summary:** reads `renewal_at ?? new_plan.period_end`
(`resolveRenewalDate`).
- **Notice:** read `new_plan.period_end` only. When that was absent, it
computed `effective_at` + one period on the client (Sep 27 + 1 month =
Oct 27).
- **Not a server inconsistency:** the server sent one renewal date,
`renewal_at`, which the contract defines as "the next recurring charge
and target-plan period end".
- **Fix:** the notice now reads the same server date as the summary
(`resolveRenewalDate`: `renewal_at`, else the plan's server
`period_end`). The client-side computation is gone. With no server date,
the notice drops its renewal clause through new
`reactivation.withoutRenewalDate` copy, the way the summary drops its
date.
- **Contract:** `renewal_at` is optional in `PreviewSubscribeResponse`
("Optional in the schema for older clients"; "current servers always
return this"). The server should always send it; the client no longer
computes one when it doesn't.
- **Tests:**
  - A new test fails on the old code (Oct 27 vs Oct 25).
- The tests that pinned the client computation (account-ui and the app's
`SubscriptionTransitionPreviewWorkspaceReactivation.test.ts`, in C) are
replaced by a no-renewal-date test.
  - C adds the app's `withoutRenewalDate` strings.

## Review Focus

- The ports are meant to be verbatim. C (the next PR) swaps the app onto
these components and the app's existing component tests (about 2,100
lines across the two confirms and the success step) pass with only stub
names changed. That is the parity check.
- `CheckoutPlan.pricedByQuote` reproduces the app's price rules exactly,
including the odd ones: a tier plan shows the quote's price once one
arrives and `$0` on the success step without one; a team credit stop
always shows its own price.

## Stack

| PR | branch | base | title |
|---|---|---|---|
| #19097 | `jaewon/billing-web-remove-plan-grid` | `main` | `FE-3045
refactor(billing-web): drop the billing-web plan grid; hosts own plan
selection` |
| A #19098 | `jaewon/design-system-button-variants` | #19097 | `FE-3046
refactor(design-system): move buttonVariants into
@comfyorg/design-system` |
| **B (this PR)** | **`jaewon/account-ui-checkout-surfaces`** | **A** |
**`FE-3046 feat(account-ui): shared checkout confirm, saved-method
selector, card form and success`** |
| C #19100 | `jaewon/workspace-adopt-account-ui-checkout` | B | `FE-3046
refactor(workspace): render the subscription checkout steps from
account-ui` |
| D #19101 | `jaewon/billing-web-shared-checkout` | C | `FE-3046
feat(billing-web): render the shared embedded checkout` |
| E #19104 | `jaewon/billing-web-success-invite` | D | `FE-3046
feat(billing-web): invite your team from the checkout success step` |
| F #19105 | `jaewon/checkout-3ds-failure-copy` | E | `FE-3047
fix(account-ui): clear decline toasts once a retry succeeds` |
| G #19106 | `jaewon/billing-web-return-close-tab` | F | `FE-3048
fix(billing-web): return to the host by closing the checkout tab` |
| H #19115 | `jaewon/checkout-cta-reachable` | G | `FE-3050
fix(account-ui): keep the checkout CTA reachable when notices grow the
confirm step` |

```mermaid
graph LR
  P0[#19097: remove plan grid] --> A[A: design-system buttonVariants]
  A --> B[B: account-ui checkout surfaces]
  B --> C[C: workspace adopts account-ui]
  C --> D[D: billing-web shared checkout]
  D --> E[E: billing-web success invite]
  E --> F[F: stale decline toasts]
  F --> G[G: close the billing tab]
  G --> H[H: reachable checkout CTA]
  style B fill:#f9d71c,stroke:#333,color:#000
```

## AS IS / TO BE

No rendered change: nothing renders these components in this PR. The
parity screenshots are on C (#19100, app before/after, pixel-identical)
and D (#19101, billing-web before/after next to the app).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cloud/1.55 Backport PRs for cloud 1.55 core/1.55 Backport PRs for core 1.55 risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants