Skip to content

FE-2218 feat(billing-web): own-origin session, sign-in and the billing SDK composition - #17807

Merged
dante01yoon merged 2 commits into
jaewon/fe-2331-account-ui-hosted-composablesfrom
jaewon/fe-2218-billing-web-session
Sep 16, 2026
Merged

dante01yoon merged 2 commits into
jaewon/fe-2331-account-ui-hosted-composablesfrom
jaewon/fe-2218-billing-web-session

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Linear FE-2218.

Stacked on #17799.

Why

apps/billing-web is a separate origin (billing.comfy.org) with no identity of
its own. Its README already states that billing data has to come through the
shared @comfyorg/account SDK, and the SDK's transport, readers and lifecycle
all take a SessionClient — so the app cannot read or command anything until it
holds its own session. The Workshop site already solved the same problem on its
own origin; this mirrors that wiring rather than inventing a second one.

How

  • src/config/env.ts selects the backend family from VITE_BILLING_ENV
    (production | staging | test, unknown or unset falls closed to test)
    and pairs it with the Cloud origin. Firebase config is read from
    VITE_FIREBASE_* because this origin is deployed separately; partial config
    yields no options at all, so the app boots and the sign-in page says sign-in
    is unavailable instead of throwing at import.
  • src/session/billingWebSession.ts builds one SessionClient lazily, with
    this origin's Firebase identity attached, exchanging at
    ${cloud}/api/auth/token and caching the credential in sessionStorage
    (survives a reload, never outlives the tab, keyed by uid).
    useBillingWebSession() projects the one snapshot as phase / user /
    session.
  • src/session/billingWebClient.ts is the single place the billing core is
    constructed: transport, five readers, lifecycle and both command surfaces.
    Mints are pinned to the workspace the session already holds;
    embeddedCheckoutAvailable is false, so every operation routes hosted.
  • BillingShell.vue provides the client and disposes it on unmount; App.vue
    keys the shell by uid:workspaceId, so sign-out or a workspace switch builds
    a fresh client instead of leaving readers serving the previous scope.
  • /sign-in ports the Workshop panel: email + password, Google and GitHub
    through @comfyorg/account/vue/SocialAuthButtons, the shared sign-in schema
    for validation, and forgot-password linking to the Cloud app's own page so
    password recovery stays one flow. The flow is one discriminated union plus a
    pure transition, as on the Workshop.
  • A router beforeEach guard holds every route but /sign-in behind
    phase === 'authenticated' and redirects otherwise with the path to come
    back to. Only a same-origin absolute path is honoured as a return
    destination.

Turnstile and the region gate are not wired: the Workshop applies both only in
sign-up mode, and this app has no sign-up.

AS-IS / TO-BE

AS-IS: / renders the static checkout page to anyone, with no identity behind it — nothing can call the billing API and no SDK client exists.

TO-BE: / redirects an unauthenticated visitor to /sign-in?returnTo=/, which offers Google, GitHub and email + password when VITE_FIREBASE_* are configured, and refuses sign-in with a notice when they are not.

AS-IS TO-BE

/ — static checkout, no identity

/ → /sign-in?returnTo=/

TO-BE, configured — email form filled, password revealed

TO-BE, VITE_FIREBASE_* absent — sign-in unavailable, controls disabled

Both TO-BE rows are this branch: the base branch has no /sign-in page to compare against. Captured at 1440×900 against vite preview with every non-localhost request blocked, so no identity provider is reached.

Testing

apps/billing-web unit tests (Vitest + @testing-library/vue, happy-dom):
environment family resolution and fail-closed rows, Firebase config read and
its partial-config cases, session snapshot projection driven through a fake
identity and a stubbed exchange, the credential cache (written once, served
back without a second mint, degrades when storage throws), the route guard per
session phase, return-destination sanitisation, the eight SDK client members
and disposal releasing every scope subscription, and the sign-in view's submit
and unavailable states.

Gates: pnpm typecheck, pnpm lint, pnpm format:check, pnpm knip,
pnpm --filter @comfyorg/billing-web build, fallow audit --changed-since.

Not in this PR

Hosted billing views over the client, the cookie transport, the ingest CORS
entry for this origin (CORS_ORIGIN), and the Vercel environment values.

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 this PR
8 ui billing-web /v1 entry routing + subscription / payment-method surfaces FE-2331 next, stacked on 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 BWS 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: 2376efb2-86f9-4475-9026-181346022237

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

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

🎭 Playwright: ✅ 2014 passed, 0 failed · 3 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1993 / ❌ 0 / ⚠️ 3 / ⏭️ 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)

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 09/16/2026, 12:23:47 PM UTC

Links

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 63.6 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 61.7 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 61.5 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 75.7 MB heap
large-graph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 79.7 MB heap
large-graph-pan: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 68.7 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 71.3 MB heap
legacy-node-drag: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 79.0 MB heap
minimap-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 77.0 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 73.5 MB heap
subgraph-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.9 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 63.0 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 132ms TBT · 96.0 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 72.3 MB heap
vue-large-graph-idle: · 55.4 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 165.3 MB heap
vue-large-graph-pan: · 55.4 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 63ms TBT · 172.7 MB heap
vue-node-resize-workload: · 56.2 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 407ms TBT · 166.2 MB heap
vue-zoom-out-idle: · 57.1 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 179.7 MB heap
workflow-execution: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 62.0 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 8ms
canvas-idle: layout count 0
canvas-idle: style recalc count 8
canvas-idle: task duration 543ms
canvas-idle: script duration 11ms
canvas-idle: TBT 0ms
canvas-idle: heap used 63.6 MB
canvas-idle: DOM nodes -266
canvas-idle: event listeners -154
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 5ms
canvas-mouse-sweep: style recalc duration 37ms
canvas-mouse-sweep: layout count 14
canvas-mouse-sweep: style recalc count 78
canvas-mouse-sweep: task duration 936ms
canvas-mouse-sweep: script duration 166ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 61.7 MB
canvas-mouse-sweep: DOM nodes -264
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 17ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 32
canvas-zoom-sweep: task duration 345ms
canvas-zoom-sweep: script duration 12ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 61.5 MB
canvas-zoom-sweep: DOM nodes 76
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 11
dom-widget-clipping: task duration 443ms
dom-widget-clipping: script duration 158ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 75.7 MB
dom-widget-clipping: DOM nodes 17
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 4ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 5
large-graph-idle: task duration 624ms
large-graph-idle: script duration 38ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 79.7 MB
large-graph-idle: DOM nodes -249
large-graph-idle: event listeners -168
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 13ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 67
large-graph-pan: task duration 1588ms
large-graph-pan: script duration 815ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 68.7 MB
large-graph-pan: DOM nodes -256
large-graph-pan: event listeners -167
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 15ms
large-graph-zoom: style recalc duration 12ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 61
large-graph-zoom: task duration 1723ms
large-graph-zoom: script duration 794ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 71.3 MB
large-graph-zoom: DOM nodes -128
large-graph-zoom: event listeners 9
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 7ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 42
legacy-node-drag: task duration 1993ms
legacy-node-drag: script duration 996ms
legacy-node-drag: TBT 0ms
legacy-node-drag: heap used 79.0 MB
legacy-node-drag: DOM nodes -134
legacy-node-drag: event listeners 1
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 6ms
minimap-idle: layout count 0
minimap-idle: style recalc count 6
minimap-idle: task duration 610ms
minimap-idle: script duration 34ms
minimap-idle: TBT 0ms
minimap-idle: heap used 77.0 MB
minimap-idle: DOM nodes -255
minimap-idle: event listeners -169
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 11ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 47
subgraph-dom-widget-clipping: task duration 419ms
subgraph-dom-widget-clipping: script duration 147ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 73.5 MB
subgraph-dom-widget-clipping: DOM nodes 20
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 8ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 10
subgraph-idle: task duration 497ms
subgraph-idle: script duration 9ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 65.9 MB
subgraph-idle: DOM nodes -276
subgraph-idle: event listeners -215
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 6ms
subgraph-mouse-sweep: style recalc duration 29ms
subgraph-mouse-sweep: layout count 18
subgraph-mouse-sweep: style recalc count 77
subgraph-mouse-sweep: task duration 801ms
subgraph-mouse-sweep: script duration 111ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 63.0 MB
subgraph-mouse-sweep: DOM nodes -276
subgraph-mouse-sweep: event listeners -217
subgraph-transition-enter: avg frame time 17ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 12ms
subgraph-transition-enter: style recalc duration 29ms
subgraph-transition-enter: layout count 5
subgraph-transition-enter: style recalc count 18
subgraph-transition-enter: task duration 981ms
subgraph-transition-enter: script duration 32ms
subgraph-transition-enter: TBT 132ms
subgraph-transition-enter: heap used 96.0 MB
subgraph-transition-enter: DOM nodes 13587
subgraph-transition-enter: event listeners 2387
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 41ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 247
viewport-pan-sweep: task duration 5830ms
viewport-pan-sweep: script duration 2688ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 72.3 MB
viewport-pan-sweep: DOM nodes -249
viewport-pan-sweep: event listeners -138
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 17483ms
vue-large-graph-idle: script duration 310ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 165.3 MB
vue-large-graph-idle: DOM nodes -6542
vue-large-graph-idle: event listeners -7479
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 22ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 157
vue-large-graph-pan: task duration 21729ms
vue-large-graph-pan: script duration 892ms
vue-large-graph-pan: TBT 63ms
vue-large-graph-pan: heap used 172.7 MB
vue-large-graph-pan: DOM nodes -6542
vue-large-graph-pan: event listeners -7472
vue-node-resize-workload: avg frame time 18ms
vue-node-resize-workload: p95 frame time 17ms
vue-node-resize-workload: layout duration 27ms
vue-node-resize-workload: style recalc duration 77ms
vue-node-resize-workload: layout count 20
vue-node-resize-workload: style recalc count 20
vue-node-resize-workload: task duration 6513ms
vue-node-resize-workload: script duration 126ms
vue-node-resize-workload: TBT 407ms
vue-node-resize-workload: heap used 166.2 MB
vue-node-resize-workload: DOM nodes -6542
vue-node-resize-workload: event listeners -7475
vue-zoom-out-idle: avg frame time 17ms
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 7839ms
vue-zoom-out-idle: script duration 130ms
vue-zoom-out-idle: TBT 0ms
vue-zoom-out-idle: heap used 179.7 MB
vue-zoom-out-idle: DOM nodes 0
vue-zoom-out-idle: event listeners -11
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 2ms
workflow-execution: style recalc duration 19ms
workflow-execution: layout count 5
workflow-execution: style recalc count 8
workflow-execution: task duration 94ms
workflow-execution: script duration 8ms
workflow-execution: TBT 0ms
workflow-execution: heap used 62.0 MB
workflow-execution: DOM nodes 129
workflow-execution: event listeners 18
Raw data
{
  "timestamp": "2026-09-16T12:04:22.622Z",
  "gitSha": "d4de241a29b3f6a7baac1ca594af52d4ae05eda4",
  "branch": "jaewon/fe-2218-billing-web-session",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2035.5200000000195,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 7.947000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 576.4209999999999,
      "heapDeltaBytes": 2769984,
      "heapUsedBytes": 65198824,
      "domNodes": -263,
      "jsHeapTotalBytes": 4186112,
      "scriptDurationMs": 11.838000000000001,
      "eventListeners": -154,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-idle",
      "durationMs": 1996.403999999984,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 7.078999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 508.6090000000001,
      "heapDeltaBytes": 6727552,
      "heapUsedBytes": 68257044,
      "domNodes": -268,
      "jsHeapTotalBytes": 4972544,
      "scriptDurationMs": 10.720999999999998,
      "eventListeners": -154,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1981.4350000000331,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 37.105,
      "layouts": 14,
      "layoutDurationMs": 5.243,
      "taskDurationMs": 975.1519999999999,
      "heapDeltaBytes": 10321128,
      "heapUsedBytes": 71235532,
      "domNodes": -265,
      "jsHeapTotalBytes": 6021120,
      "scriptDurationMs": 173.41400000000002,
      "eventListeners": -156,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1916.0389999999552,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 36.412,
      "layouts": 14,
      "layoutDurationMs": 5.112,
      "taskDurationMs": 896.647,
      "heapDeltaBytes": -4596340,
      "heapUsedBytes": 58106228,
      "domNodes": -262,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 158.84599999999998,
      "eventListeners": -186,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1738.3030000000304,
      "styleRecalcs": 31,
      "styleRecalcDurationMs": 18.334,
      "layouts": 6,
      "layoutDurationMs": 1.4460000000000002,
      "taskDurationMs": 355.80999999999995,
      "heapDeltaBytes": 2187952,
      "heapUsedBytes": 64625016,
      "domNodes": 75,
      "jsHeapTotalBytes": 4718592,
      "scriptDurationMs": 13.072000000000005,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1738.8260000000173,
      "styleRecalcs": 32,
      "styleRecalcDurationMs": 14.86,
      "layouts": 6,
      "layoutDurationMs": 1.1630000000000003,
      "taskDurationMs": 333.45000000000005,
      "heapDeltaBytes": 2164256,
      "heapUsedBytes": 64443272,
      "domNodes": 76,
      "jsHeapTotalBytes": 4718592,
      "scriptDurationMs": 11.459,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 678.8070000000062,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 7.758999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 440.355,
      "heapDeltaBytes": 17092756,
      "heapUsedBytes": 78340032,
      "domNodes": 18,
      "jsHeapTotalBytes": 5767168,
      "scriptDurationMs": 158.125,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 662.1350000000348,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 6.593999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 444.8139999999999,
      "heapDeltaBytes": 17863692,
      "heapUsedBytes": 80417280,
      "domNodes": 16,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 158.143,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2023.2659999999782,
      "styleRecalcs": 4,
      "styleRecalcDurationMs": 3.653,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 657.633,
      "heapDeltaBytes": 3628904,
      "heapUsedBytes": 83401228,
      "domNodes": -250,
      "jsHeapTotalBytes": -794624,
      "scriptDurationMs": 42.54999999999999,
      "eventListeners": -184,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2024.5160000000624,
      "styleRecalcs": 5,
      "styleRecalcDurationMs": 4.262000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 590.8729999999998,
      "heapDeltaBytes": 3550168,
      "heapUsedBytes": 83734560,
      "domNodes": -247,
      "jsHeapTotalBytes": -1318912,
      "scriptDurationMs": 33.51899999999999,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2218.0779999999913,
      "styleRecalcs": 68,
      "styleRecalcDurationMs": 15.044999999999996,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1574.436,
      "heapDeltaBytes": -13752208,
      "heapUsedBytes": 65592224,
      "domNodes": -259,
      "jsHeapTotalBytes": 2875392,
      "scriptDurationMs": 833.386,
      "eventListeners": -182,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2174.54500000008,
      "styleRecalcs": 65,
      "styleRecalcDurationMs": 11.169000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1600.762,
      "heapDeltaBytes": 13800264,
      "heapUsedBytes": 78490304,
      "domNodes": -253,
      "jsHeapTotalBytes": 1273856,
      "scriptDurationMs": 796.999,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3618.069999999989,
      "styleRecalcs": 62,
      "styleRecalcDurationMs": 13.403000000000002,
      "layouts": 60,
      "layoutDurationMs": 15.265,
      "taskDurationMs": 1750.3000000000002,
      "heapDeltaBytes": 9856936,
      "heapUsedBytes": 75148860,
      "domNodes": -256,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 802.609,
      "eventListeners": 10,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3555.1900000000387,
      "styleRecalcs": 60,
      "styleRecalcDurationMs": 11.079999999999997,
      "layouts": 60,
      "layoutDurationMs": 14.668999999999999,
      "taskDurationMs": 1694.7210000000002,
      "heapDeltaBytes": 8066452,
      "heapUsedBytes": 74281044,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 785.78,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3197.575000000029,
      "styleRecalcs": 43,
      "styleRecalcDurationMs": 8.157000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 2055.385,
      "heapDeltaBytes": -4384500,
      "heapUsedBytes": 78206792,
      "domNodes": -267,
      "jsHeapTotalBytes": 6438912,
      "scriptDurationMs": 1017.372,
      "eventListeners": -187,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.80000000000109
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3074.2910000000165,
      "styleRecalcs": 40,
      "styleRecalcDurationMs": 5.337999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1930.687,
      "heapDeltaBytes": 20804932,
      "heapUsedBytes": 87473844,
      "domNodes": 0,
      "jsHeapTotalBytes": 942080,
      "scriptDurationMs": 975.4390000000001,
      "eventListeners": 188,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "minimap-idle",
      "durationMs": 2037.112000000036,
      "styleRecalcs": 5,
      "styleRecalcDurationMs": 5.150000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 614.6709999999999,
      "heapDeltaBytes": -3477992,
      "heapUsedBytes": 83884644,
      "domNodes": -248,
      "jsHeapTotalBytes": -1019904,
      "scriptDurationMs": 34.163,
      "eventListeners": -154,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "minimap-idle",
      "durationMs": 2043.933999999922,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 6.915000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 606.24,
      "heapDeltaBytes": -3240112,
      "heapUsedBytes": 77585684,
      "domNodes": -261,
      "jsHeapTotalBytes": 253952,
      "scriptDurationMs": 33.93,
      "eventListeners": -184,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 604.5750000000112,
      "styleRecalcs": 47,
      "styleRecalcDurationMs": 10.775,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 418.91599999999994,
      "heapDeltaBytes": 13556344,
      "heapUsedBytes": 77169656,
      "domNodes": 20,
      "jsHeapTotalBytes": 5242880,
      "scriptDurationMs": 146.749,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 620.60299999996,
      "styleRecalcs": 47,
      "styleRecalcDurationMs": 11.433,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 419.5460000000001,
      "heapDeltaBytes": 13205016,
      "heapUsedBytes": 76889360,
      "domNodes": 20,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 146.57500000000002,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2003.1810000000405,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 8.636,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 528.946,
      "heapDeltaBytes": 1281416,
      "heapUsedBytes": 64944452,
      "domNodes": -275,
      "jsHeapTotalBytes": 4448256,
      "scriptDurationMs": 10.719,
      "eventListeners": -230,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 1999.9919999999065,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 7.716000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 464.23600000000005,
      "heapDeltaBytes": 9695520,
      "heapUsedBytes": 73320536,
      "domNodes": -276,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 8.266000000000002,
      "eventListeners": -200,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1730.1009999999906,
      "styleRecalcs": 76,
      "styleRecalcDurationMs": 30.075,
      "layouts": 18,
      "layoutDurationMs": 6.308,
      "taskDurationMs": 832.875,
      "heapDeltaBytes": 7991784,
      "heapUsedBytes": 71506588,
      "domNodes": -280,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 116.513,
      "eventListeners": -202,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1704.1869999999335,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 28.599,
      "layouts": 18,
      "layoutDurationMs": 5.502999999999999,
      "taskDurationMs": 770.0559999999999,
      "heapDeltaBytes": -3040648,
      "heapUsedBytes": 60715932,
      "domNodes": -272,
      "jsHeapTotalBytes": 5234688,
      "scriptDurationMs": 104.755,
      "eventListeners": -232,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 1403.825999999981,
      "styleRecalcs": 18,
      "styleRecalcDurationMs": 28.519000000000002,
      "layouts": 5,
      "layoutDurationMs": 12.157000000000002,
      "taskDurationMs": 981.1189999999998,
      "heapDeltaBytes": 19318908,
      "heapUsedBytes": 100616136,
      "domNodes": 13587,
      "jsHeapTotalBytes": 11272192,
      "scriptDurationMs": 32.022999999999996,
      "eventListeners": 2387,
      "totalBlockingTimeMs": 132,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8413.825000000032,
      "styleRecalcs": 247,
      "styleRecalcDurationMs": 43.035000000000004,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5980.9400000000005,
      "heapDeltaBytes": -3612236,
      "heapUsedBytes": 75926688,
      "domNodes": -248,
      "jsHeapTotalBytes": -602112,
      "scriptDurationMs": 2739.4449999999997,
      "eventListeners": -138,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8350.889999999936,
      "styleRecalcs": 246,
      "styleRecalcDurationMs": 38.378,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5679.145,
      "heapDeltaBytes": -4301336,
      "heapUsedBytes": 75766084,
      "domNodes": -250,
      "jsHeapTotalBytes": 479232,
      "scriptDurationMs": 2636.7180000000003,
      "eventListeners": -138,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 17791.171999999962,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 17517.465,
      "heapDeltaBytes": -15057816,
      "heapUsedBytes": 187044068,
      "domNodes": -6542,
      "jsHeapTotalBytes": 2826240,
      "scriptDurationMs": 306.638,
      "eventListeners": -7478,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.780000000000047,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 17729.799999999956,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 17448.197,
      "heapDeltaBytes": -30934536,
      "heapUsedBytes": 159679864,
      "domNodes": -6542,
      "jsHeapTotalBytes": 413696,
      "scriptDurationMs": 312.718,
      "eventListeners": -7480,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 18.333333333333332,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 21915.999,
      "styleRecalcs": 157,
      "styleRecalcDurationMs": 22.437000000000012,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 21790.587000000003,
      "heapDeltaBytes": -38510496,
      "heapUsedBytes": 176088588,
      "domNodes": -6542,
      "jsHeapTotalBytes": 2056192,
      "scriptDurationMs": 907.752,
      "eventListeners": -7470,
      "totalBlockingTimeMs": 54,
      "frameDurationMs": 17.779999999999927,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 21789.817000000083,
      "styleRecalcs": 156,
      "styleRecalcDurationMs": 21.774000000000015,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 21667.579,
      "heapDeltaBytes": -16034756,
      "heapUsedBytes": 186157724,
      "domNodes": -6542,
      "jsHeapTotalBytes": -536576,
      "scriptDurationMs": 876.129,
      "eventListeners": -7474,
      "totalBlockingTimeMs": 71,
      "frameDurationMs": 18.330000000000048,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 6598.563000000013,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 79.36399999999999,
      "layouts": 20,
      "layoutDurationMs": 29.448,
      "taskDurationMs": 6571.754999999999,
      "heapDeltaBytes": -43688132,
      "heapUsedBytes": 175055612,
      "domNodes": -6542,
      "jsHeapTotalBytes": 8814592,
      "scriptDurationMs": 131.466,
      "eventListeners": -7473,
      "totalBlockingTimeMs": 442,
      "frameDurationMs": 17.779999999999927,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 6493.65499999999,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 73.83599999999998,
      "layouts": 20,
      "layoutDurationMs": 25.414999999999992,
      "taskDurationMs": 6454.5689999999995,
      "heapDeltaBytes": -22217832,
      "heapUsedBytes": 173406512,
      "domNodes": -6542,
      "jsHeapTotalBytes": 19341312,
      "scriptDurationMs": 120.593,
      "eventListeners": -7476,
      "totalBlockingTimeMs": 372,
      "frameDurationMs": 17.780000000000047,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 9032.746999999972,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 8925.174,
      "heapDeltaBytes": 3108640,
      "heapUsedBytes": 190989440,
      "domNodes": 0,
      "jsHeapTotalBytes": -6815744,
      "scriptDurationMs": 144.39800000000002,
      "eventListeners": -12,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 6888.302000000067,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 6753.026999999997,
      "heapDeltaBytes": 26022156,
      "heapUsedBytes": 185765176,
      "domNodes": 0,
      "jsHeapTotalBytes": 8126464,
      "scriptDurationMs": 115.38800000000005,
      "eventListeners": -10,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.220000000000073,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "workflow-execution",
      "durationMs": 124.9000000000251,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 20.017,
      "layouts": 4,
      "layoutDurationMs": 2.1639999999999997,
      "taskDurationMs": 102.66200000000003,
      "heapDeltaBytes": 3147404,
      "heapUsedBytes": 65201048,
      "domNodes": 131,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 9.174000000000001,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "workflow-execution",
      "durationMs": 106.6040000000612,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 17.604000000000003,
      "layouts": 6,
      "layoutDurationMs": 2.5709999999999997,
      "taskDurationMs": 84.726,
      "heapDeltaBytes": 3009788,
      "heapUsedBytes": 64906688,
      "domNodes": 126,
      "jsHeapTotalBytes": 524288,
      "scriptDurationMs": 6.1930000000000005,
      "eventListeners": 17,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.800000000000182
    }
  ]
}

🔬 E2E Coverage

Metric Covered Total Pct
Lines 50912 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

@github-actions github-actions Bot added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Sep 16, 2026
@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-2331-account-ui-hosted-composables   #17807      +/-   ##
================================================================================
+ Coverage                                         82.54%   82.55%   +0.01%     
================================================================================
  Files                                              2841     2844       +3     
  Lines                                            141762   141865     +103     
  Branches                                          38035    36215    -1820     
================================================================================
+ Hits                                             117012   117113     +101     
- Misses                                            23544    23545       +1     
- Partials                                           1206     1207       +1     
Flag Coverage Δ
unit 78.55% <100.00%> (+0.01%) ⬆️
website-unit 74.60% <ø> (ø)

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 9 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.

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

The guard and return path fail closed, the credential cache is tab-scoped and uid-guarded, the client is built and disposed once per scope, and both fetches behind it are bearer-authenticated at the fetch default credentials mode. Nothing blocking.

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 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
dante01yoon force-pushed the jaewon/fe-2331-account-ui-hosted-composables branch from 99c6306 to 44b705e Compare September 16, 2026 12:14
@dante01yoon

dante01yoon commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

This went CONFLICTING/DIRTY because its base jaewon/fe-2331-account-ui-hosted-composables (#17799) was restacked. The branch still carries its own older copies of c59f59d8a2 / ab1b86234e / 326b86fcf7, while the new base tip 44b705e7de carries rewritten versions of the same commits, so git merge-tree reports 11 conflicts — 10 of them add/add on the plans / paymentMethods / usePlans / usePaymentMethods / usePreviewSubscribe pairs, plus one content conflict in src/platform/workspace/billing/sdk/createBillingSdk.ts. None of that is a real content divergence; it is only the stale base.

The restack drops all four lower commits and replays only the two that belong to this PR:

git rebase --onto origin/jaewon/fe-2331-account-ui-hosted-composables 326b86fcf7
git push --force-with-lease

I ran it in a throwaway worktree to confirm: Rebasing (1/2) (2/2) Successfully rebased, zero conflicts, leaving feat(billing-web): own-origin session, sign-in and the billing SDK composition and the #17809 merge commit on top of 44b705e7de (60 files, +3738/-42 against the base).

Not doing it here: this PR is already approved, and a force-push would dismiss that approval.

…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
dante01yoon force-pushed the jaewon/fe-2218-billing-web-session branch from cce907e to 2235a40 Compare September 16, 2026 12:21
@dante01yoon
dante01yoon merged commit 37a8ccb into jaewon/fe-2331-account-ui-hosted-composables Sep 16, 2026
58 checks passed
@dante01yoon
dante01yoon deleted the jaewon/fe-2218-billing-web-session branch September 16, 2026 12:23
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
```
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