Skip to content

FE-2331 / FE-2218 feat(billing-web): v1 entry routing, subscription and payment-method surfaces - #17809

Merged
dante01yoon merged 3 commits into
jaewon/fe-2218-billing-web-sessionfrom
jaewon/fe-2331-billing-web-hosted-views
Sep 16, 2026
Merged

dante01yoon merged 3 commits into
jaewon/fe-2218-billing-web-sessionfrom
jaewon/fe-2331-billing-web-hosted-views

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Linear FE-2331 / FE-2218.

Stacked on #17807 (session); carries a cherry-pick of #17795 (billing-contract).

Why

billing.comfy.org currently serves one static page: a hard-coded checkout mockup at /. Nothing reads the entry URL a product hands it, and nothing renders over the billing SDK. This PR gives the hosted app its /v1 entry routing plus the first two surfaces that project real SDK state — the subscription catalog with a plan-change quote, and saved payment methods with the provider portal round trip.

The entry URL is untrusted routing input. parseBillingEntry decides whether it describes a request the contract knows, and a failed parse renders a coded explanation rather than a redirect, so a misdirected link stays visible instead of silently landing the customer somewhere else.

How

  • router.ts generates a route per BILLING_INTENTS entry — subscription and pricing to SubscriptionView, payment-methods to PaymentMethodsView, checkout to the existing BillingHomeView (unchanged), invoices and result to ComingSoonView. / keeps the scaffold checkout page and stays outside the contract.
  • A beforeEach parses to.fullPath and publishes the result into a tab-local module ref (useBillingEntry); App.vue renders the entry-error surface whenever that parse failed, whatever route matched. No navigation happens on an error.
  • The entry is read before the session guard from FE-2218 feat(billing-web): own-origin session, sign-in and the billing SDK composition #17807 runs, so a link we cannot read explains itself even to a visitor the guard sends to /sign-in: signing in would not repair it. / and /sign-in carry no product request and leave the entry alone.
  • HostedSurface.vue is the shared shell: the dark full-screen layout, the surface title, the Return to <product> link built with buildReturnUrl against the resolved BILLING_WEB_ENV (default and fail-closed value test), and the choice between the entry-error section and the surface itself. Views stay pure projections of composable state, and a surface only ever renders behind the guard and the shell, which always provide a client.
  • SubscriptionPanel reads usePlans(), renders each plan as a card (tier + duration, price, monthly credits, seats), disables an unavailable plan with its availability reason as our own copy, and on selection calls usePreviewSubscribe().quote({ planSlug }) and renders the quote. Confirm is present and disabled behind the scaffold's existing checkout.sdkPending line.
  • PaymentMethodsPanel reads usePaymentMethods(), marks the default card, and opens the provider portal through commands.openPaymentPortal with this page's own href plus a portal=return marker. On the way back it invalidates and re-reads once, then strips the marker with router.replace.
  • Every server-chosen value reaches the screen as a coded lookup with a generic fallback: availability reasons, transition types, billing failure codes, entry error codes, saved payment method types. The card brand and its last four digits are the one server-supplied pair the UI interpolates; no other server text is rendered.
  • bigint money fields convert with Number() only at the n()/d() formatting boundary.

AS-IS / TO-BE

AS-IS: a /v1/subscription link has no surface of its own — the catch-all redirects it to /, the scaffold's static checkout mockup, and the product's entry parameters are dropped on the way.

TO-BE: /v1/subscription renders the catalog with the current plan marked and an unavailable plan explained, selecting a plan adds the server's plan-change quote with an inert confirm, /v1/payment-methods lists saved cards with the default marked beside the provider-portal button, and a link the contract cannot read gets a coded explanation instead of a redirect.

AS-IS TO-BE
/v1/subscription?product=comfyui&return_to=comfyui_workspace redirects to the static checkout page
The same link renders the subscription surface
TO-BE — plan-change quote after selecting Pro · Monthly
TO-BE — /v1/payment-methods with the default card marked
— TO-BE — a link the contract cannot read (/v1/subscription?product=nope)

Testing

apps/billing-web unit tests (@testing-library/vue, happy-dom): the app suite is 85 passing, 44 of them in the four files this PR touches:

  • router.test.ts — each intent opens its surface, the parsed entry is published, every entry-error code renders its own copy (including on the checkout route, proving the error surface wins over the matched route), an unrecognised path stays where it is, and / remains outside the contract. The guard rows from FE-2218 feat(billing-web): own-origin session, sign-in and the billing SDK composition #17807 join the same file: a signed-out visitor is sent to /sign-in with the surface to come back to, and an unreadable link keeps its error through that redirect.
  • SubscriptionView.test.ts — current plan named, catalog priced, an unavailable plan disabled with its reason, selecting a plan calls previewSubscribe with { planSlug } and renders the formatted quote with confirm disabled, a refused quote and a failed catalog read both render coded copy.
  • PaymentMethodsView.test.ts — cards listed with the default marked, the portal button navigates to the returned URL, and portal=return triggers exactly one invalidate plus one read before the marker is stripped.
  • HostedSurface.test.ts — the arriving intent's content renders, return link href from buildReturnUrl, no link when the entry named no destination.

Gates: pnpm typecheck, pnpm lint, pnpm format, pnpm knip, pnpm --filter @comfyorg/billing-web build, fallow audit all pass.

Not in this PR

  • Subscribing through the SDK — the confirm button is deliberately inert.
  • Invoices, which wait on the backend.
  • Putting apps/billing-web unit tests in the CI loop: ci-tests-unit.yaml runs packages/* only, so this suite runs locally but not on a PR. Follow-up.

Where this sits in the plan

Billing SDK track FE-2210 (implementation plan V2). Hybrid model: top-up in-app, subscription management / invoices / payment methods on the hosted billing app.

Phase Item Ticket Status
1-2 Session core, transport, readers FE-2211/2212/2213 merged
3 Operation lifecycle, commands, eight-state projection FE-2227/2214/2223 merged (#17655)
4 @comfyorg/account-ui composables + CheckoutSteps FE-2215 merged (#17662, #17663)
5 slice 1 Top-up through the SDK behind billing_sdk_topup_enabled FE-2216 merged (#17665)
rollout C hosted_billing_destination server flag read by the host FE-2218 merged (#17716)
rollout C hostedDestination port on the lifecycle, value on operation state FE-2210/2218 open (#17783)
7 prep Scope-source port + credentialed transport (BFF / cookie hosts) FE-2218 open (#17782)
7 prep @comfyorg/account → @comfyorg/account-core rename FE-2218 local, opens after #17782 and #17783
7 prep billing-contract route builder + return_to registry FE-2218 open (#17795)
3A-3 Workshop adapter over createHostedTopupCheckout FE-2214 open (#17793)
8 core previewSubscribe command FE-2331 open (#17797)
8 core Plans + saved payment-methods readers FE-2331 open (#17798)
8 ui account-ui composables (usePlans, usePaymentMethods, usePreviewSubscribe) FE-2331 open (#17799)
7 billing-web own-origin session, sign-in, SDK composition FE-2218 open (#17807)
8 ui billing-web /v1 entry routing + subscription / payment-method surfaces FE-2331 this PR
7 npm publish (ingest-types, account-core, billing-contract), Platform install, billing-web live top-up FE-2218 todo
6 Contract tests + live E2E per flow × consumer FE-2217 todo
5 slice 2 Subscription flows through the SDK FE-2216 todo (plan-change decision)
follow-up One needsCustomerAttention predicate (from the #17665 review) FE-2216 open (#17792)
follow-up Opaque BillingServerCode (from the #17656 review) FE-2227 open (#17794)
flowchart LR
  P3["Phase 3 core lifecycle (merged)"]
  P4["Phase 4 account-ui (merged)"]
  P5["Phase 5 slice 1 top-up flag (merged)"]
  FC["PR 17716 hosted_billing_destination flag (merged)"]
  HD["PR 17783 hostedDestination port"]
  SS["PR 17782 scope-source port + credentialed transport"]
  RN["account-core rename"]
  RB["billing-contract route builder + return_to"]
  WS["Workshop adapter"]
  P8PV["previewSubscribe command"]
  P8RD["plans + payment-methods readers"]
  P8["account-ui hosted composables"]
  BWS["billing-web session + sign-in"]
  BWV["billing-web /v1 surfaces"]
  PUB["npm publish account-core / billing-contract"]
  P7["Phase 7 host proof: Platform + billing-web live"]
  P6["Phase 6 evidence"]
  S2["Phase 5 slice 2 subscription"]
  FU9["customer-attention predicate"]
  FU11["opaque BillingServerCode"]
  P3 --> HD
  FC --> HD
  HD --> RB
  P3 --> SS
  SS --> P7
  RB --> P7
  P3 --> RN
  RN --> PUB
  RB --> PUB
  PUB --> P7
  P3 --> P8PV
  P3 --> P8RD
  P8PV --> P8
  P8RD --> P8
  P4 --> P8
  P8 --> S2
  P8 --> BWS
  BWS --> BWV
  RB --> BWV
  BWV --> P7
  P5 --> P6
  P5 --> WS
  P5 --> FU9
  P3 --> FU11
  style P3 fill:#d4edda,stroke:#155724
  style P4 fill:#d4edda,stroke:#155724
  style P5 fill:#d4edda,stroke:#155724
  style FC fill:#d4edda,stroke:#155724
  style BWV stroke:#0366d6,stroke-width:4px
Loading

@dante01yoon dante01yoon added needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch core/1.54 Backport PRs for core 1.54 cloud/1.54 Backport PRs for cloud 1.54 labels Sep 16, 2026
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ec7d4afe-2b44-4472-b97b-3da124b4ef9a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 09/16/2026, 04:44:51 AM UTC

Links

🎭 Playwright: ✅ 2017 passed, 0 failed · 1 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1996 / ❌ 0 / ⚠️ 1 / ⏭️ 13)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 58.7 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 61.3 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 61.7 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 76.4 MB heap
large-graph-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 79.3 MB heap
large-graph-pan: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 84.3 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 68.7 MB heap
legacy-node-drag: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 81.7 MB heap
minimap-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 80.4 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 73.3 MB heap
subgraph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 62.3 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.4 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 142ms TBT · 77.0 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 82.1 MB heap
vue-large-graph-idle: · 56.3 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 162.8 MB heap
vue-large-graph-pan: · 57.1 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 103ms TBT · 164.1 MB heap
vue-node-resize-workload: · 56.3 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 354ms TBT · 167.6 MB heap
vue-zoom-out-idle: · 56.3 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 165.3 MB heap
workflow-execution: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 63.1 MB heap

ℹ️ No baseline found — significance unavailable.

Absolute values
Metric Value
canvas-idle: avg frame time 17ms
canvas-idle: p95 frame time 17ms
canvas-idle: layout duration 0ms
canvas-idle: style recalc duration 7ms
canvas-idle: layout count 0
canvas-idle: style recalc count 9
canvas-idle: task duration 442ms
canvas-idle: script duration 7ms
canvas-idle: TBT 0ms
canvas-idle: heap used 58.7 MB
canvas-idle: DOM nodes -264
canvas-idle: event listeners -154
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 4ms
canvas-mouse-sweep: style recalc duration 25ms
canvas-mouse-sweep: layout count 14
canvas-mouse-sweep: style recalc count 75
canvas-mouse-sweep: task duration 817ms
canvas-mouse-sweep: script duration 159ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 61.3 MB
canvas-mouse-sweep: DOM nodes -261
canvas-mouse-sweep: event listeners -171
canvas-zoom-sweep: avg frame time 17ms
canvas-zoom-sweep: p95 frame time 17ms
canvas-zoom-sweep: layout duration 1ms
canvas-zoom-sweep: style recalc duration 16ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 32
canvas-zoom-sweep: task duration 340ms
canvas-zoom-sweep: script duration 10ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 61.7 MB
canvas-zoom-sweep: DOM nodes 77
canvas-zoom-sweep: event listeners 19
dom-widget-clipping: avg frame time 17ms
dom-widget-clipping: p95 frame time 17ms
dom-widget-clipping: layout duration 0ms
dom-widget-clipping: style recalc duration 7ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 10
dom-widget-clipping: task duration 455ms
dom-widget-clipping: script duration 171ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 76.4 MB
dom-widget-clipping: DOM nodes 16
dom-widget-clipping: event listeners 2
large-graph-idle: avg frame time 17ms
large-graph-idle: p95 frame time 17ms
large-graph-idle: layout duration 0ms
large-graph-idle: style recalc duration 5ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 6
large-graph-idle: task duration 571ms
large-graph-idle: script duration 33ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 79.3 MB
large-graph-idle: DOM nodes -247
large-graph-idle: event listeners -153
large-graph-pan: avg frame time 17ms
large-graph-pan: p95 frame time 17ms
large-graph-pan: layout duration 0ms
large-graph-pan: style recalc duration 11ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 67
large-graph-pan: task duration 1608ms
large-graph-pan: script duration 875ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 84.3 MB
large-graph-pan: DOM nodes -239
large-graph-pan: event listeners -182
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 13ms
large-graph-zoom: style recalc duration 12ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 63
large-graph-zoom: task duration 1738ms
large-graph-zoom: script duration 820ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 68.7 MB
large-graph-zoom: DOM nodes -132
large-graph-zoom: event listeners -89
legacy-node-drag: avg frame time 17ms
legacy-node-drag: p95 frame time 17ms
legacy-node-drag: layout duration 0ms
legacy-node-drag: style recalc duration 6ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 42
legacy-node-drag: task duration 1969ms
legacy-node-drag: script duration 1007ms
legacy-node-drag: TBT 0ms
legacy-node-drag: heap used 81.7 MB
legacy-node-drag: DOM nodes -133
legacy-node-drag: event listeners 94
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 4ms
minimap-idle: layout count 0
minimap-idle: style recalc count 5
minimap-idle: task duration 539ms
minimap-idle: script duration 34ms
minimap-idle: TBT 0ms
minimap-idle: heap used 80.4 MB
minimap-idle: DOM nodes -252
minimap-idle: event listeners -153
subgraph-dom-widget-clipping: avg frame time 17ms
subgraph-dom-widget-clipping: p95 frame time 17ms
subgraph-dom-widget-clipping: layout duration 0ms
subgraph-dom-widget-clipping: style recalc duration 10ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 47
subgraph-dom-widget-clipping: task duration 403ms
subgraph-dom-widget-clipping: script duration 143ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 73.3 MB
subgraph-dom-widget-clipping: DOM nodes 19
subgraph-dom-widget-clipping: event listeners 8
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 7ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 9
subgraph-idle: task duration 428ms
subgraph-idle: script duration 7ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 62.3 MB
subgraph-idle: DOM nodes -129
subgraph-idle: event listeners -98
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 5ms
subgraph-mouse-sweep: style recalc duration 27ms
subgraph-mouse-sweep: layout count 18
subgraph-mouse-sweep: style recalc count 77
subgraph-mouse-sweep: task duration 777ms
subgraph-mouse-sweep: script duration 112ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 65.4 MB
subgraph-mouse-sweep: DOM nodes -276
subgraph-mouse-sweep: event listeners -202
subgraph-transition-enter: avg frame time 17ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 13ms
subgraph-transition-enter: style recalc duration 29ms
subgraph-transition-enter: layout count 5
subgraph-transition-enter: style recalc count 16
subgraph-transition-enter: task duration 885ms
subgraph-transition-enter: script duration 30ms
subgraph-transition-enter: TBT 142ms
subgraph-transition-enter: heap used 77.0 MB
subgraph-transition-enter: DOM nodes 13587
subgraph-transition-enter: event listeners 2385
viewport-pan-sweep: avg frame time 17ms
viewport-pan-sweep: p95 frame time 17ms
viewport-pan-sweep: layout duration 0ms
viewport-pan-sweep: style recalc duration 35ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 248
viewport-pan-sweep: task duration 5812ms
viewport-pan-sweep: script duration 2802ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 82.1 MB
viewport-pan-sweep: DOM nodes -236
viewport-pan-sweep: event listeners -153
vue-large-graph-idle: avg frame time 18ms
vue-large-graph-idle: p95 frame time 17ms
vue-large-graph-idle: layout duration 0ms
vue-large-graph-idle: style recalc duration 0ms
vue-large-graph-idle: layout count 0
vue-large-graph-idle: style recalc count 0
vue-large-graph-idle: task duration 16094ms
vue-large-graph-idle: script duration 271ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 162.8 MB
vue-large-graph-idle: DOM nodes -6542
vue-large-graph-idle: event listeners -7478
vue-large-graph-pan: avg frame time 18ms
vue-large-graph-pan: p95 frame time 17ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 17ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 172
vue-large-graph-pan: task duration 20032ms
vue-large-graph-pan: script duration 877ms
vue-large-graph-pan: TBT 103ms
vue-large-graph-pan: heap used 164.1 MB
vue-large-graph-pan: DOM nodes -6542
vue-large-graph-pan: event listeners -7474
vue-node-resize-workload: avg frame time 18ms
vue-node-resize-workload: p95 frame time 17ms
vue-node-resize-workload: layout duration 22ms
vue-node-resize-workload: style recalc duration 79ms
vue-node-resize-workload: layout count 20
vue-node-resize-workload: style recalc count 20
vue-node-resize-workload: task duration 5795ms
vue-node-resize-workload: script duration 108ms
vue-node-resize-workload: TBT 354ms
vue-node-resize-workload: heap used 167.6 MB
vue-node-resize-workload: DOM nodes -6542
vue-node-resize-workload: event listeners -7475
vue-zoom-out-idle: avg frame time 18ms
vue-zoom-out-idle: p95 frame time 17ms
vue-zoom-out-idle: layout duration 0ms
vue-zoom-out-idle: style recalc duration 0ms
vue-zoom-out-idle: layout count 0
vue-zoom-out-idle: style recalc count 0
vue-zoom-out-idle: task duration 7995ms
vue-zoom-out-idle: script duration 123ms
vue-zoom-out-idle: TBT 0ms
vue-zoom-out-idle: heap used 165.3 MB
vue-zoom-out-idle: DOM nodes -1
vue-zoom-out-idle: event listeners -12
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 2ms
workflow-execution: style recalc duration 21ms
workflow-execution: layout count 4
workflow-execution: style recalc count 15
workflow-execution: task duration 105ms
workflow-execution: script duration 9ms
workflow-execution: TBT 0ms
workflow-execution: heap used 63.1 MB
workflow-execution: DOM nodes 142
workflow-execution: event listeners 59
Raw data
{
  "timestamp": "2026-09-16T04:54:38.075Z",
  "gitSha": "b447cb6bb73436d60d6bf335bd38198b35ee3b7d",
  "branch": "jaewon/fe-2331-billing-web-hosted-views",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 1999.9350000000504,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 6.957999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 441.651,
      "heapDeltaBytes": 4601504,
      "heapUsedBytes": 67075308,
      "domNodes": -264,
      "jsHeapTotalBytes": 4448256,
      "scriptDurationMs": 7.199000000000001,
      "eventListeners": -154,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-idle",
      "durationMs": 2017.7080000000274,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 7.388999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 441.60900000000004,
      "heapDeltaBytes": -6388340,
      "heapUsedBytes": 55958048,
      "domNodes": -264,
      "jsHeapTotalBytes": 4972544,
      "scriptDurationMs": 7.166000000000002,
      "eventListeners": -154,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1771.7719999999986,
      "styleRecalcs": 74,
      "styleRecalcDurationMs": 24.386,
      "layouts": 14,
      "layoutDurationMs": 3.6700000000000004,
      "taskDurationMs": 799.581,
      "heapDeltaBytes": -4622692,
      "heapUsedBytes": 57898832,
      "domNodes": -261,
      "jsHeapTotalBytes": 6545408,
      "scriptDurationMs": 153.35,
      "eventListeners": -186,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1812.6140000000532,
      "styleRecalcs": 75,
      "styleRecalcDurationMs": 25.740000000000002,
      "layouts": 14,
      "layoutDurationMs": 4,
      "taskDurationMs": 833.675,
      "heapDeltaBytes": 8659580,
      "heapUsedBytes": 70714032,
      "domNodes": -261,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 165.093,
      "eventListeners": -156,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1724.2789999999673,
      "styleRecalcs": 31,
      "styleRecalcDurationMs": 17.922,
      "layouts": 6,
      "layoutDurationMs": 1.271,
      "taskDurationMs": 358.159,
      "heapDeltaBytes": 2076436,
      "heapUsedBytes": 64692852,
      "domNodes": 76,
      "jsHeapTotalBytes": 5242880,
      "scriptDurationMs": 11.576000000000002,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66999999999998,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1736.786000000052,
      "styleRecalcs": 32,
      "styleRecalcDurationMs": 14.732999999999999,
      "layouts": 6,
      "layoutDurationMs": 1.1089999999999998,
      "taskDurationMs": 320.859,
      "heapDeltaBytes": 2174108,
      "heapUsedBytes": 64716276,
      "domNodes": 77,
      "jsHeapTotalBytes": 4456448,
      "scriptDurationMs": 9.332999999999998,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 737.5349999999798,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 6.204999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 469.408,
      "heapDeltaBytes": 17626520,
      "heapUsedBytes": 79970252,
      "domNodes": 14,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 175.326,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 628.5110000000032,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 7.488999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 441.06500000000005,
      "heapDeltaBytes": 17911504,
      "heapUsedBytes": 80352164,
      "domNodes": 18,
      "jsHeapTotalBytes": 6029312,
      "scriptDurationMs": 166.865,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2025.5460000000198,
      "styleRecalcs": 6,
      "styleRecalcDurationMs": 5.389000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 585.5319999999999,
      "heapDeltaBytes": 2568452,
      "heapUsedBytes": 82762240,
      "domNodes": -245,
      "jsHeapTotalBytes": -794624,
      "scriptDurationMs": 33.025,
      "eventListeners": -154,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2035.1030000000492,
      "styleRecalcs": 5,
      "styleRecalcDurationMs": 4.245000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 556.149,
      "heapDeltaBytes": 4203780,
      "heapUsedBytes": 83597540,
      "domNodes": -249,
      "jsHeapTotalBytes": -1056768,
      "scriptDurationMs": 32.35700000000001,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2360.892999999976,
      "styleRecalcs": 66,
      "styleRecalcDurationMs": 11.200000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1700.587,
      "heapDeltaBytes": -1314288,
      "heapUsedBytes": 79681272,
      "domNodes": -252,
      "jsHeapTotalBytes": 1003520,
      "scriptDurationMs": 869.106,
      "eventListeners": -182,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2244.521999999961,
      "styleRecalcs": 67,
      "styleRecalcDurationMs": 11.732,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1515.4279999999999,
      "heapDeltaBytes": 16553436,
      "heapUsedBytes": 97113628,
      "domNodes": -225,
      "jsHeapTotalBytes": 1265664,
      "scriptDurationMs": 881.1289999999999,
      "eventListeners": -182,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3586.856999999952,
      "styleRecalcs": 63,
      "styleRecalcDurationMs": 13.416,
      "layouts": 60,
      "layoutDurationMs": 13.315,
      "taskDurationMs": 1769.9180000000001,
      "heapDeltaBytes": -13997600,
      "heapUsedBytes": 68298864,
      "domNodes": -268,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 805.785,
      "eventListeners": -186,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3533.3140000000185,
      "styleRecalcs": 62,
      "styleRecalcDurationMs": 10.287999999999998,
      "layouts": 60,
      "layoutDurationMs": 12.355,
      "taskDurationMs": 1706.515,
      "heapDeltaBytes": 9424660,
      "heapUsedBytes": 75857420,
      "domNodes": 4,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 834.802,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3131.473000000028,
      "styleRecalcs": 40,
      "styleRecalcDurationMs": 4.926,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1944.1680000000001,
      "heapDeltaBytes": 22738392,
      "heapUsedBytes": 89010424,
      "domNodes": 0,
      "jsHeapTotalBytes": 417792,
      "scriptDurationMs": 987.667,
      "eventListeners": 188,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3153.628000000026,
      "styleRecalcs": 43,
      "styleRecalcDurationMs": 8.048,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1994.5089999999998,
      "heapDeltaBytes": -1260644,
      "heapUsedBytes": 82357604,
      "domNodes": -266,
      "jsHeapTotalBytes": 1458176,
      "scriptDurationMs": 1026.346,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2024.9310000000378,
      "styleRecalcs": 4,
      "styleRecalcDurationMs": 3.4870000000000005,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 555.006,
      "heapDeltaBytes": -3671072,
      "heapUsedBytes": 83877676,
      "domNodes": -254,
      "jsHeapTotalBytes": -1019904,
      "scriptDurationMs": 34.452,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "minimap-idle",
      "durationMs": 2010.2749999999787,
      "styleRecalcs": 5,
      "styleRecalcDurationMs": 4.036999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 523.377,
      "heapDeltaBytes": 20099296,
      "heapUsedBytes": 84677480,
      "domNodes": -249,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 33.10399999999999,
      "eventListeners": -154,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 607.2769999999537,
      "styleRecalcs": 46,
      "styleRecalcDurationMs": 9.569999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 408.526,
      "heapDeltaBytes": 13357396,
      "heapUsedBytes": 76865444,
      "domNodes": 18,
      "jsHeapTotalBytes": 5242880,
      "scriptDurationMs": 143.262,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 597.6930000000493,
      "styleRecalcs": 47,
      "styleRecalcDurationMs": 11.075999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 397.56600000000003,
      "heapDeltaBytes": 13473332,
      "heapUsedBytes": 76917812,
      "domNodes": 20,
      "jsHeapTotalBytes": 5767168,
      "scriptDurationMs": 143.43,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-idle",
      "durationMs": 1996.5380000000437,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 5.9559999999999995,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 399.92900000000003,
      "heapDeltaBytes": -1812192,
      "heapUsedBytes": 61307004,
      "domNodes": 16,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 6.700000000000001,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2004.6939999999722,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 7.993000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 457.03499999999997,
      "heapDeltaBytes": 5497860,
      "heapUsedBytes": 69249968,
      "domNodes": -274,
      "jsHeapTotalBytes": 4972544,
      "scriptDurationMs": 6.6480000000000015,
      "eventListeners": -200,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1688.5879999999815,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 28.223,
      "layouts": 18,
      "layoutDurationMs": 5.558000000000001,
      "taskDurationMs": 804.2320000000001,
      "heapDeltaBytes": 4662356,
      "heapUsedBytes": 68392328,
      "domNodes": -274,
      "jsHeapTotalBytes": 5234688,
      "scriptDurationMs": 117.19900000000001,
      "eventListeners": -202,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1708.9000000000851,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 25.245,
      "layouts": 18,
      "layoutDurationMs": 5.286,
      "taskDurationMs": 750.418,
      "heapDeltaBytes": 5188900,
      "heapUsedBytes": 68782136,
      "domNodes": -277,
      "jsHeapTotalBytes": 6283264,
      "scriptDurationMs": 107.49000000000001,
      "eventListeners": -202,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 1401.2749999999983,
      "styleRecalcs": 16,
      "styleRecalcDurationMs": 29.358999999999995,
      "layouts": 5,
      "layoutDurationMs": 13.139000000000001,
      "taskDurationMs": 885.3269999999998,
      "heapDeltaBytes": -6399304,
      "heapUsedBytes": 80710948,
      "domNodes": 13587,
      "jsHeapTotalBytes": 10747904,
      "scriptDurationMs": 30.275000000000002,
      "eventListeners": 2385,
      "totalBlockingTimeMs": 142,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8473.144999999988,
      "styleRecalcs": 248,
      "styleRecalcDurationMs": 36.687,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 6001.929999999999,
      "heapDeltaBytes": 13565336,
      "heapUsedBytes": 92421272,
      "domNodes": -224,
      "jsHeapTotalBytes": 1265664,
      "scriptDurationMs": 2860.073,
      "eventListeners": -168,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333338,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8285.582999999973,
      "styleRecalcs": 247,
      "styleRecalcDurationMs": 32.580999999999996,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5621.891,
      "heapDeltaBytes": 384640,
      "heapUsedBytes": 79702272,
      "domNodes": -247,
      "jsHeapTotalBytes": -45056,
      "scriptDurationMs": 2744.4729999999995,
      "eventListeners": -138,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 17422.61100000002,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 16880.486,
      "heapDeltaBytes": -13677408,
      "heapUsedBytes": 180188520,
      "domNodes": -6542,
      "jsHeapTotalBytes": 3350528,
      "scriptDurationMs": 276.822,
      "eventListeners": -7478,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.77333333333336,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 16245.719000000008,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 15307.365000000002,
      "heapDeltaBytes": -52424672,
      "heapUsedBytes": 161134900,
      "domNodes": -6542,
      "jsHeapTotalBytes": 2056192,
      "scriptDurationMs": 264.30800000000005,
      "eventListeners": -7478,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.780000000000047,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 20499.603999999978,
      "styleRecalcs": 170,
      "styleRecalcDurationMs": 17.455000000000027,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 20118.628,
      "heapDeltaBytes": -27716172,
      "heapUsedBytes": 167320180,
      "domNodes": -6542,
      "jsHeapTotalBytes": 3350528,
      "scriptDurationMs": 874.121,
      "eventListeners": -7474,
      "totalBlockingTimeMs": 155,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 20332.764999999996,
      "styleRecalcs": 173,
      "styleRecalcDurationMs": 17.181,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 19945.883,
      "heapDeltaBytes": -18085784,
      "heapUsedBytes": 176802240,
      "domNodes": -6542,
      "jsHeapTotalBytes": -319488,
      "scriptDurationMs": 879.592,
      "eventListeners": -7474,
      "totalBlockingTimeMs": 51,
      "frameDurationMs": 17.223333333333358,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 6066.849999999988,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 81.68099999999997,
      "layouts": 20,
      "layoutDurationMs": 23.817000000000004,
      "taskDurationMs": 5946.905999999999,
      "heapDeltaBytes": -30203384,
      "heapUsedBytes": 172730588,
      "domNodes": -6542,
      "jsHeapTotalBytes": 9850880,
      "scriptDurationMs": 117.174,
      "eventListeners": -7474,
      "totalBlockingTimeMs": 380,
      "frameDurationMs": 17.776666666666703,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 5755.935000000022,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 76.55999999999999,
      "layouts": 20,
      "layoutDurationMs": 21.15600000000001,
      "taskDurationMs": 5643.695999999999,
      "heapDeltaBytes": -15783472,
      "heapUsedBytes": 178649644,
      "domNodes": -6542,
      "jsHeapTotalBytes": 16982016,
      "scriptDurationMs": 99.66699999999999,
      "eventListeners": -7476,
      "totalBlockingTimeMs": 327,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.80000000000109
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 8277.606999999989,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 7832.934,
      "heapDeltaBytes": -7719972,
      "heapUsedBytes": 167229076,
      "domNodes": -1,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 114.59900000000006,
      "eventListeners": -12,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.773333333333238,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 8386.955000000056,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 8156.373000000002,
      "heapDeltaBytes": -18258612,
      "heapUsedBytes": 179431096,
      "domNodes": 0,
      "jsHeapTotalBytes": -7864320,
      "scriptDurationMs": 130.616,
      "eventListeners": -12,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "workflow-execution",
      "durationMs": 121.98899999998503,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 20.378,
      "layouts": 4,
      "layoutDurationMs": 1.8190000000000002,
      "taskDurationMs": 95.607,
      "heapDeltaBytes": 3260780,
      "heapUsedBytes": 65155000,
      "domNodes": 137,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 8.281,
      "eventListeners": 35,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "workflow-execution",
      "durationMs": 458.77199999995355,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 21.911000000000005,
      "layouts": 4,
      "layoutDurationMs": 1.6460000000000001,
      "taskDurationMs": 115.30699999999999,
      "heapDeltaBytes": 4998332,
      "heapUsedBytes": 67071372,
      "domNodes": 146,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 9.013,
      "eventListeners": 83,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    }
  ]
}

🔬 E2E Coverage

Metric Covered Total Pct
Lines 50913 77278 65.9% 🟡
Functions 0 0 — —
Branches 0 0 — —
Top 10 files by uncovered lines
File Coverage Missed
src/LGraphCanvas.ts 67.6% 1157
src/LGraphNode.ts 69.9% 388
src/extensions/core/cameraInfo/CameraInfoViewport.ts 2.0% 343
src/renderer/extensions/layerEditor/composables/useLayerEditorSession.ts 40.1% 332
src/platform/workspace/stores/workspaceAuthStore.ts 33.1% 331
src/platform/workspace/stores/billingOperationStore.ts 7.9% 313
src/LGraph.ts 79.1% 263
src/platform/workspace/stores/teamWorkspaceStore.ts 38.9% 256
src/scripts/app.ts 71.8% 251
src/core/billing/operationLifecycle.ts 0.9% 226

@codecov

codecov Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                         Coverage Diff                         @@
##           jaewon/fe-2218-billing-web-session   #17809   +/-   ##
===================================================================
  Coverage                               82.51%   82.52%           
===================================================================
  Files                                    2828     2836    +8     
  Lines                                  141647   141737   +90     
  Branches                                38282    38308   +26     
===================================================================
+ Hits                                   116885   116967   +82     
- Misses                                  23554    23562    +8     
  Partials                                 1208     1208           
Flag Coverage Δ
e2e 65.95% <ø> (-0.01%) ⬇️
unit 78.52% <100.00%> (+0.01%) ⬆️
website-unit 74.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/billing-contract/src/contract.ts 100.00% <100.00%> (ø)
packages/billing-contract/src/entryFields.ts 100.00% <100.00%> (ø)
packages/billing-contract/src/entryParser.ts 100.00% <100.00%> (ø)
packages/billing-contract/src/entryUrl.ts 100.00% <100.00%> (ø)
packages/billing-contract/src/identifiers.ts 100.00% <100.00%> (ø)
packages/billing-contract/src/returnTargets.ts 100.00% <100.00%> (ø)
packages/billing-contract/src/returnUrl.ts 100.00% <100.00%> (ø)
packages/billing-contract/src/url.ts 100.00% <100.00%> (ø)

... and 13 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:xhigh PR risk grade (advisory shadow check; grader-owned) label Sep 16, 2026

@CodeJuggernaut CodeJuggernaut 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.

Contract, routing and both surfaces hold under the probes; one Minor inline: a saved method without brand and last4 renders its raw server type, which the body says never happens.


function describe(method: SavedPaymentMethod): string {
if (method.brand === undefined || method.last4 === undefined)
return method.type

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.

Severity: Minor

What: describe() returns method.type raw whenever brand or last4 is absent, and type is an open z.string() in the generated contract (packages/ingest-types/src/zod.gen.ts:706).

Why this is an issue: a non-card method shows whatever string the server sent, contradicting the body's rule that no server text is rendered, which every other server value in this diff follows through coded(); no test pins the fallback since every fixture row carries brand and last4.

Proposed Fix: coded('paymentMethodType', method.type) with an unknown line, a fixture row without brand and last4, and the body naming brand and last4 as the one interpolated pair.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 51760e2. describe() now falls back to coded('paymentMethodType', method.type), with hosted.paymentMethodType.unknown ("Saved payment method") and a card line, so an open type names our copy instead of reaching the screen.

Fixture: PaymentMethodsView.test.ts gains { id: 'pm_3', is_default: false, type: 'us_bank_account' }, and names a method with no brand or last four in our own copy asserts the coded line renders and us_bank_account does not. Verified red against the old return method.type.

PR body updated: the bullet now names the card brand and last four as the one server-supplied pair the UI interpolates, rather than claiming no server text at all.

…2331)

describe() returned method.type raw whenever brand or last4 was absent, and
type is an open z.string() in the generated contract, so a non-card method put
server-chosen text on screen. Every other server value in this surface goes
through coded(); this one now does too, with brand and last4 left as the one
pair the panel interpolates.
@dante01yoon
dante01yoon merged commit cce907e into jaewon/fe-2218-billing-web-session Sep 16, 2026
98 checks passed
@dante01yoon
dante01yoon deleted the jaewon/fe-2331-billing-web-hosted-views branch September 16, 2026 11:52
@dante01yoon dante01yoon removed needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch core/1.54 Backport PRs for core 1.54 cloud/1.54 Backport PRs for cloud 1.54 labels Sep 16, 2026
dante01yoon added a commit that referenced this pull request Sep 16, 2026
…nd payment-method surfaces (#17809)

Linear FE-2331 / FE-2218.

Stacked on #17807 (session); carries a cherry-pick of #17795
(billing-contract).

## Why

`billing.comfy.org` currently serves one static page: a hard-coded
checkout mockup at `/`. Nothing reads the entry URL a product hands it,
and nothing renders over the billing SDK. This PR gives the hosted app
its `/v1` entry routing plus the first two surfaces that project real
SDK state — the subscription catalog with a plan-change quote, and saved
payment methods with the provider portal round trip.

The entry URL is untrusted routing input. `parseBillingEntry` decides
whether it describes a request the contract knows, and a failed parse
renders a coded explanation rather than a redirect, so a misdirected
link stays visible instead of silently landing the customer somewhere
else.

## How

- `router.ts` generates a route per `BILLING_INTENTS` entry —
`subscription` and `pricing` to `SubscriptionView`, `payment-methods` to
`PaymentMethodsView`, `checkout` to the existing `BillingHomeView`
(unchanged), `invoices` and `result` to `ComingSoonView`. `/` keeps the
scaffold checkout page and stays outside the contract.
- A `beforeEach` parses `to.fullPath` and publishes the result into a
tab-local module ref (`useBillingEntry`); `App.vue` renders the
entry-error surface whenever that parse failed, whatever route matched.
No navigation happens on an error.
- The entry is read before the session guard from #17807 runs, so a link
we cannot read explains itself even to a visitor the guard sends to
`/sign-in`: signing in would not repair it. `/` and `/sign-in` carry no
product request and leave the entry alone.
- `HostedSurface.vue` is the shared shell: the dark full-screen layout,
the surface title, the `Return to <product>` link built with
`buildReturnUrl` against the resolved `BILLING_WEB_ENV` (default and
fail-closed value `test`), and the choice between the entry-error
section and the surface itself. Views stay pure projections of
composable state, and a surface only ever renders behind the guard and
the shell, which always provide a client.
- `SubscriptionPanel` reads `usePlans()`, renders each plan as a card
(tier + duration, price, monthly credits, seats), disables an
unavailable plan with its availability reason as our own copy, and on
selection calls `usePreviewSubscribe().quote({ planSlug })` and renders
the quote. Confirm is present and disabled behind the scaffold's
existing `checkout.sdkPending` line.
- `PaymentMethodsPanel` reads `usePaymentMethods()`, marks the default
card, and opens the provider portal through `commands.openPaymentPortal`
with this page's own href plus a `portal=return` marker. On the way back
it invalidates and re-reads once, then strips the marker with
`router.replace`.
- Every server-chosen value reaches the screen as a coded lookup with a
generic fallback: availability reasons, transition types, billing
failure codes, entry error codes, saved payment method types. The card
brand and its last four digits are the one server-supplied pair the UI
interpolates; no other server text is rendered.
- `bigint` money fields convert with `Number()` only at the `n()`/`d()`
formatting boundary.

## AS-IS / TO-BE

AS-IS: a `/v1/subscription` link has no surface of its own — the
catch-all redirects it to `/`, the scaffold's static checkout mockup,
and the product's entry parameters are dropped on the way.

TO-BE: `/v1/subscription` renders the catalog with the current plan
marked and an unavailable plan explained, selecting a plan adds the
server's plan-change quote with an inert confirm, `/v1/payment-methods`
lists saved cards with the default marked beside the provider-portal
button, and a link the contract cannot read gets a coded explanation
instead of a redirect.

| AS-IS | TO-BE |
| --- | --- |
| `/v1/subscription?product=comfyui&return_to=comfyui_workspace`
redirects to the static checkout page<br><img width="420"
src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/asis-v1-subscription.png">
| The same link renders the subscription surface<br><img width="420"
src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-subscription.png">
|
| TO-BE — plan-change quote after selecting Pro · Monthly<br><img
width="420"
src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-subscription-quote.png">
| TO-BE — `/v1/payment-methods` with the default card marked<br><img
width="420"
src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-payment-methods.png">
|
| — | TO-BE — a link the contract cannot read
(`/v1/subscription?product=nope`)<br><img width="420"
src="https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/refs/heads/assets/pr-17809-screenshots/tobe-entry-error.png">
|

## Testing

`apps/billing-web` unit tests (`@testing-library/vue`, happy-dom): the
app suite is 85 passing, 44 of them in the four files this PR touches:

- `router.test.ts` — each intent opens its surface, the parsed entry is
published, every entry-error code renders its own copy (including on the
checkout route, proving the error surface wins over the matched route),
an unrecognised path stays where it is, and `/` remains outside the
contract. The guard rows from #17807 join the same file: a signed-out
visitor is sent to `/sign-in` with the surface to come back to, and an
unreadable link keeps its error through that redirect.
- `SubscriptionView.test.ts` — current plan named, catalog priced, an
unavailable plan disabled with its reason, selecting a plan calls
`previewSubscribe` with `{ planSlug }` and renders the formatted quote
with confirm disabled, a refused quote and a failed catalog read both
render coded copy.
- `PaymentMethodsView.test.ts` — cards listed with the default marked,
the portal button navigates to the returned URL, and `portal=return`
triggers exactly one invalidate plus one read before the marker is
stripped.
- `HostedSurface.test.ts` — the arriving intent's content renders,
return link href from `buildReturnUrl`, no link when the entry named no
destination.

Gates: `pnpm typecheck`, `pnpm lint`, `pnpm format`, `pnpm knip`, `pnpm
--filter @comfyorg/billing-web build`, `fallow audit` all pass.

## Not in this PR

- Subscribing through the SDK — the confirm button is deliberately
inert.
- Invoices, which wait on the backend.
- Putting `apps/billing-web` unit tests in the CI loop:
`ci-tests-unit.yaml` runs `packages/*` only, so this suite runs locally
but not on a PR. Follow-up.
## Where this sits in the plan

Billing SDK track FE-2210 ([implementation plan
V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid
model: top-up in-app, subscription management / invoices / payment
methods on the hosted billing app.

| Phase | Item | Ticket | Status |
| --- | --- | --- | --- |
| 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged |
| 3 | Operation lifecycle, commands, eight-state projection |
FE-2227/2214/2223 | merged (#17655) |
| 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 |
merged (#17662, #17663) |
| 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled`
| FE-2216 | merged (#17665) |
| rollout C | `hosted_billing_destination` server flag read by the host
| FE-2218 | merged (#17716) |
| rollout C | `hostedDestination` port on the lifecycle, value on
operation state | FE-2210/2218 | open (#17783) |
| 7 prep | Scope-source port + credentialed transport (BFF / cookie
hosts) | FE-2218 | open (#17782) |
| 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename |
FE-2218 | local, opens after #17782 and #17783 |
| 7 prep | `billing-contract` route builder + `return_to` registry |
FE-2218 | open (#17795) |
| 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 |
open (#17793) |
| 8 core | `previewSubscribe` command | FE-2331 | open (#17797) |
| 8 core | Plans + saved payment-methods readers | FE-2331 | open
(#17798) |
| 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`,
`usePreviewSubscribe`) | FE-2331 | open (#17799) |
| 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218
| open (#17807) |
| 8 ui | billing-web `/v1` entry routing + subscription / payment-method
surfaces | FE-2331 | **this PR** |
| 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`),
Platform install, billing-web live top-up | FE-2218 | todo |
| 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo |
| 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo
(plan-change decision) |
| follow-up | One `needsCustomerAttention` predicate (from the #17665
review) | FE-2216 | open (#17792) |
| follow-up | Opaque `BillingServerCode` (from the #17656 review) |
FE-2227 | open (#17794) |

```mermaid
flowchart LR
  P3["Phase 3 core lifecycle (merged)"]
  P4["Phase 4 account-ui (merged)"]
  P5["Phase 5 slice 1 top-up flag (merged)"]
  FC["PR 17716 hosted_billing_destination flag (merged)"]
  HD["PR 17783 hostedDestination port"]
  SS["PR 17782 scope-source port + credentialed transport"]
  RN["account-core rename"]
  RB["billing-contract route builder + return_to"]
  WS["Workshop adapter"]
  P8PV["previewSubscribe command"]
  P8RD["plans + payment-methods readers"]
  P8["account-ui hosted composables"]
  BWS["billing-web session + sign-in"]
  BWV["billing-web /v1 surfaces"]
  PUB["npm publish account-core / billing-contract"]
  P7["Phase 7 host proof: Platform + billing-web live"]
  P6["Phase 6 evidence"]
  S2["Phase 5 slice 2 subscription"]
  FU9["customer-attention predicate"]
  FU11["opaque BillingServerCode"]
  P3 --> HD
  FC --> HD
  HD --> RB
  P3 --> SS
  SS --> P7
  RB --> P7
  P3 --> RN
  RN --> PUB
  RB --> PUB
  PUB --> P7
  P3 --> P8PV
  P3 --> P8RD
  P8PV --> P8
  P8RD --> P8
  P4 --> P8
  P8 --> S2
  P8 --> BWS
  BWS --> BWV
  RB --> BWV
  BWV --> P7
  P5 --> P6
  P5 --> WS
  P5 --> FU9
  P3 --> FU11
  style P3 fill:#d4edda,stroke:#155724
  style P4 fill:#d4edda,stroke:#155724
  style P5 fill:#d4edda,stroke:#155724
  style FC fill:#d4edda,stroke:#155724
  style BWV stroke:#0366d6,stroke-width:4px
```
dante01yoon added a commit that referenced this pull request Sep 16, 2026
…own-origin session and v1 surfaces (#17799)

Linear FE-2331.

Stacked on #17798 (readers); carries #17797 (previewSubscribe, now on
main) until #17798 lands. #17807 (billing-web own-origin session +
sign-in) and #17809 (billing-web /v1 surfaces) were squash-merged into
this branch, so this PR is the whole Phase 8 view layer: account-ui
composables, the billing-web session/sign-in, and the subscription /
payment-method surfaces.

## Why

The plans catalog, the saved cards and the subscription quote are the
three
reads the hosted billing surfaces are built on, and the core now exposes
all
three. Nothing in the view layer could reach them: `BillingClient`
carried only
the balance, capability and status readers, so a host wanting a price
had to
call the core directly and invent its own loading, failure and
cancellation
handling per screen.

## How

- `BillingClient` gains `plans` and `paymentMethods`;
`disposeBillingClient`
disposes both, so a sign-out or workspace switch cannot leave a catalog
or a
  card list serving the previous scope.
- `usePlans` and `usePaymentMethods` follow `useCredits`: seeded from
the
reader's snapshot, `immediate` by default, and a failed refresh keeps
the last
  good value beside the failure rather than blanking the screen.
`usePaymentMethods` also exposes `defaultMethod` and
`invalidateAndRefresh`,
for a host coming back from the payment portal where a card was added or
  removed.
- `usePreviewSubscribe` is on-demand and single-flight: each `quote`
aborts the
one before it through an `AbortController`, and only the latest settles
into
`preview`/`failure`, so a slow price for a plan the user has moved off
never
  lands on screen.
- The app composition root builds both readers and adds them to
`dispose()`,
keeping the two scope-holder lists in step. Commands stay unwired here.

## AS-IS / TO-BE

No UI change. These are headless composables; nothing renders them yet.

## Testing

`usePlans`, `usePaymentMethods` and `usePreviewSubscribe` tests run
against the
real core over the shared billing harness. Both the abort guard and the
payment-methods invalidation were verified to fail when removed. A table
in
`createBillingSdk.test.ts` asserts every reader stops serving the
disposed
scope.

## Where this sits in the plan

Billing SDK track FE-2210 ([implementation plan
V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid
model: top-up in-app, subscription management / invoices / payment
methods on the hosted billing app.

| Phase | Item | Ticket | Status |
| --- | --- | --- | --- |
| 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged |
| 3 | Operation lifecycle, commands, eight-state projection |
FE-2227/2214/2223 | merged (#17655) |
| 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 |
merged (#17662, #17663) |
| 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled`
| FE-2216 | merged (#17665) |
| rollout C | `hosted_billing_destination` server flag read by the host
| FE-2218 | merged (#17716) |
| rollout C | `hostedDestination` port on the lifecycle, value on
operation state | FE-2210/2218 | open (#17783) |
| 7 prep | Scope-source port + credentialed transport (BFF / cookie
hosts) | FE-2218 | merged (#17782) |
| 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename |
FE-2218 | local, opens after #17783 and #17794 |
| 7 prep | `billing-contract` route builder + `return_to` registry |
FE-2218 | merged (#17795) |
| 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 |
merged (#17793) |
| 8 core | `previewSubscribe` command | FE-2331 | merged (#17797) |
| 8 core | Plans + saved payment-methods readers | FE-2331 | open
(#17798) |
| 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`,
`usePreviewSubscribe`) | FE-2331 | **this PR** |
| 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218
| **this PR** (was #17807) |
| 8 ui | billing-web `/v1` entry routing + subscription / payment-method
surfaces | FE-2331 | **this PR** (was #17809) |
| 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`),
Platform install, billing-web live top-up | FE-2218 | todo |
| 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo |
| 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo
(plan-change decision) |
| follow-up | One `needsCustomerAttention` predicate (from the #17665
review) | FE-2216 | merged (#17792) |
| follow-up | Opaque `BillingServerCode` (from the #17656 review) |
FE-2227 | open (#17794) |
| follow-up | `useCredits` clears on `SUPERSEDED` (from the #17799
review) | FE-2215 | open (#17824) |

```mermaid
flowchart LR
  P3["Phase 3 core lifecycle (merged)"]
  P4["Phase 4 account-ui (merged)"]
  P5["Phase 5 slice 1 top-up flag (merged)"]
  FC["PR 17716 hosted_billing_destination flag (merged)"]
  HD["PR 17783 hostedDestination port"]
  SS["PR 17782 scope-source port + credentialed transport"]
  RN["account-core rename"]
  RB["billing-contract route builder + return_to"]
  WS["Workshop adapter"]
  P8PV["previewSubscribe command"]
  P8RD["plans + payment-methods readers"]
  P8["account-ui hosted composables"]
  BWS["billing-web session + sign-in"]
  BWV["billing-web /v1 surfaces"]
  PUB["npm publish account-core / billing-contract"]
  P7["Phase 7 host proof: Platform + billing-web live"]
  P6["Phase 6 evidence"]
  S2["Phase 5 slice 2 subscription"]
  FU9["customer-attention predicate"]
  FU11["opaque BillingServerCode"]
  FU12["useCredits clears on SUPERSEDED"]
  P3 --> HD
  FC --> HD
  HD --> RB
  P3 --> SS
  SS --> P7
  RB --> P7
  P3 --> RN
  RN --> PUB
  RB --> PUB
  PUB --> P7
  P3 --> P8PV
  P3 --> P8RD
  P8PV --> P8
  P8RD --> P8
  P4 --> P8
  P8 --> S2
  P8 --> BWS
  BWS --> BWV
  RB --> BWV
  BWV --> P7
  P5 --> P6
  P5 --> WS
  P5 --> FU9
  P3 --> FU11
  P4 --> FU12
  style P3 fill:#d4edda,stroke:#155724
  style P4 fill:#d4edda,stroke:#155724
  style P5 fill:#d4edda,stroke:#155724
  style FC fill:#d4edda,stroke:#155724
  style SS fill:#d4edda,stroke:#155724
  style RB fill:#d4edda,stroke:#155724
  style WS fill:#d4edda,stroke:#155724
  style FU9 fill:#d4edda,stroke:#155724
  style P8PV fill:#d4edda,stroke:#155724
  style P8 stroke:#0366d6,stroke-width:4px
  style BWS stroke:#0366d6,stroke-width:4px
  style BWV stroke:#0366d6,stroke-width:4px
```
dante01yoon added a commit that referenced this pull request Sep 16, 2026
…own-origin session and v1 surfaces (#17799)

Linear FE-2331.

Stacked on #17798 (readers); carries #17797 (previewSubscribe, now on
main) until #17798 lands. #17807 (billing-web own-origin session +
sign-in) and #17809 (billing-web /v1 surfaces) were squash-merged into
this branch, so this PR is the whole Phase 8 view layer: account-ui
composables, the billing-web session/sign-in, and the subscription /
payment-method surfaces.

The plans catalog, the saved cards and the subscription quote are the
three
reads the hosted billing surfaces are built on, and the core now exposes
all
three. Nothing in the view layer could reach them: `BillingClient`
carried only
the balance, capability and status readers, so a host wanting a price
had to
call the core directly and invent its own loading, failure and
cancellation
handling per screen.

- `BillingClient` gains `plans` and `paymentMethods`;
`disposeBillingClient`
disposes both, so a sign-out or workspace switch cannot leave a catalog
or a
  card list serving the previous scope.
- `usePlans` and `usePaymentMethods` follow `useCredits`: seeded from
the
reader's snapshot, `immediate` by default, and a failed refresh keeps
the last
  good value beside the failure rather than blanking the screen.
`usePaymentMethods` also exposes `defaultMethod` and
`invalidateAndRefresh`,
for a host coming back from the payment portal where a card was added or
  removed.
- `usePreviewSubscribe` is on-demand and single-flight: each `quote`
aborts the
one before it through an `AbortController`, and only the latest settles
into
`preview`/`failure`, so a slow price for a plan the user has moved off
never
  lands on screen.
- The app composition root builds both readers and adds them to
`dispose()`,
keeping the two scope-holder lists in step. Commands stay unwired here.

No UI change. These are headless composables; nothing renders them yet.

`usePlans`, `usePaymentMethods` and `usePreviewSubscribe` tests run
against the
real core over the shared billing harness. Both the abort guard and the
payment-methods invalidation were verified to fail when removed. A table
in
`createBillingSdk.test.ts` asserts every reader stops serving the
disposed
scope.

Billing SDK track FE-2210 ([implementation plan
V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid
model: top-up in-app, subscription management / invoices / payment
methods on the hosted billing app.

| Phase | Item | Ticket | Status |
| --- | --- | --- | --- |
| 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged |
| 3 | Operation lifecycle, commands, eight-state projection |
FE-2227/2214/2223 | merged (#17655) |
| 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 |
merged (#17662, #17663) |
| 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled`
| FE-2216 | merged (#17665) |
| rollout C | `hosted_billing_destination` server flag read by the host
| FE-2218 | merged (#17716) |
| rollout C | `hostedDestination` port on the lifecycle, value on
operation state | FE-2210/2218 | open (#17783) |
| 7 prep | Scope-source port + credentialed transport (BFF / cookie
hosts) | FE-2218 | merged (#17782) |
| 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename |
FE-2218 | local, opens after #17783 and #17794 |
| 7 prep | `billing-contract` route builder + `return_to` registry |
FE-2218 | merged (#17795) |
| 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 |
merged (#17793) |
| 8 core | `previewSubscribe` command | FE-2331 | merged (#17797) |
| 8 core | Plans + saved payment-methods readers | FE-2331 | open
(#17798) |
| 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`,
`usePreviewSubscribe`) | FE-2331 | **this PR** |
| 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218
| **this PR** (was #17807) |
| 8 ui | billing-web `/v1` entry routing + subscription / payment-method
surfaces | FE-2331 | **this PR** (was #17809) |
| 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`),
Platform install, billing-web live top-up | FE-2218 | todo |
| 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo |
| 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo
(plan-change decision) |
| follow-up | One `needsCustomerAttention` predicate (from the #17665
review) | FE-2216 | merged (#17792) |
| follow-up | Opaque `BillingServerCode` (from the #17656 review) |
FE-2227 | open (#17794) |
| follow-up | `useCredits` clears on `SUPERSEDED` (from the #17799
review) | FE-2215 | open (#17824) |

```mermaid
flowchart LR
  P3["Phase 3 core lifecycle (merged)"]
  P4["Phase 4 account-ui (merged)"]
  P5["Phase 5 slice 1 top-up flag (merged)"]
  FC["PR 17716 hosted_billing_destination flag (merged)"]
  HD["PR 17783 hostedDestination port"]
  SS["PR 17782 scope-source port + credentialed transport"]
  RN["account-core rename"]
  RB["billing-contract route builder + return_to"]
  WS["Workshop adapter"]
  P8PV["previewSubscribe command"]
  P8RD["plans + payment-methods readers"]
  P8["account-ui hosted composables"]
  BWS["billing-web session + sign-in"]
  BWV["billing-web /v1 surfaces"]
  PUB["npm publish account-core / billing-contract"]
  P7["Phase 7 host proof: Platform + billing-web live"]
  P6["Phase 6 evidence"]
  S2["Phase 5 slice 2 subscription"]
  FU9["customer-attention predicate"]
  FU11["opaque BillingServerCode"]
  FU12["useCredits clears on SUPERSEDED"]
  P3 --> HD
  FC --> HD
  HD --> RB
  P3 --> SS
  SS --> P7
  RB --> P7
  P3 --> RN
  RN --> PUB
  RB --> PUB
  PUB --> P7
  P3 --> P8PV
  P3 --> P8RD
  P8PV --> P8
  P8RD --> P8
  P4 --> P8
  P8 --> S2
  P8 --> BWS
  BWS --> BWV
  RB --> BWV
  BWV --> P7
  P5 --> P6
  P5 --> WS
  P5 --> FU9
  P3 --> FU11
  P4 --> FU12
  style P3 fill:#d4edda,stroke:#155724
  style P4 fill:#d4edda,stroke:#155724
  style P5 fill:#d4edda,stroke:#155724
  style FC fill:#d4edda,stroke:#155724
  style SS fill:#d4edda,stroke:#155724
  style RB fill:#d4edda,stroke:#155724
  style WS fill:#d4edda,stroke:#155724
  style FU9 fill:#d4edda,stroke:#155724
  style P8PV fill:#d4edda,stroke:#155724
  style P8 stroke:#0366d6,stroke-width:4px
  style BWS stroke:#0366d6,stroke-width:4px
  style BWV stroke:#0366d6,stroke-width:4px
```
pull Bot pushed a commit to Mu-L/ComfyUI_frontend that referenced this pull request Sep 16, 2026
…g the previous scope's (Comfy-Org#17824)

Linear FE-2215. Follow-up from the Comfy-Org#17799 review.

## Why

The exposure this SDK track started from was a reader serving the
previous
account's balance. The core closed it: a read that settles after the
host
moved to another workspace is refused with `SUPERSEDED` rather than
published.
`useCredits` then reopened it in the view layer — it treated that
refusal as an
ordinary failure, kept `balance` untouched, and went on rendering the
credits
of the workspace the user had just left.

## Root cause

`useCredits.refresh` had two branches: publish on `ok`, keep the
previous
balance and surface the failure on anything else. A scope change is
neither. It
is not something the user did, there is nothing to retry, and the value
being
kept belongs to an account that is no longer on screen. The three
composables
added in Comfy-Org#17799 already split that branch out; the five older ones never
mentioned `SUPERSEDED`.

## How

`useCredits` clears both `balance` and `failure` on a `SUPERSEDED` read,
the
same three lines as `usePaymentMethods`, and its docstring keeps the "a
failed
refresh keeps the previous balance" promise only for ordinary failures.

The other four pre-existing composables are unchanged:

- `useBillingOperation` — the lifecycle dispatches `superseded` to every
operation on a scope change and republishes it, so the state this
composable
  holds is already the truthful new one rather than a stale one.
- `usePaymentAttempt` — its visible surface is `projection`, and
  `projectPaymentStep` maps a superseded operation back to `select`.
- `useCheckout` / `useTopUp` — `result` is the outcome handed back to
the
caller of a command, carries no scope-bound data, and the step the
shipped
  `CheckoutSteps` renders comes from the projection above.

The test fixture's fake session can now move to another workspace, so
the real
credits reader produces `SUPERSEDED` the way the workspace switcher
does.

## AS-IS / TO-BE

No UI change. AS-IS: after a workspace switch, a host bound to
`useCredits`
keeps showing the previous workspace's balance until something else
clears it.
TO-BE: the balance goes undefined and the host renders its empty state
until
the read for the new workspace settles, with no error shown for a switch
the
user did not make.

## Testing

`useCredits.test.ts` gains a row that moves the harness to another
workspace
mid-refresh and asserts the balance is dropped with no failure reported;
it
fails on pre-fix code. The existing row proving that an ordinary failed
refresh
keeps the previous balance stays.
## Where this sits in the plan

Billing SDK track FE-2210 ([implementation plan
V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid
model: top-up in-app, subscription management / invoices / payment
methods on the hosted billing app.

| Phase | Item | Ticket | Status |
| --- | --- | --- | --- |
| 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged |
| 3 | Operation lifecycle, commands, eight-state projection |
FE-2227/2214/2223 | merged (Comfy-Org#17655) |
| 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 |
merged (Comfy-Org#17662, Comfy-Org#17663) |
| 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled`
| FE-2216 | merged (Comfy-Org#17665) |
| rollout C | `hosted_billing_destination` server flag read by the host
| FE-2218 | merged (Comfy-Org#17716) |
| rollout C | `hostedDestination` port on the lifecycle, value on
operation state | FE-2210/2218 | open (Comfy-Org#17783) |
| 7 prep | Scope-source port + credentialed transport (BFF / cookie
hosts) | FE-2218 | merged (Comfy-Org#17782) |
| 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename |
FE-2218 | local, opens after Comfy-Org#17783 and Comfy-Org#17794 |
| 7 prep | `billing-contract` route builder + `return_to` registry |
FE-2218 | merged (Comfy-Org#17795) |
| 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 |
merged (Comfy-Org#17793) |
| 8 core | `previewSubscribe` command | FE-2331 | merged (Comfy-Org#17797) |
| 8 core | Plans + saved payment-methods readers | FE-2331 | open
(Comfy-Org#17798) |
| 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`,
`usePreviewSubscribe`) | FE-2331 | open (Comfy-Org#17799) |
| 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218
| open (Comfy-Org#17807) |
| 8 ui | billing-web `/v1` entry routing + subscription / payment-method
surfaces | FE-2331 | open (Comfy-Org#17809) |
| 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`),
Platform install, billing-web live top-up | FE-2218 | todo |
| 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo |
| 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo
(plan-change decision) |
| follow-up | One `needsCustomerAttention` predicate (from the Comfy-Org#17665
review) | FE-2216 | merged (Comfy-Org#17792) |
| follow-up | Opaque `BillingServerCode` (from the Comfy-Org#17656 review) |
FE-2227 | open (Comfy-Org#17794) |
| follow-up | `useCredits` clears on `SUPERSEDED` (from the Comfy-Org#17799
review) | FE-2215 | **this PR** |

```mermaid
flowchart LR
  P3["Phase 3 core lifecycle (merged)"]
  P4["Phase 4 account-ui (merged)"]
  P5["Phase 5 slice 1 top-up flag (merged)"]
  FC["PR 17716 hosted_billing_destination flag (merged)"]
  HD["PR 17783 hostedDestination port"]
  SS["PR 17782 scope-source port + credentialed transport"]
  RN["account-core rename"]
  RB["billing-contract route builder + return_to"]
  WS["Workshop adapter"]
  P8PV["previewSubscribe command"]
  P8RD["plans + payment-methods readers"]
  P8["account-ui hosted composables"]
  BWS["billing-web session + sign-in"]
  BWV["billing-web /v1 surfaces"]
  PUB["npm publish account-core / billing-contract"]
  P7["Phase 7 host proof: Platform + billing-web live"]
  P6["Phase 6 evidence"]
  S2["Phase 5 slice 2 subscription"]
  FU9["customer-attention predicate"]
  FU11["opaque BillingServerCode"]
  FU12["useCredits clears on SUPERSEDED"]
  P3 --> HD
  FC --> HD
  HD --> RB
  P3 --> SS
  SS --> P7
  RB --> P7
  P3 --> RN
  RN --> PUB
  RB --> PUB
  PUB --> P7
  P3 --> P8PV
  P3 --> P8RD
  P8PV --> P8
  P8RD --> P8
  P4 --> P8
  P8 --> S2
  P8 --> BWS
  BWS --> BWV
  RB --> BWV
  BWV --> P7
  P5 --> P6
  P5 --> WS
  P5 --> FU9
  P3 --> FU11
  P4 --> FU12
  style P3 fill:#d4edda,stroke:#155724
  style P4 fill:#d4edda,stroke:#155724
  style P5 fill:#d4edda,stroke:#155724
  style FC fill:#d4edda,stroke:#155724
  style FU12 stroke:#0366d6,stroke-width:4px
```
dante01yoon added a commit that referenced this pull request Sep 16, 2026
…own-origin session and v1 surfaces (#17799)

Linear FE-2331.

Stacked on #17798 (readers); carries #17797 (previewSubscribe, now on
main) until #17798 lands. #17807 (billing-web own-origin session +
sign-in) and #17809 (billing-web /v1 surfaces) were squash-merged into
this branch, so this PR is the whole Phase 8 view layer: account-ui
composables, the billing-web session/sign-in, and the subscription /
payment-method surfaces.

The plans catalog, the saved cards and the subscription quote are the
three
reads the hosted billing surfaces are built on, and the core now exposes
all
three. Nothing in the view layer could reach them: `BillingClient`
carried only
the balance, capability and status readers, so a host wanting a price
had to
call the core directly and invent its own loading, failure and
cancellation
handling per screen.

- `BillingClient` gains `plans` and `paymentMethods`;
`disposeBillingClient`
disposes both, so a sign-out or workspace switch cannot leave a catalog
or a
  card list serving the previous scope.
- `usePlans` and `usePaymentMethods` follow `useCredits`: seeded from
the
reader's snapshot, `immediate` by default, and a failed refresh keeps
the last
  good value beside the failure rather than blanking the screen.
`usePaymentMethods` also exposes `defaultMethod` and
`invalidateAndRefresh`,
for a host coming back from the payment portal where a card was added or
  removed.
- `usePreviewSubscribe` is on-demand and single-flight: each `quote`
aborts the
one before it through an `AbortController`, and only the latest settles
into
`preview`/`failure`, so a slow price for a plan the user has moved off
never
  lands on screen.
- The app composition root builds both readers and adds them to
`dispose()`,
keeping the two scope-holder lists in step. Commands stay unwired here.

No UI change. These are headless composables; nothing renders them yet.

`usePlans`, `usePaymentMethods` and `usePreviewSubscribe` tests run
against the
real core over the shared billing harness. Both the abort guard and the
payment-methods invalidation were verified to fail when removed. A table
in
`createBillingSdk.test.ts` asserts every reader stops serving the
disposed
scope.

Billing SDK track FE-2210 ([implementation plan
V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid
model: top-up in-app, subscription management / invoices / payment
methods on the hosted billing app.

| Phase | Item | Ticket | Status |
| --- | --- | --- | --- |
| 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged |
| 3 | Operation lifecycle, commands, eight-state projection |
FE-2227/2214/2223 | merged (#17655) |
| 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 |
merged (#17662, #17663) |
| 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled`
| FE-2216 | merged (#17665) |
| rollout C | `hosted_billing_destination` server flag read by the host
| FE-2218 | merged (#17716) |
| rollout C | `hostedDestination` port on the lifecycle, value on
operation state | FE-2210/2218 | open (#17783) |
| 7 prep | Scope-source port + credentialed transport (BFF / cookie
hosts) | FE-2218 | merged (#17782) |
| 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename |
FE-2218 | local, opens after #17783 and #17794 |
| 7 prep | `billing-contract` route builder + `return_to` registry |
FE-2218 | merged (#17795) |
| 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 |
merged (#17793) |
| 8 core | `previewSubscribe` command | FE-2331 | merged (#17797) |
| 8 core | Plans + saved payment-methods readers | FE-2331 | open
(#17798) |
| 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`,
`usePreviewSubscribe`) | FE-2331 | **this PR** |
| 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218
| **this PR** (was #17807) |
| 8 ui | billing-web `/v1` entry routing + subscription / payment-method
surfaces | FE-2331 | **this PR** (was #17809) |
| 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`),
Platform install, billing-web live top-up | FE-2218 | todo |
| 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo |
| 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo
(plan-change decision) |
| follow-up | One `needsCustomerAttention` predicate (from the #17665
review) | FE-2216 | merged (#17792) |
| follow-up | Opaque `BillingServerCode` (from the #17656 review) |
FE-2227 | open (#17794) |
| follow-up | `useCredits` clears on `SUPERSEDED` (from the #17799
review) | FE-2215 | open (#17824) |

```mermaid
flowchart LR
  P3["Phase 3 core lifecycle (merged)"]
  P4["Phase 4 account-ui (merged)"]
  P5["Phase 5 slice 1 top-up flag (merged)"]
  FC["PR 17716 hosted_billing_destination flag (merged)"]
  HD["PR 17783 hostedDestination port"]
  SS["PR 17782 scope-source port + credentialed transport"]
  RN["account-core rename"]
  RB["billing-contract route builder + return_to"]
  WS["Workshop adapter"]
  P8PV["previewSubscribe command"]
  P8RD["plans + payment-methods readers"]
  P8["account-ui hosted composables"]
  BWS["billing-web session + sign-in"]
  BWV["billing-web /v1 surfaces"]
  PUB["npm publish account-core / billing-contract"]
  P7["Phase 7 host proof: Platform + billing-web live"]
  P6["Phase 6 evidence"]
  S2["Phase 5 slice 2 subscription"]
  FU9["customer-attention predicate"]
  FU11["opaque BillingServerCode"]
  FU12["useCredits clears on SUPERSEDED"]
  P3 --> HD
  FC --> HD
  HD --> RB
  P3 --> SS
  SS --> P7
  RB --> P7
  P3 --> RN
  RN --> PUB
  RB --> PUB
  PUB --> P7
  P3 --> P8PV
  P3 --> P8RD
  P8PV --> P8
  P8RD --> P8
  P4 --> P8
  P8 --> S2
  P8 --> BWS
  BWS --> BWV
  RB --> BWV
  BWV --> P7
  P5 --> P6
  P5 --> WS
  P5 --> FU9
  P3 --> FU11
  P4 --> FU12
  style P3 fill:#d4edda,stroke:#155724
  style P4 fill:#d4edda,stroke:#155724
  style P5 fill:#d4edda,stroke:#155724
  style FC fill:#d4edda,stroke:#155724
  style SS fill:#d4edda,stroke:#155724
  style RB fill:#d4edda,stroke:#155724
  style WS fill:#d4edda,stroke:#155724
  style FU9 fill:#d4edda,stroke:#155724
  style P8PV fill:#d4edda,stroke:#155724
  style P8 stroke:#0366d6,stroke-width:4px
  style BWS stroke:#0366d6,stroke-width:4px
  style BWV stroke:#0366d6,stroke-width:4px
```
pull Bot pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Sep 16, 2026
…ders, hosted composables, own-origin session and v1 surfaces (Comfy-Org#17798)

Linear FE-2331 / FE-2218.

This PR is the whole Phase 8 view layer after the stack was
consolidated: Comfy-Org#17799 (account-ui `usePlans` / `usePaymentMethods` /
`usePreviewSubscribe` + app-root readers), Comfy-Org#17807 (billing-web
own-origin session, sign-in, SDK composition) and Comfy-Org#17809 (billing-web
`/v1` entry routing, subscription and payment-method surfaces) were
squash-merged into this branch; their bodies, decisions and screenshots
remain on those PRs. Rebased onto main after Comfy-Org#17782 (scopeSource),
Comfy-Org#17795 (billing-contract) and Comfy-Org#17797 (previewSubscribe) landed, so none
of that content is in this diff.

## Why

Phase 8's hosted billing surfaces render plan management and saved
payment
methods, and both reads have to go through the billing SDK so they
inherit the
scope tracking, deduplication, and coded failures the other readers
already
have. The generated schemas for both routes exist, so nothing has to be
hand-declared.

## How

- `plans.ts`: `createPlansReader` over `GET /billing/plans`, decoded
with
`zGetBillingPlansResponse`. No freshness window — the catalog carries no
  declared lifetime, so the host decides when to re-read.
- `paymentMethods.ts`: `createPaymentMethodsReader` over
  `GET /billing/payment-methods`, decoded with
`zListSavedPaymentMethodsResponse`, plus `invalidate()` so a host
returning
from the payment portal can drop the list it holds without a scope
change.
- Both follow the existing reader shape exactly:
`createBillingScopeTracker`
drops the snapshot and any in-flight read on a scope change, concurrent
reads
  for one scope share a single request, a 2xx that fails the schema is
`MALFORMED_RESPONSE`, and HTTP failures map through `codeForHttpStatus`.
- Exported from `@comfyorg/account/billing` alongside the credits,
status, and
  capabilities readers.

The four readers now share the same request/publish body, which `fallow
audit`
reports as a duplication warning. Factoring it out would touch
`credits.ts` and
`status.ts`, which two open PRs already modify, so it is left for a
follow-up.

## AS-IS / TO-BE

No UI change. The cloud app still calls `workspaceApi.getBillingPlans`
and
`workspaceApi.listSavedPaymentMethods`; the composables and host wiring
that
move it onto these readers land in separate PRs.

## Testing

`plans.test.ts` and `paymentMethods.test.ts` cover the decode and scope
of a
successful read, the caller timeout reaching the request, deduplication
of
concurrent reads, a scope change in flight reporting `SUPERSEDED` with
nothing
cached, a signed-out reader reporting `NOT_AUTHENTICATED` without a
request, the
HTTP status table (401 replayed and unreplayed, 403, 404, 500), a
malformed 2xx,
and `dispose`. Payment methods additionally cover the empty list and
`invalidate` dropping the snapshot so the next read refetches.

`pnpm typecheck`, `pnpm lint`, `pnpm format`, `pnpm knip`, and
`fallow audit --changed-since origin/main` pass.

Follow-up, not in this PR: the four readers now share a 32-line
scope/in-flight skeleton (`credits.ts`, `status.ts`, `plans.ts`,
`paymentMethods.ts`; fallow reports it as one clone family). Comfy-Org#17782 has
landed, but extracting it still touches files Comfy-Org#17794 is changing, so it
waits for that to land.

## Where this sits in the plan

Billing SDK track FE-2210 ([implementation plan
V2](https://app.notion.com/p/3d86d73d36508152b92cdbdfdfe83ac8)). Hybrid
model: top-up in-app, subscription management / invoices / payment
methods on the hosted billing app.

| Phase | Item | Ticket | Status |
| --- | --- | --- | --- |
| 1-2 | Session core, transport, readers | FE-2211/2212/2213 | merged |
| 3 | Operation lifecycle, commands, eight-state projection |
FE-2227/2214/2223 | merged (Comfy-Org#17655) |
| 4 | `@comfyorg/account-ui` composables + `CheckoutSteps` | FE-2215 |
merged (Comfy-Org#17662, Comfy-Org#17663) |
| 5 slice 1 | Top-up through the SDK behind `billing_sdk_topup_enabled`
| FE-2216 | merged (Comfy-Org#17665) |
| rollout C | `hosted_billing_destination` server flag read by the host
| FE-2218 | merged (Comfy-Org#17716) |
| rollout C | `hostedDestination` port on the lifecycle, value on
operation state | FE-2210/2218 | open (Comfy-Org#17783) |
| 7 prep | Scope-source port + credentialed transport (BFF / cookie
hosts) | FE-2218 | merged (Comfy-Org#17782) |
| 7 prep | `@comfyorg/account` → `@comfyorg/account-core` rename |
FE-2218 | local, opens after Comfy-Org#17783 and Comfy-Org#17794 |
| 7 prep | `billing-contract` route builder + `return_to` registry |
FE-2218 | merged (Comfy-Org#17795) |
| 3A-3 | Workshop adapter over `createHostedTopupCheckout` | FE-2214 |
merged (Comfy-Org#17793) |
| 8 core | `previewSubscribe` command | FE-2331 | merged (Comfy-Org#17797) |
| 8 core | Plans + saved payment-methods readers | FE-2331 | **this PR**
|
| 8 ui | account-ui composables (`usePlans`, `usePaymentMethods`,
`usePreviewSubscribe`) | FE-2331 | **this PR** (was Comfy-Org#17799) |
| 7 | billing-web own-origin session, sign-in, SDK composition | FE-2218
| **this PR** (was Comfy-Org#17807) |
| 8 ui | billing-web `/v1` entry routing + subscription / payment-method
surfaces | FE-2331 | **this PR** (was Comfy-Org#17809) |
| 7 | npm publish (`ingest-types`, `account-core`, `billing-contract`),
Platform install, billing-web live top-up | FE-2218 | todo |
| 6 | Contract tests + live E2E per flow × consumer | FE-2217 | todo |
| 5 slice 2 | Subscription flows through the SDK | FE-2216 | todo
(plan-change decision) |
| follow-up | One `needsCustomerAttention` predicate (from the Comfy-Org#17665
review) | FE-2216 | merged (Comfy-Org#17792) |
| follow-up | Opaque `BillingServerCode` (from the Comfy-Org#17656 review) |
FE-2227 | open (Comfy-Org#17794) |
| follow-up | `useCredits` clears on `SUPERSEDED` (from the Comfy-Org#17799
review) | FE-2215 | open (Comfy-Org#17824) |

```mermaid
flowchart LR
  P3["Phase 3 core lifecycle (merged)"]
  P4["Phase 4 account-ui (merged)"]
  P5["Phase 5 slice 1 top-up flag (merged)"]
  FC["PR 17716 hosted_billing_destination flag (merged)"]
  HD["PR 17783 hostedDestination port"]
  SS["PR 17782 scope-source port + credentialed transport"]
  RN["account-core rename"]
  RB["billing-contract route builder + return_to"]
  WS["Workshop adapter"]
  P8PV["previewSubscribe command"]
  P8RD["plans + payment-methods readers"]
  P8["account-ui hosted composables"]
  BWS["billing-web session + sign-in"]
  BWV["billing-web /v1 surfaces"]
  PUB["npm publish account-core / billing-contract"]
  P7["Phase 7 host proof: Platform + billing-web live"]
  P6["Phase 6 evidence"]
  S2["Phase 5 slice 2 subscription"]
  FU9["customer-attention predicate"]
  FU11["opaque BillingServerCode"]
  FU12["useCredits clears on SUPERSEDED"]
  P3 --> HD
  FC --> HD
  HD --> RB
  P3 --> SS
  SS --> P7
  RB --> P7
  P3 --> RN
  RN --> PUB
  RB --> PUB
  PUB --> P7
  P3 --> P8PV
  P3 --> P8RD
  P8PV --> P8
  P8RD --> P8
  P4 --> P8
  P8 --> S2
  P8 --> BWS
  BWS --> BWV
  RB --> BWV
  BWV --> P7
  P5 --> P6
  P5 --> WS
  P5 --> FU9
  P3 --> FU11
  P4 --> FU12
  style P3 fill:#d4edda,stroke:#155724
  style P4 fill:#d4edda,stroke:#155724
  style P5 fill:#d4edda,stroke:#155724
  style FC fill:#d4edda,stroke:#155724
  style SS fill:#d4edda,stroke:#155724
  style RB fill:#d4edda,stroke:#155724
  style WS fill:#d4edda,stroke:#155724
  style FU9 fill:#d4edda,stroke:#155724
  style P8PV fill:#d4edda,stroke:#155724
  style P8RD stroke:#0366d6,stroke-width:4px
  style P8 stroke:#0366d6,stroke-width:4px
  style BWS stroke:#0366d6,stroke-width:4px
  style BWV stroke:#0366d6,stroke-width:4px
```
j0n4t pushed a commit to j0n4t/ComfyUI_frontend that referenced this pull request Oct 31, 2026
…portal (Comfy-Org#22398)

## Why

The app's Manage / Billing & invoices button opens
`billing.comfy.org/v1/payment-methods` for every prod user since
`hosted_billing_destination` went to 100% on Oct 22. That page was built
in FE-2331 (Comfy-Org#17809) without a design. Alex confirmed there is no Figma
for it, and it falls short of the Stripe portal it replaced:
- Every non-card saved method (Link, bank accounts, …) shows as the same
"Saved payment method" row, so customers see what look like duplicates
(Robin's report in #proj-billing).
- There is no way to change the default payment method.

Alex asked to route people back to Stripe's billing portal.

## Root cause

`PaymentMethodsPanel` renders its own list of `GET
/billing/payment-methods` and only names cards. The server lists every
attached method and fills `brand` / `last4` only for cards, so any other
type falls back to the generic label. Managing methods (add, remove, set
default) only exists in the Stripe portal.

## How

- The page opens the provider portal as soon as it loads, through the
existing `usePaymentPortal` (`commands.openPaymentPortal`, telemetry
unchanged).
- When the portal sends the visitor back (`portal=return`), the page
drops the marker and does not reopen the portal, so there is no loop. It
shows only "Manage payment methods" to open the portal again, next to
the existing "Return to ComfyUI" link.
- If the portal cannot be opened, the coded refusal shows with the same
button to try again.
- The saved-methods list and its copy are removed from this page.
`usePaymentMethods` stays in use by checkout.

billing-web deploys on its own, so this ships without an app release.
The app keeps sending Manage to billing-web; dropping that hop in the
app can follow separately.

## AS IS / TO BE

All API responses below come from the billing-web e2e mocks
(`apps/billing-web/e2e/fixtures/cloud.ts`); no real Cloud or Stripe
backend.

| AS IS | TO BE (arrival) | TO BE (after `portal=return`) |
| --- | --- | --- |
| <img
src="https://gist.githubusercontent.com/dante01yoon/2b4da2706a33775db0e482a22d2da31c/raw/fa470cc8fa79b1869e622631304cf70ea77339f3/asis-list.png"
width="320"> | <img
src="https://gist.githubusercontent.com/dante01yoon/2b4da2706a33775db0e482a22d2da31c/raw/fa470cc8fa79b1869e622631304cf70ea77339f3/tobe-arrival.png"
width="320"> | <img
src="https://gist.githubusercontent.com/dante01yoon/2b4da2706a33775db0e482a22d2da31c/raw/fa470cc8fa79b1869e622631304cf70ea77339f3/tobe-return.png"
width="320"> |
| `origin/main`, mocked `GET /billing/payment-methods` returns two cards
plus a `type: 'link'` method with no brand/last4; the Link method
renders as "Saved payment method". | Opening `/v1/payment-methods` goes
straight to the portal URL from the mocked `POST
/billing/payment-portal` (`https://billing-portal.test/session/e2e`, the
e2e stub page). | Returning with `?portal=return` stays on the page and
shows only "Manage payment methods" plus "Return to ComfyUI". |

## Testing

- `PaymentMethodsView.test.ts`: opens the portal on arrival without
reading the list, stays on the page after a return, reopens from the
button, shows the retry on a refused portal, plus the existing portal
telemetry rows.
- `e2e/payment-methods.spec.ts`: arrival lands on the portal URL; a
return keeps the page and the button opens the portal.
- Full billing-web unit suite passes (59 files, 1579 tests).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:xhigh PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants