Skip to content

FRONT-3856 feat(billing-web): open plan checkout from a billing handoff - #23493

Merged
dante01yoon merged 1 commit into
mainfrom
1.61-billing/front-3856-billing-web-plan-checkout
Nov 16, 2026
Merged

dante01yoon merged 1 commit into
mainfrom
1.61-billing/front-3856-billing-web-plan-checkout

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Plan position

Local ComfyUI and Desktop, with local_billing_web on, get Cloud's Subscribe / Choose a plan / Manage flow: Platform's Plans page signed in as the local account through the billing handoff, then the same billing-web checkout signed in as that account through a second, one-step handoff.

Item Ticket PR Status
Cloud: POST /api/auth/handoffs/checkout from a Platform handoff session; scoped access to the Plans routes BE-26567 https://github.com/Comfy-Org/cloud/pull/19366 In review
billing-web: a checkout handoff opens checkout for its plan FRONT-3856 this PR Open
Platform: Plans page inside the handoff tab, plan choice through the continuation FRONT-3856 https://github.com/Comfy-Org/platform/pull/1673 In review
Local: Subscribe / Choose a plan / Manage open Plans through the handoff FRONT-3856 #23496 In review
graph LR
  cloud["cloud PR 19366: checkout continuation + scoped Plans routes"] --> platform["platform PR 1673: Plans in the handoff tab"]
  cloud --> this["This PR: billing-web checkout handoff landing"]
  this --> platform
  platform --> local["PR 23496: local plan buttons through the handoff"]
  style this fill:#2563eb,stroke:#1e40af,color:#fff
Loading

Why

Alex's After M4 QA question (thread): with the handoff on, a local user with no plan has no button that leads to subscribing. Subscribe ↗ and Choose a plan ↗ are hidden because a plan choice ends on billing-web checkout, and a plain link there signs in as whoever is signed in to the browser. The decision is the same experience as Cloud. Platform's handoff tab will get a billing-web handoff for the chosen plan from Cloud (BE-26567); this PR is the billing-web half: that handoff has to land on checkout for the plan it names.

How

  • handoffLanding reads intent=checkout with plan and an optional team_credit_stop_id and lands on /v1/checkout with the handoff's usual product=comfyui&return_to=comfyui_credits, the same product and return target local top-up handoffs use. The entry is then parsed by the shared contract as any checkout link is, so a malformed plan or credit stop shows the contract's entry error (INVALID_PLAN, INVALID_TEAM_CREDIT_STOP_ID).
  • A checkout handoff without exactly one non-empty plan lands on billing home. Sending it to the planless checkout instead would bounce the tab to Cloud's pricing table, a browser-account surface.
  • The handoff session's workspace binding still wins over anything in the URL (unchanged; covered by the existing "ignores a workspace the URL names" test).
  • No other intent changes. Nothing changes outside a handoff tab, and nothing issues intent=checkout until the Cloud and Platform PRs land.

AS IS / TO BE

AS IS TO BE
pending: /handoff?intent=checkout&plan=… lands on billing home pending: it lands on checkout for that plan

Testing

  • pnpm exec vitest run src/router.test.ts in apps/billing-web: 70 passed, including the new landing cases (plan, plan + team credit stop, malformed plan, repeated credit stop, missing / empty / repeated plan).

  • The pre-commit hook ran oxfmt, oxlint (type-aware), eslint, the server-facts lint and typecheck:billing-web; the pre-push hook ran knip.

  • Part of FRONT-3856

A billing handoff whose intent is checkout now lands on checkout for the
plan (and team credit stop) it names, with the handoff's product and
return target, so Platform's handoff tab can send a plan choice to the
same checkout Cloud users get, signed in as the same account. A checkout
handoff without a single plan lands on billing home instead of the
planless checkout, which would bounce to a browser-account surface.
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The handoff router now sends checkout intents with a valid plan to checkout and carries an optional team credit stop ID. Tests cover missing or repeated query values, valid plans, and invalid-value handling.

Changes: Checkout handoff routing

Layer / File(s) Summary
Checkout route and query handling
apps/billing-web/src/router.ts, apps/billing-web/src/router.test.ts
The router builds checkout query parameters when plan is a nonempty string and includes team_credit_stop_id when present. Tests cover missing, empty, and repeated plan values, valid standard and team plans, plan normalization, and repeated team credit stop IDs.

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

Change: Feature

Possibly related PRs

Merge Risk: Minimal · up to 198c5

Checkout handoffs now open checkout for the named plan and fall back to billing home when no single plan is given. No merge-blocking risk was found.

Pre-merge checks: Passed 6

Check name Status Explanation
Title check Passed The title names the main change: billing-web checkout handoffs now open checkout for the named plan. It also keeps the ticket ID and the conventional-commit style. It is specific enough for a teammate…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description gives a clear summary of the change: checkout handoffs with a single non-empty plan land on billing-web checkout, and handoffs without one land on billing home. It explains the reason …
End-To-End Test Suggestion For User-Facing Changes Passed The check is not triggered. Condition 1 requires the diff to fix a bug or change a feature in the main frontend application under src/ or packages/. The changed files in the review context are onl…
Adr Compliance For Entity/Litegraph Changes Passed The check applies only when the PR changes files under src/lib/litegraph/, src/ecs/, or files related to graph entities (nodes, links, widgets, slots, reroutes, groups, subgraphs). The changed-fil…
Full details: Title check

Explanation

The title names the main change: billing-web checkout handoffs now open checkout for the named plan. It also keeps the ticket ID and the conventional-commit style. It is specific enough for a teammate scanning history, so the check passes.

Full details: Description check

Explanation

The description gives a clear summary of the change: checkout handoffs with a single non-empty plan land on billing-web checkout, and handoffs without one land on billing home. It explains the reason (a local user with no plan has no path to subscribe) and links the related Cloud, Platform, and local PRs. The Verification content lists the vitest command, the 70 passing tests and the hooks that ran. It has no explicit Fixes line, but the template marks that line optional. Remaining gaps: the Human QA step is not described, and the AS IS / TO BE table is left as pending. These are minor for a PR of this kind.

Full details: End-To-End Test Suggestion For User-Facing Changes

Explanation

The check is not triggered. Condition 1 requires the diff to fix a bug or change a feature in the main frontend application under src/ or packages/. The changed files in the review context are only apps/billing-web/src/router.ts and apps/billing-web/src/router.test.ts. Both sit under apps/billing-web/, outside src/ and packages/ at the repository root. The change adds checkout handoff landing to the billing-web app. Per the check's rules, I used only the supplied changed-file list and diff summary and did not run shell commands. Because condition 1 is not met, the check passes. The PR body also says the local plan buttons ship in a separate PR (ComfyUI_frontend#23496), which is not part of this diff.

Full details: Adr Compliance For Entity/Litegraph Changes

Explanation

The check applies only when the PR changes files under src/lib/litegraph/, src/ecs/, or files related to graph entities (nodes, links, widgets, slots, reroutes, groups, subgraphs). The changed-file list in the review context contains only apps/billing-web/src/router.ts and apps/billing-web/src/router.test.ts. Neither path falls under the check's scope. The PR description and objectives also describe billing-web handoff landing for intent=checkout, with no litegraph, ECS, or graph-entity changes. Because the check does not apply, it passes immediately. The primary PR author is dante01yoon, but the check does not evaluate author identity. Per the check's instructions, I did not run shell commands.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9e9382f and 198c591.

Files selected for processing: 2

  • apps/billing-web/src/router.test.ts
  • apps/billing-web/src/router.ts

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

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

No verdict is available. Open the workflow run to confirm the check was intentionally skipped, or fix the collection failure and re-run it.

Findings and check details

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

The matrix runs on same-repository version-bump PRs with relevant changes, main-branch pushes, and manual dispatches. This candidate does not qualify, so every expensive stage was skipped.

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

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

🌾 Fallow: ✅ Passed

Findings and check details

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

No new findings in the changed files.

Full docs: ADR-DEVEX-LINT-0015

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

🏛️ Architecture: ✅ Passed

Findings and check details

Warnings (518)

  • error-handling path matches no source files: src/utils/errorUtil.ts. Remove or update it in docs/architecture/domains/records/error-handling.domain.json.
  • graph-model path matches no source files: src/types/linkTopology.ts. Remove or update it in docs/architecture/domains/records/graph-model.domain.json.
  • graph-model path matches no source files: src/types/nodeState.ts. Remove or update it in docs/architecture/domains/records/graph-model.domain.json.
  • job-queue path matches no source files: src/platform/remote/comfyui/jobs/**. Remove or update it in docs/architecture/domains/records/job-queue.domain.json.
  • linear-mode path matches no source files: src/utils/appMode.ts. Remove or update it in docs/architecture/domains/records/linear-mode.domain.json.
  • link-connection path matches no source files: src/lib/litegraph/src/infrastructure/LinkConnectorEventMap.ts. Remove or update it in docs/architecture/domains/records/link-connection.domain.json.
  • node-widgets path matches no source files: src/types/widgetState.ts. Remove or update it in docs/architecture/domains/records/node-widgets.domain.json.
  • subgraphs path matches no source files: src/lib/litegraph/src/infrastructure/SubgraphEventMap.ts. Remove or update it in docs/architecture/domains/records/subgraphs.domain.json.
  • vue-node-widgets path matches no source files: src/types/positionConfig.ts. Remove or update it in docs/architecture/domains/records/vue-node-widgets.domain.json.
  • workspace path matches no source files: src/platform/workspace/fixtures/**. Remove or update it in docs/architecture/domains/records/workspace.domain.json.
  • packages/api-client/src/abortSignal.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/abortSignal.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/fetchRouteTemplate.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/fetchWithRetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/fetchWithRetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/retryPolicy.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/retryPolicy.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/statusRetryTelemetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/statusRetryTelemetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/comfyui-api-types/src/generated/index.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/comfyui-api-types/src/generated/types.gen.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/comfyui-api-types/src/index.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/formatUtil.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/formatUtil.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/geometry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/loadExternalScript.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/networkUtil.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/telemetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/telemetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/urlSafety.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/urlSafety.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/tailwind-utils/src/index.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/TopbarActions.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/searchbox/v2/filterChip.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/VideoConcatClipStrip.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/VideoConcatClipTile.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/VideoConcatPanel.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/VideoConcatPanel.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/VideoConcatPlaybackBar.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/WidgetVideoConcat.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/WidgetVideoConcat.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/__fixtures__/clipTiles.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/widgetHistory/WidgetHistoryButtons.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/widgetHistory/WidgetHistoryButtons.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/graph/menuOption.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useAgentExtensionActions.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useAgentExtensionActions.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useAgentExtensionNotices.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useAgentExtensionNotices.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useAgentSidebarTabs.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • …and 468 more

Full docs: Frontend domain catalog

Reproduce locally
pnpm architecture:check

@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@           Coverage Diff           @@
##             main   #23493   +/-   ##
=======================================
  Coverage   88.02%   88.02%           
=======================================
  Files        3173     3173           
  Lines      169935   169942    +7     
  Branches    43838    43843    +5     
=======================================
+ Hits       149584   149591    +7     
  Misses      19379    19379           
  Partials      972      972           
Flag Coverage Δ
billing-web-unit 92.01% <100.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
apps/billing-web/src/router.ts 94.23% <100.00%> (+0.41%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Nov 16, 2026
@dante01yoon
dante01yoon requested a review from vqt123 November 16, 2026 21:53
@vqt123

vqt123 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Starting review at 198c591.

@simonwu-comfy simonwu-comfy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed head 198c591 and surrounding handoff router, shared entry parser and workspace-binding guard. No blocking findings: missing/empty/repeated plans stay off planless checkout, invalid identifiers remain entry errors, and the session's workspace remains authoritative. Current CI: 40 passing, 39 skipped, no failures/pending. Source and CI review only; no local Vitest or deployed cross-service/browser flow was run. Deploy with the Cloud continuation and Platform changes in the documented order.

@vqt123

vqt123 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Approving at 198c591.

Clean: Correctness, Resilience, Access, Words, Contract, Vendor, Rollout, Rules, Cause.

Not covered:

  • Browser rendering and reload behavior: pnpm --filter @comfyorg/billing-web test:e2e.
  • Rollout across services: once BE-26567 is available, follow staging checkout handoffs for personal and team plans and confirm the selected plan and session workspace.

Checked: Read, not run: head/base handoff routing and shared identifier validation; plan and credit-stop propagation through both checkout implementations; handoff authentication and workspace binding.

~939k effective tokens for this review (4.6M raw; cache reads weighted 0.1x, cache writes 1.25-2x)

@dante01yoon
dante01yoon added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 7c591fc Nov 16, 2026
82 checks passed
@dante01yoon
dante01yoon deleted the 1.61-billing/front-3856-billing-web-plan-checkout branch November 16, 2026 22:27
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.

4 participants