Skip to content

Docs/readme mod log - #5538

Closed
yunlongwen wants to merge 26 commits into
QuantumNous:mainfrom
yunlongwen:docs/readme-mod-log
Closed

Docs/readme mod log#5538
yunlongwen wants to merge 26 commits into
QuantumNous:mainfrom
yunlongwen:docs/readme-mod-log

Conversation

@yunlongwen

@yunlongwen yunlongwen commented Jun 16, 2026

Copy link
Copy Markdown

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Docker multi-arch image publishing workflow
    • Admin pricing editor for per-model cost/call-count settings
    • User ranking metric toggle between cost consumption and call count
  • Refactor

    • Removed language switching; UI now Chinese-only
    • Redesigned footer with Markdown link support; removed project attribution
    • Redesigned home page sections with dynamic system branding
    • Removed documentation link from home hero
  • Chores

    • Updated default system name to "Yunlong API"
    • Restructured and consolidated README files

Drop the convention rule that forbade modifying new-api/QuantumNous branding; renumber remaining rules (now Rules 1-7).
The project attribution was force-rendered alongside any custom footer set in System Settings, so the admin-configured Footer field could never show clean. Remove the ProjectAttribution component and its render sites.
Rewrite Hero/Features/Stats/HowItWorks/CTA to target relay end-users (models, pricing, stability, easy setup, sign-up bonus) instead of framework operators. Add zh.json translations. Model chips switched to domestic (GLM/DeepSeek/MiniMax/Kimi/Tongyi/Doubao).
Drop the hardcoded 'Designed by New API' line from both classic footer branches, matching the default theme.
Add an admin-only Edit Pricing entry in the default theme model detail drawer. Edits ModelRatio/CompletionRatio/ModelPrice via PUT /api/option/ (reuses system-settings option API); changes take effect immediately because the backend refreshes in-memory ratio maps on each PUT. Plaza data is refetched on save.
… count

Add a metric switch (费用消耗/调用次数) to the User Analytics ranking page.
Switching re-selects Top N users, the ranking bar chart, and the trend
chart to the chosen metric (count or quota). Default stays on quota,
preserving prior behavior. Frontend-only; backend already returns sum(count).
Drop the '文档'/Docs CTA from the landing hero (both guest and
authenticated states), keeping only Get Started + View Pricing (guest)
and Go to Dashboard (auth). Removes the now-dead renderDocsButton
helper, docsUrl, and unused BookOpen/useStatus imports.
feat(home): remove Docs button from homepage hero
Center the custom footer block (drop desktop left-align) and render its
content with the shared Markdown component (react-markdown + remark-gfm +
rehype-raw), so admins can write links like [ICP](https://beian.miit.gov.cn).
External links open in a new tab. Update the Footer field description
(en/zh) to hint Markdown support. Default multi-column footer unchanged.
feat(footer): center footer content and render Markdown links
Drop the logo + system name + 'Powerful API Management Platform'
brand block from the default (non-custom) footer, leaving just the
copyright/legal row. Tighten the footer padding and remove the now-
unused displayLogo/systemLogo. Demo-mode link columns are unaffected.
chore(footer): remove brand column from default footer
Replace 3 hardcoded 'PaopaoApi' strings in the homepage (hero
description, features heading, cta sentence) with i18next {{name}}
interpolation bound to the configured system name. Change the global
DEFAULT_SYSTEM_NAME from 'New API' to 'Yunlong API'. zh.json updated;
other locales fall back to the key string.
feat(home): use dynamic system name instead of hardcoded brand
Force i18next to a single language (lng/fallbackLng/supportedLngs = zh),
drop the browser language detector, and delete the en/fr/ja/ru/vi locale
files. Remove all language-switching UI (header switcher, setup wizard,
profile language-preferences card) and the now-unused language-switcher,
language-preferences-card, and i18n/languages modules. README rewritten
to a minimal Chinese note (clone source + customization log); other
language READMEs removed. zh.json content unchanged; t('English key')
still resolves to Chinese. Backend i18n untouched.
Design specs and step-by-step implementation plans for the user-ranking
metric toggle, footer centering + Markdown, and Chinese-only i18n/README
changes.
Manual (workflow_dispatch) multi-arch (amd64+arm64) build via the
standard Dockerfile, pushed to <DOCKERHUB_USERNAME>/new-api with
:latest, :sha-<short>, and optional :<version> tags. Runs on GitHub
Actions overseas runners because the CN build host cannot reach Docker
Hub. Requires DOCKERHUB_USERNAME and DOCKERHUB_TOKEN repo secrets.
Resolved the single modify/delete conflict on
language-preferences-card.tsx by keeping it deleted (the chinese-only
change removed all language UI). All other upstream changes merged
cleanly.
New brand icon for Agently: a rounded-square blue→violet gradient with a
white geometric 'A' and a spark accent (SVG source + 512px PNG). favicon.ico
regenerated from the same SVG (16/32/48/64 multi-size ICO) so the browser
tab icon matches. Replaces the upstream new-api logo.
Regenerate logo.png at 180x180 (was 512x512) to match the original
file's dimensions. Display is unchanged (CSS scales the img); this
aligns the asset with the prior file.
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6068cfbb-f1f0-458e-9aa9-4ba1a3a07fc6

📥 Commits

Reviewing files that changed from the base of the PR and between eb86311 and a1e4611.

⛔ Files ignored due to path filters (3)
  • web/default/public/favicon.ico is excluded by !**/*.ico
  • web/default/public/logo.png is excluded by !**/*.png
  • web/default/public/logo.svg is excluded by !**/*.svg
📒 Files selected for processing (45)
  • .github/workflows/docker-publish.yml
  • CLAUDE.md
  • README.en.md
  • README.fr.md
  • README.ja.md
  • README.md
  • README.zh_CN.md
  • README.zh_TW.md
  • docs/superpowers/plans/2026-06-14-model-square-pricing-edit.md
  • docs/superpowers/plans/2026-06-15-chinese-only-i18n-readme.md
  • docs/superpowers/plans/2026-06-15-footer-centering-markdown.md
  • docs/superpowers/plans/2026-06-15-user-ranking-metric-toggle.md
  • docs/superpowers/specs/2026-06-13-homepage-content-redesign-design.md
  • docs/superpowers/specs/2026-06-14-model-square-pricing-edit-design.md
  • docs/superpowers/specs/2026-06-15-chinese-only-i18n-readme-design.md
  • docs/superpowers/specs/2026-06-15-footer-centering-markdown-design.md
  • docs/superpowers/specs/2026-06-15-user-ranking-metric-toggle-design.md
  • web/classic/src/components/layout/Footer.jsx
  • web/default/src/components/language-switcher.tsx
  • web/default/src/components/layout/components/app-header.tsx
  • web/default/src/components/layout/components/footer.tsx
  • web/default/src/components/layout/components/public-header.tsx
  • web/default/src/features/dashboard/components/users/user-charts.tsx
  • web/default/src/features/dashboard/lib/charts.ts
  • web/default/src/features/dashboard/types.ts
  • web/default/src/features/home/components/sections/cta.tsx
  • web/default/src/features/home/components/sections/features.tsx
  • web/default/src/features/home/components/sections/hero.tsx
  • web/default/src/features/home/components/sections/how-it-works.tsx
  • web/default/src/features/home/components/sections/stats.tsx
  • web/default/src/features/pricing/components/edit-pricing-dialog.tsx
  • web/default/src/features/pricing/components/model-details.tsx
  • web/default/src/features/profile/components/language-preferences-card.tsx
  • web/default/src/features/profile/index.tsx
  • web/default/src/features/setup/setup-wizard.tsx
  • web/default/src/i18n/config.ts
  • web/default/src/i18n/languages.ts
  • web/default/src/i18n/locales/_reports/_sync-report.json
  • web/default/src/i18n/locales/en.json
  • web/default/src/i18n/locales/fr.json
  • web/default/src/i18n/locales/ja.json
  • web/default/src/i18n/locales/ru.json
  • web/default/src/i18n/locales/vi.json
  • web/default/src/i18n/locales/zh.json
  • web/default/src/lib/constants.ts

Walkthrough

This PR customizes the new-api fork for a Yunlong/Agently deployment. It adds a multi-arch Docker publish GitHub Actions workflow, locks the frontend to Chinese-only i18n by removing all language-switching infrastructure, rebrands all homepage sections with new copy and dynamic system name, adds an admin-only model pricing editor in the model square, adds a quota/call-count metric toggle to the user dashboard, centers the footer with Markdown rendering support, and removes all non-Chinese README files.

Changes

Multi-arch Docker Publish Workflow

Layer / File(s) Summary
Per-arch build and manifest creation
.github/workflows/docker-publish.yml
New workflow_dispatch workflow defines build_single_arch matrix jobs for amd64/arm64 (tag computation, Docker Hub auth, docker/build-push-action) and a create_manifests job that assembles :latest, :sha-<short>, and optional :<version> multi-arch manifests via docker buildx imagetools create.

Chinese-only i18n Lockdown

Layer / File(s) Summary
i18n config forced to zh; languages.ts deleted
web/default/src/i18n/config.ts, web/default/src/i18n/languages.ts, web/default/src/i18n/locales/_reports/_sync-report.json
config.ts removes all non-zh locale imports, drops i18next-browser-languagedetector, and hardcodes lng/fallbackLng/supportedLngs to zh. languages.ts and its three exports (INTERFACE_LANGUAGE_OPTIONS, InterfaceLanguageCode, normalizeInterfaceLanguage) are deleted along with the sync report.
LanguageSwitcher and LanguagePreferencesCard removed from all UI surfaces
web/default/src/components/language-switcher.tsx, web/default/src/components/layout/components/app-header.tsx, web/default/src/components/layout/components/public-header.tsx, web/default/src/features/setup/setup-wizard.tsx, web/default/src/features/profile/components/language-preferences-card.tsx, web/default/src/features/profile/index.tsx
LanguageSwitcher component deleted; removed from AppHeader, PublicHeader (including showLanguageSwitcher prop deletion), and SetupWizard. LanguagePreferencesCard deleted and removed from the Profile page.
Chinese-only i18n specs and plans
docs/superpowers/specs/2026-06-15-chinese-only-i18n-readme-design.md, docs/superpowers/plans/2026-06-15-chinese-only-i18n-readme.md
Spec and plan docs define the zh-only migration, file deletions, UI removals, and build/verification steps.

Homepage Content Rebrand

Layer / File(s) Summary
Hero, Stats, Features, HowItWorks, CTA sections rebranded
web/default/src/features/home/components/sections/hero.tsx, web/default/src/features/home/components/sections/stats.tsx, web/default/src/features/home/components/sections/features.tsx, web/default/src/features/home/components/sections/how-it-works.tsx, web/default/src/features/home/components/sections/cta.tsx, web/default/src/lib/constants.ts
DEFAULT_SYSTEM_NAME changed to 'Yunlong API'. Hero removes docs button and injects systemName. Stats replaces all four stat items. Features rewrites all card copy/icons and section heading with dynamic systemName. HowItWorks replaces step/heading keys. CTA injects systemName and updates headline/paragraph.
Homepage redesign spec
docs/superpowers/specs/2026-06-13-homepage-content-redesign-design.md
Design spec defines audience, section copy, i18n scope, model chips, and deployment assumptions.

Footer Centering and Markdown Rendering

Layer / File(s) Summary
Footer layout rework and Markdown rendering
web/default/src/components/layout/components/footer.tsx, web/classic/src/components/layout/Footer.jsx
Default footer.tsx imports Markdown, removes NEW_API_FOOTER_ATTRIBUTION_KEY and ProjectAttribution, drops logo handling, renders footerHtml via <Markdown> instead of dangerouslySetInnerHTML, and centers the default layout. Classic Footer.jsx replaces the attribution block with a copyright line.
Footer specs and plans
docs/superpowers/specs/2026-06-15-footer-centering-markdown-design.md, docs/superpowers/plans/2026-06-15-footer-centering-markdown.md
Spec and plan docs define the centering layout changes, Markdown rendering requirements, i18n value updates, and verification steps.

Admin Model Pricing Editor

Layer / File(s) Summary
EditPricingDialog: load, validate, save per-model pricing
web/default/src/features/pricing/components/edit-pricing-dialog.tsx
New component: readMap parses JSON option maps; useEffect on open fetches options and infers per-token vs per-request mode; toNum validates inputs; handleSave re-fetches, mutates the three maps per mode, calls updateSystemOption sequentially, shows toasts, and closes.
Admin-only Edit Pricing button in ModelHeader
web/default/src/features/pricing/components/model-details.tsx
Adds useAuthStore/ROLE/useState imports, derives isAdmin, introduces editOpen state, and conditionally renders the Edit Pricing button that opens EditPricingDialog with refetch on save.
zh.json and docs for pricing editor
web/default/src/i18n/locales/zh.json, docs/superpowers/specs/2026-06-14-model-square-pricing-edit-design.md, docs/superpowers/plans/2026-06-14-model-square-pricing-edit.md
zh.json adds pricing dialog translation keys. Design spec and plan define the admin-only entry point, dialog flow, permission constraints, scope exclusions, and verification steps.

User Dashboard Metric Toggle

Layer / File(s) Summary
UserRankMetric type, processUserChartData metric param, UserCharts Tabs
web/default/src/features/dashboard/types.ts, web/default/src/features/dashboard/lib/charts.ts, web/default/src/features/dashboard/components/users/user-charts.tsx
types.ts exports UserRankMetric = 'quota' | 'count'. charts.ts adds metric param with isCount/valueOf() switching aggregation, formatting, and titles. user-charts.tsx adds metric useState, passes it to processUserChartData, renders a Tabs control, and includes metric in VChart key.
zh.json and docs for metric toggle
web/default/src/i18n/locales/zh.json, docs/superpowers/specs/2026-06-15-user-ranking-metric-toggle-design.md, docs/superpowers/plans/2026-06-15-user-ranking-metric-toggle.md
zh.json adds Call Count, Cost Consumption, and ranking/trend label translations. Design spec and plan define the Tabs behavior, data field selection, i18n keys, and verification steps.

README and CLAUDE.md Housekeeping

Layer / File(s) Summary
README consolidation and CLAUDE.md renumbering
README.md, README.en.md, README.fr.md, README.ja.md, README.zh_CN.md, README.zh_TW.md, CLAUDE.md
README.md rewritten to a 14-line Chinese customization note. All other localized README files have their content removed. CLAUDE.md inserts a new Rule 5 heading and renumbers subsequent rules.

Sequence Diagram(s)

sequenceDiagram
  participant Admin
  participant ModelHeader
  participant EditPricingDialog
  participant getSystemOptions
  participant updateSystemOption
  participant usePricingData

  Admin->>ModelHeader: click "Edit Pricing" (isAdmin=true)
  ModelHeader->>EditPricingDialog: open(modelName)
  EditPricingDialog->>getSystemOptions: fetch ModelRatio/CompletionRatio/ModelPrice
  getSystemOptions-->>EditPricingDialog: current option maps
  Admin->>EditPricingDialog: edit ratio/price, click Save
  EditPricingDialog->>getSystemOptions: re-fetch (avoid overwrite)
  EditPricingDialog->>updateSystemOption: PUT ModelRatio
  EditPricingDialog->>updateSystemOption: PUT CompletionRatio
  EditPricingDialog->>updateSystemOption: PUT ModelPrice
  EditPricingDialog-->>ModelHeader: onSaved()
  ModelHeader->>usePricingData: refetch()
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • QuantumNous/new-api#2014: Adds a multi-arch Docker publishing workflow with the same per-arch build + manifest-creation pattern targeting Docker Hub.
  • QuantumNous/new-api#2008: Implements the same build_single_arch/create_manifests workflow structure for Docker Hub and GHCR.
  • QuantumNous/new-api#4876: Directly modifies web/default/src/components/language-switcher.tsx and web/default/src/i18n/*, overlapping with this PR's removal of the same language-switching infrastructure.

Suggested reviewers

  • Calcium-Ion

Poem

🐰 A rabbit hops in, speaks only in Chinese today,
Yunlong API blooms where New API once lay.
The footer now centers, with Markdown links in tow,
Admin edits pricing — just one click and go!
Cost or call count? Tabs make the dashboard sing,
Multi-arch Docker flies on every amd64 wing. 🌸

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Warning

⚠️ This pull request might be slop. It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

@yunlongwen yunlongwen closed this Jun 16, 2026
@yunlongwen yunlongwen reopened this Jun 16, 2026
@yunlongwen yunlongwen closed this Jun 16, 2026
@yunlongwen
yunlongwen deleted the docs/readme-mod-log branch June 22, 2026 08:22
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