Skip to content

fix(website): localize API pricing rate units - #20299

Closed
benceruleanlu wants to merge 1 commit into
mainfrom
bl/website-localized-api-pricing
Closed

benceruleanlu wants to merge 1 commit into
mainfrom
bl/website-localized-api-pricing

Conversation

@benceruleanlu

@benceruleanlu benceruleanlu commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Localize Comfy API pricing units: Chinese pages currently show English hourly/monthly units, and mobile storage credit prices omit their per-GB/month basis.

Changes

  • What: Render complete rate and VRAM labels from the website catalogs with named amounts. Chinese labels use 小时, 月, 积分 and 显存; mobile storage retains its full billing unit in every locale.
  • What: Reuse the same rate rows in both layouts and preserve the rate-card values and two-decimal precision.

Review Focus

Independent follow-up to FE-2045; targets main without depending on #17903. The shared table serves the pricing and Comfy API pages. Japanese falls back to English for the new messages.

Validation: 38 focused tests pass across the pricing table, parent pricing section, rate card and catalogs. All three new locale cases fail against the original component. Targeted lint and the normal commit/push hooks pass, including website typecheck, Knip and Fallow. Chinese desktop (1280px) and mobile (390px) render correctly with no horizontal overflow or captured browser errors.

Screenshots

Before After
Chinese API pricing before localization Chinese API pricing after localization

@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
billing-web Ignored Ignored Oct 6, 2026 5:06am UTC
billing-web-test Ignored Ignored Oct 6, 2026 5:06am UTC

Request Review

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

🌾 Fallow: ✅ Passed

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.

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

Full docs: ADR-DEVEX-LINT-0015

🔗 Website Preview

Website Preview: https://comfy-website-preview-pr-20299.vercel.app

Models is built and gated by PostHog (workshop-enabled), using staging Cloud.

This commit: https://website-frontend-k0vvnn9bz-comfyui.vercel.app

Last updated: 2026-10-06T05:08:25Z for 1f747bd

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

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.

This candidate changes nothing the matrix measures, so every expensive stage was 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

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: bae883df-fd14-42f4-a445-4c0d35b2faeb
📥 Commits

Reviewing files that changed from the base of the PR and between 99ff869 and 1f747bd.

📒 Files selected for processing (5)
  • apps/website/src/data/rateCard.ts
  • apps/website/src/locales/en/main.json
  • apps/website/src/locales/zh-CN/main.json
  • apps/website/src/templates/platform/PricingSection.test.ts
  • apps/website/src/templates/platform/PricingSection.vue

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


📝 Walkthrough

Walkthrough

Pricing formatters now accept an optional locale and use translated messages for GPU and storage rates. PricingSection passes its locale to the formatters, renders translated VRAM and credit labels, and uses the same rate data for desktop and mobile lists. Tests cover English, Simplified Chinese, and Japanese.

Changes

Pricing Localization

Layer / File(s) Summary
Locale-aware price formatting
apps/website/src/data/rateCard.ts, apps/website/src/locales/en/main.json, apps/website/src/locales/zh-CN/main.json
The four pricing formatters accept an optional locale and use translated messages for hourly and storage prices and credits. English and Simplified Chinese pricing strings were added.
Pricing section locale wiring
apps/website/src/templates/platform/PricingSection.vue, apps/website/src/templates/platform/PricingSection.test.ts
PricingSection passes its locale to the formatters and renders translated GPU and storage labels. Mobile lists now use the same rate data as the desktop tables. Tests check locale-specific text in both layouts.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: drjkl, june-bump

Merge Risk: ⚪ Minimal · up to 1f747

The localized pricing tests cover the identified English fallback and Chinese rate-unit behavior. No pricing issue identified here needs correction before merge.

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
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.
End-To-End Regression Coverage For Fixes ✅ Passed The title contains the bug-fix signal “fix,” but the changed-file list shows changes exclusively under apps/website. The check explicitly excludes website-only changes because that package has its o…
Website End-To-End Regression Coverage ✅ Passed The changed files include website runtime code, but the described behavior change is limited to localized pricing and VRAM labels and the displayed storage billing unit. The check explicitly excludes …
Adr Compliance For Entity/Litegraph Changes ✅ Passed The changed files are limited to website pricing formatters, locale catalogs, and pricing components/tests. None are under src/lib/litegraph/, src/ecs/, or related to graph entities, so this check…
Title check ✅ Passed The title clearly and concisely describes the main change: localizing API pricing rate units.
Description check ✅ Passed The description covers the summary, changes, review focus, validation, and screenshots. It identifies the localization issue and the intended behavior.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@benceruleanlu
benceruleanlu deleted the bl/website-localized-api-pricing branch October 6, 2026 05:14
@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main   #20299      +/-   ##
==========================================
- Coverage   85.43%   85.31%   -0.13%     
==========================================
  Files        3519     3420      -99     
  Lines      168796   165683    -3113     
  Branches    44294    43229    -1065     
==========================================
- Hits       144219   141347    -2872     
+ Misses      22594    22503      -91     
+ Partials     1983     1833     -150     
Flag Coverage Δ
billing-web-unit ?
website-unit 79.91% <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/website/src/data/rateCard.ts 100.00% <100.00%> (ø)
.../website/src/templates/platform/PricingSection.vue 100.00% <ø> (ø)

... and 99 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant