Repository navigation
[backport core/1.55] FE-3013 feat(pricing): read the plan's raw credit grant from the catalog - #19446
comfy-pr-bot wants to merge 1 commit into
Conversation
…log (#18873) ## Summary The pricing cards read the plan's raw credit grant from the backend (`Plan.credits`, added in Comfy-Org/cloud#10703) instead of the hardcoded `TIER_PRICING` figure. They fall back to the static grant only when the field is absent. - Follows #18867 (the FE-3013 hotfix). Part of FE-3013. - Comfy-Org/cloud#10703 is merged and live on test-v2. The generated `Plan.credits` type and its SDK projection landed on `main` through #19212, so this PR is now only the pricing surfaces reading it. Until prod serves the field, both tables fall back to the static grant. ## Why The hotfix #18867 stops misreading `credits_cents` by going back to a static grant. A static grant cannot follow a catalog change. Converting `credits_cents` cannot produce the real grant either, because the backend rounds it to whole cents: 23,887¢ → 50,402, while the catalog grants 50,400. The backend now sends the grant itself. ## Root cause `Plan` exposed the grant only as `credits_cents`. The raw count the subscription actually receives, the catalog's `credit_grant`, never reached the client. ## How - `Plan.credits` (generated types) and its safe-number projection in `billingPlansView.ts` are on `main` via #19212. - `UnifiedPricingTable.vue` / `PricingTableWorkspace.vue`: `plan.credits ?? amountForBillingCycle(static)`. The value is read straight off the server; nothing is derived. - Tests: the catalog grant wins over the static figure on the matching cycle only. The #18867 tests still pin the fallback (field absent) to the static grant. ## Screenshots Both builds run locally against the Comfy-Org/cloud#10703 preview backend (`pr-10703.testenvs.comfy.org`). The page's own `GET /api/billing/plans` response already carries `credits`: | slug | `credits_cents` | `credits` | | --- | --- | --- | | standard-monthly | 1,991 | 4,200 | | standard-annual | 23,887 | 50,400 | | creator-monthly | 3,508 | 7,400 | | creator-annual | 42,086 | 88,800 | | pro-monthly | 10,000 | 21,100 | | pro-annual | 120,000 | 253,200 | AS IS (#18867, `86fba0349b`, static grant): Yearly 50,400 / 88,800 / 253,200; Monthly 4,200 / 7,400 / 21,100. | Yearly | Monthly | | --- | --- | | <img width="480" alt="asis-yearly" src="https://github.com/user-attachments/assets/a790c178-0acd-4a1f-9f38-b1925ddbddc2" /> | <img width="480" alt="asis-monthly" src="https://github.com/user-attachments/assets/3dfb46e7-f7cc-486b-98af-8f49a15265ef" /> | TO BE (`a7270257f7`, reads `plan.credits`): same figures, Yearly 50,400 / 88,800 / 253,200; Monthly 4,200 / 7,400 / 21,100. The numbers now come from the API instead of the static table. | Yearly | Monthly | | --- | --- | | <img width="480" alt="tobe-yearly" src="https://github.com/user-attachments/assets/94eafd26-f717-4d31-a6c6-8d2e861617fe" /> | <img width="480" alt="tobe-monthly" src="https://github.com/user-attachments/assets/6e7733e0-71d1-44ee-9b43-b5f318dbcbe7" /> |
🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 6635cb05905e0086d88ea7de51f1e61295f6e685
Full docs: ADR-DEVEX-LINT-0015 🎭 Playwright: 🕵🏻 0 passed, 0 failed📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance
🔬 E2E Coverage
🧩 Custom Nodes Ecosystem Matrix: ✅ PassedExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff. Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md |
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 9 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 2887193 | Docs | View more details | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## core/1.55 #19446 +/- ##
=============================================
- Coverage 84.69% 84.69% -0.01%
=============================================
Files 2322 2322
Lines 132841 132843 +2
Branches 35638 33746 -1892
=============================================
- Hits 112507 112505 -2
- Misses 19982 19986 +4
Partials 352 352
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Closing without a core/1.55 backport. This change makes the Cloud pricing table read |
Pull request was closed
Backport of #18873 to
core/1.55Automatically created by backport workflow.