Repository navigation
feat(web): simplified Claude/GPT price list on /pricing - #14
Merged
Nanako1900 merged 15 commits intoNov 8, 2026
Merged
Conversation
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…mantics Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…dows per model Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
… drawer Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-marketplace-design-bd442f # Conflicts: # web/src/i18n/locales/en.json # web/src/i18n/locales/fr.json # web/src/i18n/locales/ja.json # web/src/i18n/locales/ru.json # web/src/i18n/locales/vi.json # web/src/i18n/locales/zh-TW.json # web/src/i18n/locales/zh.json
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent
本 PR 的代码由 AI 辅助生成(提交者不是 new-api 的历史核心开发者)。
Links
/pricing简化为 Claude / GPT 价目表。User request
group_ratio倍率挂在分组上,模型标签不带倍率)。Out of scope — refuse
Open gate — do not open unless all are satisfied
go buildor tests passed: yesKind
Issue facts
/pricing。web/src/features/pricing/index.tsx、components/pricing-sidebar.tsx、components/pricing-toolbar.tsx、components/model-card.tsx(本 PR 之前的页面)。/pricing页面;billing — 只读显示,不改计费;relay / deployment — 不适用。Change
web/src/features/pricing/components/meow/):按家族(Claude / GPT,其余为「其他」)分卡片,卡片内按渠道分段。渠道 = 当前用户可用分组(排除auto),显示分组描述(经translateServerText翻译,空则用分组名)、倍率和可复制的令牌分组名;一个家族只有一个渠道时并入标题行。formatGroupPrice);按次计费合并为一格(formatFixedPrice);表达式计费合并为一格并复用ModelPriceCell(阶梯、分时、混合计费说明由它处理)。合并单元格带aria-colspan=3。GET /api/perf-metrics?model=X(已按分组返回)。每个模型一个请求,查询键与详情抽屉相同、共享缓存。指标桶可配置为分钟 / 5 分钟 / 小时,状态条按小时取平均;每个模型用自己的时间窗口。price !== usd_exchange_rate时显示。点击行打开现有详情抽屉(懒加载)。整页包在<main>中。web/src/lib/query-client.ts(上游文件,标注 MeowAPI):查询 meta 新增可选errorPage?: boolean,为false时 500 错误不跳/500。价目表的指标查询设为false,指标接口故障时价格照常显示、指标显示「—」。其它查询行为不变。web/src/routes/pricing/index.tsx(上游文件):只改导入和component两行,validateSearch/beforeLoad不变。旧Pricing组件保留未删除。Research
Duplicate / prior art
gh pr list --repo QuantumNous/new-api --state all --search「pricing page simplify」「model square redesign」「pricing group ratio channel」Docs and code
AGENTS.md、web/AGENTS.md(组件复用、i18n、toIntlLocale、测试规则)执行controller/pricing.goGetPricing:usable_group实际是「分组 → 描述字符串」(前端类型声明为对象,两种形态都兼容);group_ratio已按当前用户的用户组特殊倍率解析。controller/perf_metrics.go、pkg/perf_metrics/metrics.go:单模型接口返回groups[](含series),汇总接口不分组,因此不需要新后端接口;setting/perf_metrics_setting的桶大小可配置。service/group.go:分组描述是由前端翻译的英文源文本(如 "Default group")。web/src/lib/query-client.ts、web/src/main.tsx:任何查询的 500 都会跳转/500。Alternatives considered
meow-*文件,上游只改路由两行和查询客户端一个可选字段,便于合并上游。Files
web/src/features/pricing/lib/meow-catalog.tsweb/src/features/pricing/hooks/use-meow-channel-perf.tsweb/src/features/pricing/components/meow/*web/src/routes/pricing/index.tsxweb/src/lib/query-client.tserrorPage可选退出 500 跳转web/src/i18n/locales/*.jsonweb/src/features/pricing/__tests__/meow-*.test.*、web/src/lib/__tests__/meow-query-client-error-page.test.tsBehavior
/pricing?vendor=…等旧查询参数(如排行榜的供应商链接)被忽略,显示完整列表。/pricing/$modelId详情页与旧Pricing组件未改。Verification
web/,HEAD ab031f7):bun run typecheck:无类型错误(1530 个文件)bun run test src/features/pricing src/lib src/routes:28 个文件、421 个测试通过bun run build:成功bunx oxlint -c .oxlintrc.json …:退出码 0;bunx oxfmt -c .oxfmtrc.json --check …:格式正确bun run test(1db75843,最后几项修复之前):245 个文件、2752 个测试通过。实现子代理的两次全量运行中有不相关文件偶发失败(usage-logs/audit/viewer等),单独运行及在基线提交上均通过。git diff --numstat语言文件:7 个文件各5 0;受保护的转义 keyfooter.newapi…未变。errorPage: false、删除 500 跳转、删除channelModel的enable_groups固定 —— 对应测试均失败,恢复后通过。<main>)均已修复并补测试。meow-catalog.test.ts、meow-family-card.test.tsx、meow-pricing-catalog.test.tsx(使用真实createAppQueryClient,只 mock HTTP)、meow-pricing-route.test.ts、meow-query-client-error-page.test.ts。Risks
meta后写者生效,仅从抽屉触发的失败仍可能提示或跳转 500。?vendor=链接;模型增多时的批量指标接口。Scope check
🤖 Generated with Claude Code