Repository navigation
FRONT-3856 feat(billing-web): open plan checkout from a billing handoff - #23493
Conversation
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.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure
Findings and check detailsExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight 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: ✅ PassedFindings and check detailsFallow 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: ✅ PassedFindings and check detailsWarnings (518)
Full docs: Frontend domain catalog Reproduce locallypnpm architecture:check |
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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Starting review at 198c591. |
simonwu-comfy
left a comment
There was a problem hiding this comment.
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.
|
Approving at 198c591. Clean: Correctness, Resilience, Access, Words, Contract, Vendor, Rollout, Rules, Cause. Not covered:
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) |
Plan position
Local ComfyUI and Desktop, with
local_billing_webon, 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.POST /api/auth/handoffs/checkoutfrom a Platform handoff session; scoped access to the Plans routesWhy
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
handoffLandingreadsintent=checkoutwithplanand an optionalteam_credit_stop_idand lands on/v1/checkoutwith the handoff's usualproduct=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).planlands on billing home. Sending it to the planless checkout instead would bounce the tab to Cloud's pricing table, a browser-account surface.intent=checkoutuntil the Cloud and Platform PRs land.AS IS / TO BE
/handoff?intent=checkout&plan=…lands on billing homeTesting
pnpm exec vitest run src/router.test.tsinapps/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