Skip to content

fix(billing-web): ship the design-system Inter faces in the build - #18685

Merged
dante01yoon merged 1 commit into
mainfrom
fix/billing-web-inter-font
Sep 25, 2026
Merged

dante01yoon merged 1 commit into
mainfrom
fix/billing-web-inter-font

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

billing-web requested /fonts/inter-latin-normal.woff2 (404/503 on testbilling.comfy.org) because the design-system Inter @font-face URLs were never resolved into its build; this bundles them.

Changes

  • What:
    • Why: every billing-web page fired a failing font request, and the CSS carried two competing Inter face sets.
    • Root cause: packages/design-system/src/css/fonts.css declares url('/fonts/inter-latin-*.woff2'), which only the root app serves (from the repo-root public/). billing-web's publicDir has no fonts/, so Vite left the URL unresolved ("didn't resolve at build time") and the Vercel deploy returned an error for it. apps/billing-web/src/styles.css papered over this with its own duplicate faces pointing at ../../../public/fonts, so the broken design-system faces still shipped alongside.
    • How: alias /fonts/ to the repo-root public/fonts/ in apps/billing-web/vite.config.ts so Vite bundles the design-system faces as hashed assets (dev serves them via /@fs), and delete the duplicate faces from styles.css. The built CSS now has exactly two Inter faces, both /assets/inter-latin-*-<hash>.woff2.
    • Test: src/fontAssets.test.ts reads the design-system fonts.css and asserts each url() resolves to a real file through billing-web's Vite resolver. It fails on main (both URLs unresolved) and passes with the alias.

Review Focus

Alias vs. copying the fonts into apps/billing-web/public/fonts: the alias keeps one copy of the binaries and gives them content hashes (covered by the existing /assets/* immutable cache header). Other design-system consumers are untouched.

AS IS / TO BE

AS IS TO BE
AS IS TO BE

The panel in each shot lists every @font-face src read from the page's loaded stylesheets, fetched from the same origin, with its HTTP status.

  • AS IS: https://testbilling.comfy.org (main build). The shipped CSS has four Inter faces. The two design-system faces point at /fonts/inter-latin-{normal,italic}.woff2 and return 404. Inter still renders only because the duplicate faces in styles.css resolve to /assets/.
  • TO BE: this branch, vite build + vite preview on http://localhost:5174 against testcloud. The CSS has exactly two faces, both /assets/inter-latin-*-<hash>.woff2 (200, font/woff2), and the page renders in Inter.

Plan position: Milestone 2 payment-test fixes

Found in the live M2 run (testcloud → testbilling, Team per-credit checkout). None of these PRs depends on another to merge. Solid arrows gate a milestone step; dotted ones are nice-to-have.

PR Defect Dependency
D5 cloud#10518 test-v2 billing-worker uses the wrong Stripe key; every confirm fails parameter_missing client_secret Blocker on test only (config). Unblocks the live re-run.
D4 cloud#10514 preview-subscribe attaches payment_method_configuration_id only when embedded_checked_enabled is on Required before widening hosted_billing_destination past the flag cohort.
D3 FE #18684 billing-web asks for a card on plan changes that need none Independent. Shares e2e fixtures with #18687.
D6 FE #18687 failed-payment UI ignores recovery_action / retryable Independent. Shares e2e fixtures with #18684.
D8 FE #18686 Stripe Element labels invisible in dark theme Independent (cosmetic).
D7 FE #18685 (this PR) billing-web font URL broken (/fonts/inter-*.woff2) Independent (cosmetic).
flowchart LR
  c10518["D5 cloud#10518<br/>test-v2 Stripe key"]
  c10514["D4 cloud#10514<br/>always attach pmc id"]
  f18684["D3 #18684<br/>no card for plan change"]
  f18687["D6 #18687<br/>recovery_action UI"]
  f18686["D8 #18686<br/>dark-theme labels"]
  f18685["D7 #18685<br/>fonts"]
  RERUN(["M2 live payment re-run<br/>testcloud → testbilling"])
  ROLLOUT(["Widen hosted_billing_destination<br/>beyond flag cohort"])
  c10518 --> RERUN
  c10514 --> ROLLOUT
  f18684 --> ROLLOUT
  f18687 --> ROLLOUT
  f18686 -.-> ROLLOUT
  f18685 -.-> ROLLOUT
  RERUN --> ROLLOUT
  f18684 <-. "shared e2e fixtures:<br/>second to merge pulls main" .-> f18687
  style f18685 fill:#f9d71c,stroke:#333,stroke-width:3px,color:#000
Loading

The design-system @font-face rules point at /fonts/*.woff2, which only
the root app's public/ serves. billing-web emitted them unresolved, so
every page requested a 404 font alongside its own duplicate faces.
Alias /fonts/ to the repo's public/fonts so Vite bundles the design-system
faces, and drop the duplicate declarations.
@github-actions

github-actions Bot commented Sep 24, 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 282edd42a8f84c5e1edea6cd745ff94f00fa6f9b

Full docs: ADR-DEVEX-LINT-0015

@coderabbitai

coderabbitai Bot commented Sep 24, 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: c4e58729-d8cd-4819-8a11-8c97a3e37ae1

📥 Commits

Reviewing files that changed from the base of the PR and between 282edd4 and 790fca4.

📒 Files selected for processing (3)
  • apps/billing-web/src/fontAssets.test.ts
  • apps/billing-web/src/styles.css
  • apps/billing-web/vite.config.ts
💤 Files with no reviewable changes (1)
  • apps/billing-web/src/styles.css

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The billing web app now maps /fonts/ URLs to public font assets. It removes local Inter font-face declarations and adds a test that checks the design-system’s expected Inter font URLs resolve to existing files.

Changes

Billing web font assets

Layer / File(s) Summary
Font resolution and validation
apps/billing-web/vite.config.ts, apps/billing-web/src/styles.css, apps/billing-web/src/fontAssets.test.ts
Vite maps /fonts/ URLs to public/fonts/, while preserving the @ alias. The app removes its local Inter font-face declarations. A test checks the design-system font URLs against the two expected Inter files and verifies that each URL resolves to an existing file.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 790fc

No concrete font-loading failure has been established. The change is mergeable after normal build checks.

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
End-To-End Regression Coverage For Fixes ⚠️ Warning The PR uses bug-fix language: the title starts with fix. It changes apps/billing-web/src/fontAssets.test.ts and apps/billing-web/src/styles.css, but no file under browser_tests/. The PR descri… Add or update a Playwright regression test under browser_tests/, or add a concrete explanation in the PR description that states why an end-to-end regression test is not practical.
✅ Passed checks (6 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.
Website End-To-End Regression Coverage ✅ Passed No changed file is under apps/website/src/ or apps/website/public/. The PR changes only apps/billing-web files, so this website-specific check does not apply.
Adr Compliance For Entity/Litegraph Changes ✅ Passed The changed files are limited to billing-web font assets, styles, Vite configuration, and a test. No files under src/lib/litegraph/, src/ecs/, or graph-entity-related files are changed. The ADR compli…
Title check ✅ Passed The title clearly and concisely describes the main change: shipping the design-system Inter font faces in the billing-web build.
Description check ✅ Passed The description includes the required Summary, Changes, and Review Focus sections. It explains the defect, root cause, implementation, test coverage, and review decision. Breaking changes, dependencie…
Full details: End-To-End Regression Coverage For Fixes

Explanation

The PR uses bug-fix language: the title starts with fix. It changes apps/billing-web/src/fontAssets.test.ts and apps/billing-web/src/styles.css, but no file under browser_tests/. The PR description explains the added resolver test, but it does not give a concrete reason why an end-to-end regression test was not added.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main   #18685      +/-   ##
==========================================
+ Coverage   83.77%   84.71%   +0.93%     
==========================================
  Files        3021     2329     -692     
  Lines      149297   132239   -17058     
  Branches    40487    35677    -4810     
==========================================
- Hits       125077   112026   -13051     
+ Misses      22915    19865    -3050     
+ Partials     1305      348     -957     
Flag Coverage Δ
billing-web-unit 87.92% <ø> (ø)
website-unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.
see 699 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 24, 2026
@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 cloud/1.55 Backport PRs for cloud 1.55 labels Sep 25, 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.

Approving at 790fca47. The direction is right — billing-web stops declaring its own faces and instead makes the design system's own URL resolve — and the test is stronger than the one I would have asked for.

  • Deleting the local @font-face blocks removes the duplicate declaration rather than adding a second one, so there is one source of truth for the faces.
  • The durability worry I had is already covered: a design-system font-URL change fails a test instead of silently breaking fonts.
  • Only apps/billing-web is touched, so nothing double-ships into the cloud app's bundle.
Full context for agent readers

What I went looking for. A Vite alias keyed to /^\/fonts\// is only correct for as long as the
design system keeps emitting that exact URL prefix. If it ever moved to /assets/fonts/, the alias
would stop matching, resolution would fall through, and the symptom would be the same broken faces
this PR fixes — with nothing failing in CI to say so.

fontAssets.test.ts closes that properly. It reads @comfyorg/design-system/css/fonts.css and
extracts the URLs the design system actually declares, rather than asserting against a hardcoded
copy, then pins the list. So a prefix change breaks the first assertion loudly. The second case is
the part I would not have thought to ask for: it resolves each extracted URL through this app's real
vite.config.ts in build mode and asserts the target exists on disk, which verifies the alias
end to end without running a build.

The exact-list toEqual also means adding a third face to the design system fails here. That is the
right strictness — a face billing-web does not ship would otherwise 404 at runtime — so it should
stay exact rather than becoming a subset check.

Path check. The deleted @font-face used ../../../public/fonts/ from
apps/billing-web/src/styles.css and the new alias uses ../../public/fonts/ from
apps/billing-web/vite.config.ts. Different depths, same repo-root public/fonts/ target, which is
what the resolver test confirms rather than leaves to inspection.

Scope. The change is confined to billing-web's own stylesheet and Vite config, so the cloud app's
bundle is unaffected and the concern about shipping the faces twice does not arise. Converting
alias from the object form to the array form is required for a regex find and leaves the existing
@ alias behaviour unchanged.

@dante01yoon
dante01yoon added this pull request to the merge queue Sep 25, 2026
pull Bot pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Sep 25, 2026
…overy_action (Comfy-Org#18687)

## Summary

A failed billing operation now shows the next step the server names in
`recovery_action` / `retryable` instead of always offering "Please try
again." + "Try again".

## Why

On https://testbilling.comfy.org checkout, "Pay and subscribe" settled
as
`{"status":"failed","error_message":"parameter_missing","recovery_action":"contact_support","retryable":false}`.
billing-web rendered "Payment could not be processed / Please try again.
/ Something went wrong." plus a **Try again** button. The server said
the attempt cannot be retried and the customer should contact support,
but the UI sent them into a retry loop and gave them no way to reach
support.

## Root cause

`account-core` already carried `recoveryAction` on the
`PaymentProjection`, but nothing read it:

- `paymentCopyKeys` always used `billing.step.<step>.body`. For
`processing_error` that body is "Please try again."
- `CheckoutSteps` (`account-ui`) picked actions only from the step
(`processing_error → ['retry']`). It ignored both `recoveryAction` and
`retryable`.

## How

- `projectPaymentStep` (account-core): a failed operation passes the
server's `recovery_action` through. When the server sends none and marks
the operation `retryable: false`, the projection reads as
`contact_support`.
- `paymentCopy`: adds `billing.recovery.<action>` for every generated
`recovery_action` value (`retry`, `replace_payment_method`,
`authenticate_payment`, `contact_support`). Adds action keys for "Use a
different payment method" and "Contact support". The body line is the
recovery line when the projection names one.
- `CheckoutSteps`: an exhaustive switch over `recoveryAction` picks the
actions. `contact_support` renders a support link (`supportUrl` prop,
default `mailto:support@comfy.org`, the address billing-web already
uses) and no retry button. `retry` and `authenticate_payment` keep "Try
again". `replace_payment_method` shows "Use a different payment method",
which emits `retry` and returns the host to the payment form. With no
recovery action, the actions still come from the step.
- Card declines keep their specific copy through the coded
`decline_reason` (for example `card_declined` → "Your bank declined the
payment."). `error_message` is still never read, as `operationState.ts`
requires. If Cloud reports Stripe decline codes only in `error_message`
and not in `decline_reason`, that is a server contract gap and not
something the UI should parse.

## Tests

- `paymentProjection.test.ts`: covers a server-sent `contact_support`, a
non-retryable failure with no named action falling back to
`contact_support`, and a retryable failure that names no action.
- `paymentCopy.test.ts`: `it.for` over every `recovery_action`, checking
the body key.
- `CheckoutSteps.test.ts`: `it.for` over `retry` /
`replace_payment_method` / `authenticate_payment` (checks the line and
that the button emits `retry`), plus `contact_support` (support link, no
button, no "Please try again.").
- billing-web e2e `checkout.spec.ts`: new scenario using the live
payload. It checks for the support copy and a `mailto:support@comfy.org`
link, and that no "Try again" button appears. The existing decline e2e
is unchanged and still passes.

## AS IS / TO BE

| AS IS | TO BE |
| --- | --- |
| <img width="780" alt="AS IS"
src="https://github.com/user-attachments/assets/9b83283f-30fb-4805-b4c8-44934d680417"
/> | <img width="780" alt="TO BE"
src="https://github.com/user-attachments/assets/bfb9e706-980d-4e78-b0ff-77c7cf7820aa"
/> |

Team workspace checkout on test-v2, Stripe test card 4242 via Magic
fill, "Pay and subscribe" clicked. Subscribe still fails on test-v2 (the
D5 config bug), so both runs end on the failed operation.

- AS IS: https://testbilling.comfy.org (main build) shows "Please try
again." and a **Try again** button.
- TO BE: this branch shows "This payment cannot be retried. Contact
support@comfy.org and we will help you finish it." and a **Contact
support** link (`mailto:support@comfy.org`). No Try again button.
- The TO BE image is the billing-web Playwright e2e run
(`apps/billing-web/e2e/checkout.spec.ts`, mocked Cloud returning
`parameter_missing` with `recovery_action: contact_support`), retaken
after centering the Contact support link. test-v2 subscribe no longer
fails since D5 was fixed, so the failed state cannot be reproduced live
now.

<!-- m2-dep-graph:start -->
## Plan position: Milestone 2 payment-test fixes

Found in the live M2 run (testcloud → testbilling, Team per-credit
checkout). None of these PRs depends on another to merge. Solid arrows
gate a milestone step; dotted ones are nice-to-have.

| PR | Defect | Dependency |
|---|---|---|
| [D5 cloud#10518](Comfy-Org/cloud#10518) |
test-v2 billing-worker uses the wrong Stripe key; every confirm fails
`parameter_missing client_secret` | Blocker on test only (config).
Unblocks the live re-run. |
| [D4 cloud#10514](Comfy-Org/cloud#10514) |
preview-subscribe attaches `payment_method_configuration_id` only when
`embedded_checked_enabled` is on | Required before widening
`hosted_billing_destination` past the flag cohort. |
| [D3 FE
Comfy-Org#18684](Comfy-Org#18684) |
billing-web asks for a card on plan changes that need none |
Independent. Shares e2e fixtures with Comfy-Org#18687. |
| **[D6 FE
Comfy-Org#18687](Comfy-Org#18687) (this
PR)** | failed-payment UI ignores `recovery_action` / `retryable` |
Independent. Shares e2e fixtures with Comfy-Org#18684. |
| [D8 FE
Comfy-Org#18686](Comfy-Org#18686) |
Stripe Element labels invisible in dark theme | Independent (cosmetic).
|
| [D7 FE
Comfy-Org#18685](Comfy-Org#18685) |
billing-web font URL broken (`/fonts/inter-*.woff2`) | Independent
(cosmetic). |

```mermaid
flowchart LR
  c10518["D5 cloud#10518<br/>test-v2 Stripe key"]
  c10514["D4 cloud#10514<br/>always attach pmc id"]
  f18684["D3 Comfy-Org#18684<br/>no card for plan change"]
  f18687["D6 Comfy-Org#18687<br/>recovery_action UI"]
  f18686["D8 Comfy-Org#18686<br/>dark-theme labels"]
  f18685["D7 Comfy-Org#18685<br/>fonts"]
  RERUN(["M2 live payment re-run<br/>testcloud → testbilling"])
  ROLLOUT(["Widen hosted_billing_destination<br/>beyond flag cohort"])
  c10518 --> RERUN
  c10514 --> ROLLOUT
  f18684 --> ROLLOUT
  f18687 --> ROLLOUT
  f18686 -.-> ROLLOUT
  f18685 -.-> ROLLOUT
  RERUN --> ROLLOUT
  f18684 <-. "shared e2e fixtures:<br/>second to merge pulls main" .-> f18687
  style f18687 fill:#f9d71c,stroke:Comfy-Org#333,stroke-width:3px,color:#000
```
<!-- m2-dep-graph:end -->
Merged via the queue into main with commit 97e2859 Sep 25, 2026
116 of 118 checks passed
@dante01yoon
dante01yoon deleted the fix/billing-web-inter-font branch September 25, 2026 04:07
@comfy-pr-bot

Copy link
Copy Markdown
Member

@dante01yoon Successfully backported to #18788

@comfy-pr-bot

Copy link
Copy Markdown
Member

@dante01yoon Successfully backported to #18789

@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 25, 2026
pull Bot pushed a commit to Mu-L/ComfyUI_frontend that referenced this pull request Sep 25, 2026
…rd form (Comfy-Org#18684)

## Summary

`CheckoutView.vue` always mounted `StripePaymentForm`, so any plan
change on an existing subscription that doesn't need a new card (a
scheduled/duration change, or any upgrade/downgrade — Stripe charges the
subscription's saved default method server-side) showed "The payment
form isn't available right now" with "Pay and subscribe" disabled,
blocking the customer entirely.

## Why

A customer on a subscribed Team workspace could not complete a scheduled
plan change on billing-web at all. The page rendered a payment form that
could never succeed, with no way to confirm a change that in fact
required no payment today.

## Root cause

Live testing on testcloud/testbilling: a subscribed Team workspace
(yearly, `team_700` stop) changing to monthly hands off to billing-web's
`/v1/checkout?...&team_credit_stop_id=team_700`. `POST
/api/billing/preview-subscribe` returns `transition_type:
"duration_change"`, `is_immediate: false`, $0 due today, and no
`payment_method_configuration_id`. `CheckoutView.vue` mounted
`StripePaymentForm` unconditionally; that component hard-fails
(`failElementInit()`,
`packages/account-ui/src/billing/stripe/StripePaymentForm.vue:217`)
whenever `paymentMethodConfigurationId` is empty.

The Cloud app already solves this correctly:
`src/platform/workspace/composables/useSubscriptionCheckout.ts`'s
`subscribeAcceptsSavedMethod()` and its accompanying comment state that
"the transition workflows charge the subscription's existing default
method and reject a payment-method selection outright" — any
`transition_type` other than `'new_subscription'` skips card capture and
confirms straight against the saved method.
`SubscriptionTransitionPreviewWorkspace.vue` (confirm-only) vs
`SubscriptionAddPaymentPreviewWorkspace.vue` (card capture) branch on
exactly that field.

## How

`CheckoutView.vue` now branches on `preview.transition_type ===
'new_subscription'` (`needsPaymentMethod`), the same signal the Cloud
app already ships, read straight off the required, non-optional
`transition_type` field — no guessing from
`payment_method_configuration_id`'s presence, which is ambiguous (see
Backend dependency below). When a card is needed, the existing
`StripePaymentForm` path is unchanged, including the 3DS/result flow.
When it isn't, a plain confirm form calls the same
`checkout.subscribe`/`subscribeRequest`, just without a
`confirmation_token` — `zSubscribeRequest.confirmation_token` is already
optional, so no new command was needed.

Test default fixtures (`previewOf()` in `fakeBillingClient.ts`, the e2e
`scenario.preview`) moved from `transition_type: 'upgrade'` to
`'new_subscription'`, since that's what most existing tests actually
exercise (card entry). Tests that specifically cover a transition now
set `transition_type` explicitly. Added table-driven coverage (`it.for`)
for upgrade/downgrade/duration_change confirming without a card form,
and an e2e case in `checkout.spec.ts`. `subscription.spec.ts`'s
"choosing a plan... continues to checkout" test previously asserted the
exact bug ("The payment form isn't available right now" was the
*expected* outcome for an upgrade) — updated to assert the fixed
confirm-only UI instead.

## Backend dependency

Separately, on testcloud a brand-new subscription (`transition_type:
"new_subscription"`, `is_immediate: true`, real cost) can *also* come
back with no `payment_method_configuration_id`, because
`services/ingest/server/implementation/billing.go` only calls
`attachPaymentMethodConfiguration` when the per-user
`embedded_checked_enabled` PostHog flag is on. billing-web always
renders the embedded Stripe form (it has no non-embedded fallback the
way the Cloud app might), so a user outside that flag still hits
"payment form isn't available" on a genuine new-subscription checkout.
This PR doesn't work around that on the frontend — the server needs to
attach the payment method configuration for billing-web requests
unconditionally (or expose an explicit flag), independent of
`embedded_checked_enabled`.

## Changes

- **What**: `CheckoutView.vue` renders a confirm-only path (summary +
button, no Stripe form) when the preview's `transition_type` isn't
`new_subscription`; `subscribeRequest`/`confirm` accept an optional
`confirmationToken`.
- **Dependencies**: none.

## Review Focus

The `transition_type` condition and whether it should live in
`account-ui` instead (kept in `CheckoutView.vue` per
ADR-PACKAGES-ACCOUNT-UI-0034 — it's not Stripe-provider-bound, so
nothing in the ADR forces promotion, and the change stays minimal). The
Backend dependency note above — flagging it, not fixing it here.

## AS IS / TO BE

| AS IS | TO BE |
| --- | --- |
| <img width="780" alt="AS IS"
src="https://github.com/user-attachments/assets/8abf59a9-5b8f-411a-a9c0-c3dad42610c2"
/> | <img width="780" alt="TO BE"
src="https://github.com/user-attachments/assets/3311d71d-ec5b-4606-92ef-8988442bd543"
/> |

Personal Workspace with an active `team_per_credit_annual` / `team_700`
subscription, opening
`/v1/checkout?product=comfyui&return_to=comfyui_workspace&plan=team_per_credit_monthly&team_credit_stop_id=team_700`
against testcloud. `POST /api/billing/preview-subscribe` returns
`transition_type: "duration_change"`, `is_immediate: false`,
`cost_today_cents: 0`.

- AS IS: https://testbilling.comfy.org (main build). The payment section
never renders a card form and "Pay and subscribe" stays disabled (still
disabled after 30s, no Stripe frame mounted). The preview now carries a
`payment_method_configuration_id`, so the "payment form isn't available"
copy from the original report did not show on this run, but the customer
is still blocked.
- TO BE: this branch on http://localhost:5174. Confirm-only form:
summary plus an enabled "Pay and subscribe", no card form. The button
was not clicked, so the subscription was not changed.

- Fixes #ISSUE_NUMBER

<!-- m2-dep-graph:start -->
## Plan position: Milestone 2 payment-test fixes

Found in the live M2 run (testcloud → testbilling, Team per-credit
checkout). None of these PRs depends on another to merge. Solid arrows
gate a milestone step; dotted ones are nice-to-have.

| PR | Defect | Dependency |
|---|---|---|
| [D5 cloud#10518](Comfy-Org/cloud#10518) |
test-v2 billing-worker uses the wrong Stripe key; every confirm fails
`parameter_missing client_secret` | Blocker on test only (config).
Unblocks the live re-run. |
| [D4 cloud#10514](Comfy-Org/cloud#10514) |
preview-subscribe attaches `payment_method_configuration_id` only when
`embedded_checked_enabled` is on | Required before widening
`hosted_billing_destination` past the flag cohort. |
| **[D3 FE
Comfy-Org#18684](Comfy-Org#18684) (this
PR)** | billing-web asks for a card on plan changes that need none |
Independent. Shares e2e fixtures with Comfy-Org#18687. |
| [D6 FE
Comfy-Org#18687](Comfy-Org#18687) |
failed-payment UI ignores `recovery_action` / `retryable` | Independent.
Shares e2e fixtures with Comfy-Org#18684. |
| [D8 FE
Comfy-Org#18686](Comfy-Org#18686) |
Stripe Element labels invisible in dark theme | Independent (cosmetic).
|
| [D7 FE
Comfy-Org#18685](Comfy-Org#18685) |
billing-web font URL broken (`/fonts/inter-*.woff2`) | Independent
(cosmetic). |

```mermaid
flowchart LR
  c10518["D5 cloud#10518<br/>test-v2 Stripe key"]
  c10514["D4 cloud#10514<br/>always attach pmc id"]
  f18684["D3 Comfy-Org#18684<br/>no card for plan change"]
  f18687["D6 Comfy-Org#18687<br/>recovery_action UI"]
  f18686["D8 Comfy-Org#18686<br/>dark-theme labels"]
  f18685["D7 Comfy-Org#18685<br/>fonts"]
  RERUN(["M2 live payment re-run<br/>testcloud → testbilling"])
  ROLLOUT(["Widen hosted_billing_destination<br/>beyond flag cohort"])
  c10518 --> RERUN
  c10514 --> ROLLOUT
  f18684 --> ROLLOUT
  f18687 --> ROLLOUT
  f18686 -.-> ROLLOUT
  f18685 -.-> ROLLOUT
  RERUN --> ROLLOUT
  f18684 <-. "shared e2e fixtures:<br/>second to merge pulls main" .-> f18687
  style f18684 fill:#f9d71c,stroke:#333,stroke-width:3px,color:#000
```
<!-- m2-dep-graph:end -->
laurigates pushed a commit to laurigates/ComfyUI_frontend that referenced this pull request Sep 25, 2026
… scope (Comfy-Org#18686)

## Summary

The Stripe Address and Payment Element labels on the billing-web
checkout were near-invisible (dark gray on the dark panel), and the
input boxes rendered white. Stripe's appearance tokens now come from the
checkout's own dark theme scope.

## Changes

- **What**:
- Why: in dark mode on testbilling.comfy.org, "Full name", "Country or
region", "Address" and the country select text were barely readable, and
the card inputs sat in a white box.
- Root cause: `StripePaymentForm` resolved every appearance color (and
`fontFamily`) on a probe appended to `document.body`. billing-web
applies `.dark-theme` to a wrapper `div`
(`CheckoutView`/`HostedSurface`), not to `body`, so the probe read the
light-theme tokens: `colorText` = charcoal-800, `colorBackground` =
white. The main app was unaffected because its theme class sits above
`body`'s children.
- How: resolve the tokens and font inside the payment element's
container, so they inherit whichever theme scope the form renders in.
The Payment and Address Elements share one `elements()` appearance, so
both stay consistent. Light mode resolves the same tokens as before.
- Test: a new `StripePaymentForm` case renders the form inside a scoped
container whose tokens differ from `body` and asserts Stripe receives
the scoped `colorText`/`colorBackground`. It fails on main (it gets the
body values) and passes with the fix.

## Review Focus

The probe is appended to the payment element's target before Stripe
mounts into it, and removed straight away.

## AS IS / TO BE

| AS IS | TO BE |
| --- | --- |
| <img width="780" alt="AS IS"
src="https://github.com/user-attachments/assets/ca54ed89-db02-439d-be3f-b59237ad015d"
/> | <img width="780" alt="TO BE"
src="https://github.com/user-attachments/assets/d0849ed1-2eca-4af7-82da-698b79df772b"
/> |

Team workspace checkout
(`plan=team_per_credit_monthly&team_credit_stop_id=team_700`) against
testcloud, card and address filled with Stripe Magic fill.

- AS IS: https://testbilling.comfy.org (main build). The Billing address
labels and values ("Jenny Rosen", "United States", "354 Oyster Point
Blvd", …) are dark gray on the dark panel.
- TO BE: this branch on http://localhost:5174. Labels and values read in
the checkout's dark-theme text color, on dark inputs.

<!-- m2-dep-graph:start -->
## Plan position: Milestone 2 payment-test fixes

Found in the live M2 run (testcloud → testbilling, Team per-credit
checkout). None of these PRs depends on another to merge. Solid arrows
gate a milestone step; dotted ones are nice-to-have.

| PR | Defect | Dependency |
|---|---|---|
| [D5 cloud#10518](Comfy-Org/cloud#10518) |
test-v2 billing-worker uses the wrong Stripe key; every confirm fails
`parameter_missing client_secret` | Blocker on test only (config).
Unblocks the live re-run. |
| [D4 cloud#10514](Comfy-Org/cloud#10514) |
preview-subscribe attaches `payment_method_configuration_id` only when
`embedded_checked_enabled` is on | Required before widening
`hosted_billing_destination` past the flag cohort. |
| [D3 FE
Comfy-Org#18684](Comfy-Org#18684) |
billing-web asks for a card on plan changes that need none |
Independent. Shares e2e fixtures with Comfy-Org#18687. |
| [D6 FE
Comfy-Org#18687](Comfy-Org#18687) |
failed-payment UI ignores `recovery_action` / `retryable` | Independent.
Shares e2e fixtures with Comfy-Org#18684. |
| **[D8 FE
Comfy-Org#18686](Comfy-Org#18686) (this
PR)** | Stripe Element labels invisible in dark theme | Independent
(cosmetic). |
| [D7 FE
Comfy-Org#18685](Comfy-Org#18685) |
billing-web font URL broken (`/fonts/inter-*.woff2`) | Independent
(cosmetic). |

```mermaid
flowchart LR
  c10518["D5 cloud#10518<br/>test-v2 Stripe key"]
  c10514["D4 cloud#10514<br/>always attach pmc id"]
  f18684["D3 Comfy-Org#18684<br/>no card for plan change"]
  f18687["D6 Comfy-Org#18687<br/>recovery_action UI"]
  f18686["D8 Comfy-Org#18686<br/>dark-theme labels"]
  f18685["D7 Comfy-Org#18685<br/>fonts"]
  RERUN(["M2 live payment re-run<br/>testcloud → testbilling"])
  ROLLOUT(["Widen hosted_billing_destination<br/>beyond flag cohort"])
  c10518 --> RERUN
  c10514 --> ROLLOUT
  f18684 --> ROLLOUT
  f18687 --> ROLLOUT
  f18686 -.-> ROLLOUT
  f18685 -.-> ROLLOUT
  RERUN --> ROLLOUT
  f18684 <-. "shared e2e fixtures:<br/>second to merge pulls main" .-> f18687
  style f18686 fill:#f9d71c,stroke:Comfy-Org#333,stroke-width:3px,color:#000
```
<!-- m2-dep-graph:end -->
christian-byrne pushed a commit that referenced this pull request Sep 25, 2026
… scope (#18686)

## Summary

The Stripe Address and Payment Element labels on the billing-web
checkout were near-invisible (dark gray on the dark panel), and the
input boxes rendered white. Stripe's appearance tokens now come from the
checkout's own dark theme scope.

## Changes

- **What**:
- Why: in dark mode on testbilling.comfy.org, "Full name", "Country or
region", "Address" and the country select text were barely readable, and
the card inputs sat in a white box.
- Root cause: `StripePaymentForm` resolved every appearance color (and
`fontFamily`) on a probe appended to `document.body`. billing-web
applies `.dark-theme` to a wrapper `div`
(`CheckoutView`/`HostedSurface`), not to `body`, so the probe read the
light-theme tokens: `colorText` = charcoal-800, `colorBackground` =
white. The main app was unaffected because its theme class sits above
`body`'s children.
- How: resolve the tokens and font inside the payment element's
container, so they inherit whichever theme scope the form renders in.
The Payment and Address Elements share one `elements()` appearance, so
both stay consistent. Light mode resolves the same tokens as before.
- Test: a new `StripePaymentForm` case renders the form inside a scoped
container whose tokens differ from `body` and asserts Stripe receives
the scoped `colorText`/`colorBackground`. It fails on main (it gets the
body values) and passes with the fix.

## Review Focus

The probe is appended to the payment element's target before Stripe
mounts into it, and removed straight away.

## AS IS / TO BE

| AS IS | TO BE |
| --- | --- |
| <img width="780" alt="AS IS"
src="https://github.com/user-attachments/assets/ca54ed89-db02-439d-be3f-b59237ad015d"
/> | <img width="780" alt="TO BE"
src="https://github.com/user-attachments/assets/d0849ed1-2eca-4af7-82da-698b79df772b"
/> |

Team workspace checkout
(`plan=team_per_credit_monthly&team_credit_stop_id=team_700`) against
testcloud, card and address filled with Stripe Magic fill.

- AS IS: https://testbilling.comfy.org (main build). The Billing address
labels and values ("Jenny Rosen", "United States", "354 Oyster Point
Blvd", …) are dark gray on the dark panel.
- TO BE: this branch on http://localhost:5174. Labels and values read in
the checkout's dark-theme text color, on dark inputs.

<!-- m2-dep-graph:start -->
## Plan position: Milestone 2 payment-test fixes

Found in the live M2 run (testcloud → testbilling, Team per-credit
checkout). None of these PRs depends on another to merge. Solid arrows
gate a milestone step; dotted ones are nice-to-have.

| PR | Defect | Dependency |
|---|---|---|
| [D5 cloud#10518](Comfy-Org/cloud#10518) |
test-v2 billing-worker uses the wrong Stripe key; every confirm fails
`parameter_missing client_secret` | Blocker on test only (config).
Unblocks the live re-run. |
| [D4 cloud#10514](Comfy-Org/cloud#10514) |
preview-subscribe attaches `payment_method_configuration_id` only when
`embedded_checked_enabled` is on | Required before widening
`hosted_billing_destination` past the flag cohort. |
| [D3 FE
#18684](#18684) |
billing-web asks for a card on plan changes that need none |
Independent. Shares e2e fixtures with #18687. |
| [D6 FE
#18687](#18687) |
failed-payment UI ignores `recovery_action` / `retryable` | Independent.
Shares e2e fixtures with #18684. |
| **[D8 FE
#18686](#18686) (this
PR)** | Stripe Element labels invisible in dark theme | Independent
(cosmetic). |
| [D7 FE
#18685](#18685) |
billing-web font URL broken (`/fonts/inter-*.woff2`) | Independent
(cosmetic). |

```mermaid
flowchart LR
  c10518["D5 cloud#10518<br/>test-v2 Stripe key"]
  c10514["D4 cloud#10514<br/>always attach pmc id"]
  f18684["D3 #18684<br/>no card for plan change"]
  f18687["D6 #18687<br/>recovery_action UI"]
  f18686["D8 #18686<br/>dark-theme labels"]
  f18685["D7 #18685<br/>fonts"]
  RERUN(["M2 live payment re-run<br/>testcloud → testbilling"])
  ROLLOUT(["Widen hosted_billing_destination<br/>beyond flag cohort"])
  c10518 --> RERUN
  c10514 --> ROLLOUT
  f18684 --> ROLLOUT
  f18687 --> ROLLOUT
  f18686 -.-> ROLLOUT
  f18685 -.-> ROLLOUT
  RERUN --> ROLLOUT
  f18684 <-. "shared e2e fixtures:<br/>second to merge pulls main" .-> f18687
  style f18686 fill:#f9d71c,stroke:#333,stroke-width:3px,color:#000
```
<!-- m2-dep-graph:end -->
christian-byrne pushed a commit that referenced this pull request Sep 25, 2026
…8685)

## Summary

billing-web requested `/fonts/inter-latin-normal.woff2` (404/503 on
testbilling.comfy.org) because the design-system Inter `@font-face` URLs
were never resolved into its build; this bundles them.

## Changes

- **What**:
- Why: every billing-web page fired a failing font request, and the CSS
carried two competing Inter face sets.
- Root cause: `packages/design-system/src/css/fonts.css` declares
`url('/fonts/inter-latin-*.woff2')`, which only the root app serves
(from the repo-root `public/`). billing-web's `publicDir` has no
`fonts/`, so Vite left the URL unresolved ("didn't resolve at build
time") and the Vercel deploy returned an error for it.
`apps/billing-web/src/styles.css` papered over this with its own
duplicate faces pointing at `../../../public/fonts`, so the broken
design-system faces still shipped alongside.
- How: alias `/fonts/` to the repo-root `public/fonts/` in
`apps/billing-web/vite.config.ts` so Vite bundles the design-system
faces as hashed assets (dev serves them via `/@fs`), and delete the
duplicate faces from `styles.css`. The built CSS now has exactly two
Inter faces, both `/assets/inter-latin-*-<hash>.woff2`.
- Test: `src/fontAssets.test.ts` reads the design-system `fonts.css` and
asserts each `url()` resolves to a real file through billing-web's Vite
resolver. It fails on main (both URLs unresolved) and passes with the
alias.

## Review Focus

Alias vs. copying the fonts into `apps/billing-web/public/fonts`: the
alias keeps one copy of the binaries and gives them content hashes
(covered by the existing `/assets/*` immutable cache header). Other
design-system consumers are untouched.

## AS IS / TO BE

| AS IS | TO BE |
| --- | --- |
| <img width="780" alt="AS IS"
src="https://github.com/user-attachments/assets/7dbfd8df-bea5-4b1d-9935-7609daabc42a"
/> | <img width="780" alt="TO BE"
src="https://github.com/user-attachments/assets/baf1da1c-5aa0-4dcd-af0b-af6ec0e8cd0d"
/> |

The panel in each shot lists every `@font-face` `src` read from the
page's loaded stylesheets, fetched from the same origin, with its HTTP
status.

- AS IS: https://testbilling.comfy.org (main build). The shipped CSS has
four Inter faces. The two design-system faces point at
`/fonts/inter-latin-{normal,italic}.woff2` and return 404. Inter still
renders only because the duplicate faces in `styles.css` resolve to
`/assets/`.
- TO BE: this branch, `vite build` + `vite preview` on
http://localhost:5174 against testcloud. The CSS has exactly two faces,
both `/assets/inter-latin-*-<hash>.woff2` (200, `font/woff2`), and the
page renders in Inter.

<!-- m2-dep-graph:start -->
## Plan position: Milestone 2 payment-test fixes

Found in the live M2 run (testcloud → testbilling, Team per-credit
checkout). None of these PRs depends on another to merge. Solid arrows
gate a milestone step; dotted ones are nice-to-have.

| PR | Defect | Dependency |
|---|---|---|
| [D5 cloud#10518](Comfy-Org/cloud#10518) |
test-v2 billing-worker uses the wrong Stripe key; every confirm fails
`parameter_missing client_secret` | Blocker on test only (config).
Unblocks the live re-run. |
| [D4 cloud#10514](Comfy-Org/cloud#10514) |
preview-subscribe attaches `payment_method_configuration_id` only when
`embedded_checked_enabled` is on | Required before widening
`hosted_billing_destination` past the flag cohort. |
| [D3 FE
#18684](#18684) |
billing-web asks for a card on plan changes that need none |
Independent. Shares e2e fixtures with #18687. |
| [D6 FE
#18687](#18687) |
failed-payment UI ignores `recovery_action` / `retryable` | Independent.
Shares e2e fixtures with #18684. |
| [D8 FE
#18686](#18686) |
Stripe Element labels invisible in dark theme | Independent (cosmetic).
|
| **[D7 FE
#18685](#18685) (this
PR)** | billing-web font URL broken (`/fonts/inter-*.woff2`) |
Independent (cosmetic). |

```mermaid
flowchart LR
  c10518["D5 cloud#10518<br/>test-v2 Stripe key"]
  c10514["D4 cloud#10514<br/>always attach pmc id"]
  f18684["D3 #18684<br/>no card for plan change"]
  f18687["D6 #18687<br/>recovery_action UI"]
  f18686["D8 #18686<br/>dark-theme labels"]
  f18685["D7 #18685<br/>fonts"]
  RERUN(["M2 live payment re-run<br/>testcloud → testbilling"])
  ROLLOUT(["Widen hosted_billing_destination<br/>beyond flag cohort"])
  c10518 --> RERUN
  c10514 --> ROLLOUT
  f18684 --> ROLLOUT
  f18687 --> ROLLOUT
  f18686 -.-> ROLLOUT
  f18685 -.-> ROLLOUT
  RERUN --> ROLLOUT
  f18684 <-. "shared e2e fixtures:<br/>second to merge pulls main" .-> f18687
  style f18685 fill:#f9d71c,stroke:#333,stroke-width:3px,color:#000
```
<!-- m2-dep-graph:end -->
christian-byrne pushed a commit that referenced this pull request Sep 25, 2026
…rd form (#18684)

## Summary

`CheckoutView.vue` always mounted `StripePaymentForm`, so any plan
change on an existing subscription that doesn't need a new card (a
scheduled/duration change, or any upgrade/downgrade — Stripe charges the
subscription's saved default method server-side) showed "The payment
form isn't available right now" with "Pay and subscribe" disabled,
blocking the customer entirely.

## Why

A customer on a subscribed Team workspace could not complete a scheduled
plan change on billing-web at all. The page rendered a payment form that
could never succeed, with no way to confirm a change that in fact
required no payment today.

## Root cause

Live testing on testcloud/testbilling: a subscribed Team workspace
(yearly, `team_700` stop) changing to monthly hands off to billing-web's
`/v1/checkout?...&team_credit_stop_id=team_700`. `POST
/api/billing/preview-subscribe` returns `transition_type:
"duration_change"`, `is_immediate: false`, $0 due today, and no
`payment_method_configuration_id`. `CheckoutView.vue` mounted
`StripePaymentForm` unconditionally; that component hard-fails
(`failElementInit()`,
`packages/account-ui/src/billing/stripe/StripePaymentForm.vue:217`)
whenever `paymentMethodConfigurationId` is empty.

The Cloud app already solves this correctly:
`src/platform/workspace/composables/useSubscriptionCheckout.ts`'s
`subscribeAcceptsSavedMethod()` and its accompanying comment state that
"the transition workflows charge the subscription's existing default
method and reject a payment-method selection outright" — any
`transition_type` other than `'new_subscription'` skips card capture and
confirms straight against the saved method.
`SubscriptionTransitionPreviewWorkspace.vue` (confirm-only) vs
`SubscriptionAddPaymentPreviewWorkspace.vue` (card capture) branch on
exactly that field.

## How

`CheckoutView.vue` now branches on `preview.transition_type ===
'new_subscription'` (`needsPaymentMethod`), the same signal the Cloud
app already ships, read straight off the required, non-optional
`transition_type` field — no guessing from
`payment_method_configuration_id`'s presence, which is ambiguous (see
Backend dependency below). When a card is needed, the existing
`StripePaymentForm` path is unchanged, including the 3DS/result flow.
When it isn't, a plain confirm form calls the same
`checkout.subscribe`/`subscribeRequest`, just without a
`confirmation_token` — `zSubscribeRequest.confirmation_token` is already
optional, so no new command was needed.

Test default fixtures (`previewOf()` in `fakeBillingClient.ts`, the e2e
`scenario.preview`) moved from `transition_type: 'upgrade'` to
`'new_subscription'`, since that's what most existing tests actually
exercise (card entry). Tests that specifically cover a transition now
set `transition_type` explicitly. Added table-driven coverage (`it.for`)
for upgrade/downgrade/duration_change confirming without a card form,
and an e2e case in `checkout.spec.ts`. `subscription.spec.ts`'s
"choosing a plan... continues to checkout" test previously asserted the
exact bug ("The payment form isn't available right now" was the
*expected* outcome for an upgrade) — updated to assert the fixed
confirm-only UI instead.

## Backend dependency

Separately, on testcloud a brand-new subscription (`transition_type:
"new_subscription"`, `is_immediate: true`, real cost) can *also* come
back with no `payment_method_configuration_id`, because
`services/ingest/server/implementation/billing.go` only calls
`attachPaymentMethodConfiguration` when the per-user
`embedded_checked_enabled` PostHog flag is on. billing-web always
renders the embedded Stripe form (it has no non-embedded fallback the
way the Cloud app might), so a user outside that flag still hits
"payment form isn't available" on a genuine new-subscription checkout.
This PR doesn't work around that on the frontend — the server needs to
attach the payment method configuration for billing-web requests
unconditionally (or expose an explicit flag), independent of
`embedded_checked_enabled`.

## Changes

- **What**: `CheckoutView.vue` renders a confirm-only path (summary +
button, no Stripe form) when the preview's `transition_type` isn't
`new_subscription`; `subscribeRequest`/`confirm` accept an optional
`confirmationToken`.
- **Dependencies**: none.

## Review Focus

The `transition_type` condition and whether it should live in
`account-ui` instead (kept in `CheckoutView.vue` per
ADR-PACKAGES-ACCOUNT-UI-0034 — it's not Stripe-provider-bound, so
nothing in the ADR forces promotion, and the change stays minimal). The
Backend dependency note above — flagging it, not fixing it here.

## AS IS / TO BE

| AS IS | TO BE |
| --- | --- |
| <img width="780" alt="AS IS"
src="https://github.com/user-attachments/assets/8abf59a9-5b8f-411a-a9c0-c3dad42610c2"
/> | <img width="780" alt="TO BE"
src="https://github.com/user-attachments/assets/3311d71d-ec5b-4606-92ef-8988442bd543"
/> |

Personal Workspace with an active `team_per_credit_annual` / `team_700`
subscription, opening
`/v1/checkout?product=comfyui&return_to=comfyui_workspace&plan=team_per_credit_monthly&team_credit_stop_id=team_700`
against testcloud. `POST /api/billing/preview-subscribe` returns
`transition_type: "duration_change"`, `is_immediate: false`,
`cost_today_cents: 0`.

- AS IS: https://testbilling.comfy.org (main build). The payment section
never renders a card form and "Pay and subscribe" stays disabled (still
disabled after 30s, no Stripe frame mounted). The preview now carries a
`payment_method_configuration_id`, so the "payment form isn't available"
copy from the original report did not show on this run, but the customer
is still blocked.
- TO BE: this branch on http://localhost:5174. Confirm-only form:
summary plus an enabled "Pay and subscribe", no card form. The button
was not clicked, so the subscription was not changed.

- Fixes #ISSUE_NUMBER

<!-- m2-dep-graph:start -->
## Plan position: Milestone 2 payment-test fixes

Found in the live M2 run (testcloud → testbilling, Team per-credit
checkout). None of these PRs depends on another to merge. Solid arrows
gate a milestone step; dotted ones are nice-to-have.

| PR | Defect | Dependency |
|---|---|---|
| [D5 cloud#10518](Comfy-Org/cloud#10518) |
test-v2 billing-worker uses the wrong Stripe key; every confirm fails
`parameter_missing client_secret` | Blocker on test only (config).
Unblocks the live re-run. |
| [D4 cloud#10514](Comfy-Org/cloud#10514) |
preview-subscribe attaches `payment_method_configuration_id` only when
`embedded_checked_enabled` is on | Required before widening
`hosted_billing_destination` past the flag cohort. |
| **[D3 FE
#18684](#18684) (this
PR)** | billing-web asks for a card on plan changes that need none |
Independent. Shares e2e fixtures with #18687. |
| [D6 FE
#18687](#18687) |
failed-payment UI ignores `recovery_action` / `retryable` | Independent.
Shares e2e fixtures with #18684. |
| [D8 FE
#18686](#18686) |
Stripe Element labels invisible in dark theme | Independent (cosmetic).
|
| [D7 FE
#18685](#18685) |
billing-web font URL broken (`/fonts/inter-*.woff2`) | Independent
(cosmetic). |

```mermaid
flowchart LR
  c10518["D5 cloud#10518<br/>test-v2 Stripe key"]
  c10514["D4 cloud#10514<br/>always attach pmc id"]
  f18684["D3 #18684<br/>no card for plan change"]
  f18687["D6 #18687<br/>recovery_action UI"]
  f18686["D8 #18686<br/>dark-theme labels"]
  f18685["D7 #18685<br/>fonts"]
  RERUN(["M2 live payment re-run<br/>testcloud → testbilling"])
  ROLLOUT(["Widen hosted_billing_destination<br/>beyond flag cohort"])
  c10518 --> RERUN
  c10514 --> ROLLOUT
  f18684 --> ROLLOUT
  f18687 --> ROLLOUT
  f18686 -.-> ROLLOUT
  f18685 -.-> ROLLOUT
  RERUN --> ROLLOUT
  f18684 <-. "shared e2e fixtures:<br/>second to merge pulls main" .-> f18687
  style f18684 fill:#f9d71c,stroke:#333,stroke-width:3px,color:#000
```
<!-- m2-dep-graph:end -->
christian-byrne pushed a commit that referenced this pull request Sep 25, 2026
…overy_action (#18687)

## Summary

A failed billing operation now shows the next step the server names in
`recovery_action` / `retryable` instead of always offering "Please try
again." + "Try again".

## Why

On https://testbilling.comfy.org checkout, "Pay and subscribe" settled
as
`{"status":"failed","error_message":"parameter_missing","recovery_action":"contact_support","retryable":false}`.
billing-web rendered "Payment could not be processed / Please try again.
/ Something went wrong." plus a **Try again** button. The server said
the attempt cannot be retried and the customer should contact support,
but the UI sent them into a retry loop and gave them no way to reach
support.

## Root cause

`account-core` already carried `recoveryAction` on the
`PaymentProjection`, but nothing read it:

- `paymentCopyKeys` always used `billing.step.<step>.body`. For
`processing_error` that body is "Please try again."
- `CheckoutSteps` (`account-ui`) picked actions only from the step
(`processing_error → ['retry']`). It ignored both `recoveryAction` and
`retryable`.

## How

- `projectPaymentStep` (account-core): a failed operation passes the
server's `recovery_action` through. When the server sends none and marks
the operation `retryable: false`, the projection reads as
`contact_support`.
- `paymentCopy`: adds `billing.recovery.<action>` for every generated
`recovery_action` value (`retry`, `replace_payment_method`,
`authenticate_payment`, `contact_support`). Adds action keys for "Use a
different payment method" and "Contact support". The body line is the
recovery line when the projection names one.
- `CheckoutSteps`: an exhaustive switch over `recoveryAction` picks the
actions. `contact_support` renders a support link (`supportUrl` prop,
default `mailto:support@comfy.org`, the address billing-web already
uses) and no retry button. `retry` and `authenticate_payment` keep "Try
again". `replace_payment_method` shows "Use a different payment method",
which emits `retry` and returns the host to the payment form. With no
recovery action, the actions still come from the step.
- Card declines keep their specific copy through the coded
`decline_reason` (for example `card_declined` → "Your bank declined the
payment."). `error_message` is still never read, as `operationState.ts`
requires. If Cloud reports Stripe decline codes only in `error_message`
and not in `decline_reason`, that is a server contract gap and not
something the UI should parse.

## Tests

- `paymentProjection.test.ts`: covers a server-sent `contact_support`, a
non-retryable failure with no named action falling back to
`contact_support`, and a retryable failure that names no action.
- `paymentCopy.test.ts`: `it.for` over every `recovery_action`, checking
the body key.
- `CheckoutSteps.test.ts`: `it.for` over `retry` /
`replace_payment_method` / `authenticate_payment` (checks the line and
that the button emits `retry`), plus `contact_support` (support link, no
button, no "Please try again.").
- billing-web e2e `checkout.spec.ts`: new scenario using the live
payload. It checks for the support copy and a `mailto:support@comfy.org`
link, and that no "Try again" button appears. The existing decline e2e
is unchanged and still passes.

## AS IS / TO BE

| AS IS | TO BE |
| --- | --- |
| <img width="780" alt="AS IS"
src="https://github.com/user-attachments/assets/9b83283f-30fb-4805-b4c8-44934d680417"
/> | <img width="780" alt="TO BE"
src="https://github.com/user-attachments/assets/bfb9e706-980d-4e78-b0ff-77c7cf7820aa"
/> |

Team workspace checkout on test-v2, Stripe test card 4242 via Magic
fill, "Pay and subscribe" clicked. Subscribe still fails on test-v2 (the
D5 config bug), so both runs end on the failed operation.

- AS IS: https://testbilling.comfy.org (main build) shows "Please try
again." and a **Try again** button.
- TO BE: this branch shows "This payment cannot be retried. Contact
support@comfy.org and we will help you finish it." and a **Contact
support** link (`mailto:support@comfy.org`). No Try again button.
- The TO BE image is the billing-web Playwright e2e run
(`apps/billing-web/e2e/checkout.spec.ts`, mocked Cloud returning
`parameter_missing` with `recovery_action: contact_support`), retaken
after centering the Contact support link. test-v2 subscribe no longer
fails since D5 was fixed, so the failed state cannot be reproduced live
now.

<!-- m2-dep-graph:start -->
## Plan position: Milestone 2 payment-test fixes

Found in the live M2 run (testcloud → testbilling, Team per-credit
checkout). None of these PRs depends on another to merge. Solid arrows
gate a milestone step; dotted ones are nice-to-have.

| PR | Defect | Dependency |
|---|---|---|
| [D5 cloud#10518](Comfy-Org/cloud#10518) |
test-v2 billing-worker uses the wrong Stripe key; every confirm fails
`parameter_missing client_secret` | Blocker on test only (config).
Unblocks the live re-run. |
| [D4 cloud#10514](Comfy-Org/cloud#10514) |
preview-subscribe attaches `payment_method_configuration_id` only when
`embedded_checked_enabled` is on | Required before widening
`hosted_billing_destination` past the flag cohort. |
| [D3 FE
#18684](#18684) |
billing-web asks for a card on plan changes that need none |
Independent. Shares e2e fixtures with #18687. |
| **[D6 FE
#18687](#18687) (this
PR)** | failed-payment UI ignores `recovery_action` / `retryable` |
Independent. Shares e2e fixtures with #18684. |
| [D8 FE
#18686](#18686) |
Stripe Element labels invisible in dark theme | Independent (cosmetic).
|
| [D7 FE
#18685](#18685) |
billing-web font URL broken (`/fonts/inter-*.woff2`) | Independent
(cosmetic). |

```mermaid
flowchart LR
  c10518["D5 cloud#10518<br/>test-v2 Stripe key"]
  c10514["D4 cloud#10514<br/>always attach pmc id"]
  f18684["D3 #18684<br/>no card for plan change"]
  f18687["D6 #18687<br/>recovery_action UI"]
  f18686["D8 #18686<br/>dark-theme labels"]
  f18685["D7 #18685<br/>fonts"]
  RERUN(["M2 live payment re-run<br/>testcloud → testbilling"])
  ROLLOUT(["Widen hosted_billing_destination<br/>beyond flag cohort"])
  c10518 --> RERUN
  c10514 --> ROLLOUT
  f18684 --> ROLLOUT
  f18687 --> ROLLOUT
  f18686 -.-> ROLLOUT
  f18685 -.-> ROLLOUT
  RERUN --> ROLLOUT
  f18684 <-. "shared e2e fixtures:<br/>second to merge pulls main" .-> f18687
  style f18687 fill:#f9d71c,stroke:#333,stroke-width:3px,color:#000
```
<!-- m2-dep-graph:end -->
comfy-pr-bot added a commit that referenced this pull request Sep 25, 2026
…faces in the build (#18789)

Backport of #18685 to `cloud/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 25, 2026
…aces in the build (#18788)

Backport of #18685 to `core/1.55`

Automatically created by backport workflow.

Co-authored-by: Dante <bunggl@naver.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