Skip to content

fix(keys): prevent rounded clipping of group names - #7645

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
jimmyleocn:fix/keys-group-text-clipping
Oct 6, 2026
Merged

seefs001 merged 1 commit into
QuantumNous:mainfrom
jimmyleocn:fix/keys-group-text-clipping

Conversation

@jimmyleocn

@jimmyleocn jimmyleocn commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Agent

  • Tool: OpenAI Codex
  • Tool version: codex-cli 0.159.0
  • Model (full id): gpt-6.1-sol
  • Host (CLI / IDE / GitHub coding agent / other): Codex coding agent
  • Date (UTC): 2026-10-02
  • AI assistance disclosure: 本代码及说明由 AI 辅助完成;提交者已审阅正文并要求发布。

Links

User request

  • Verbatim: 进行最小化修复。
  • Later constraints or corrections from the user:

好了破案了,我特地加了一个中文的“中文分组”,显示一样有问题的。

Out of scope — refuse

  • Matched: no
  • If yes, what was told to the user (stop here; do not open a PR): not applicable;仅涉及 API 密钥列表的文字显示。

Open gate — do not open unless all are satisfied

  • Out of scope (including pass-through-only forwarding): no
  • Usage / configuration / integration (answered instead of opening): no
  • Required issue facts present without invention: yes;见 [Bug] API 密钥列表的中文分组名称边缘被裁切 #7644。
  • Verification is actual commands or steps and observed results, not only go build or tests passed: yes;见 Verification。
  • Body is short and factual; no unfiltered AI-generated text: yes;用户已审阅并指定最终修改。
  • Open: yes
  • If no, what was told to the user (stop here): not applicable

Kind

  • Bug fix
  • New feature
  • Performance / refactor
  • Docs
  • Other:

Issue facts

  • Actual behavior: “用户分组”及显式设置的“中文分组”名称边缘笔画被裁切,像被不可见的圆角容器遮住。
  • Impact: 影响分组名称可读性;未报告密钥调用或计费异常。
  • Frequency: 用户提供的多条密钥截图中持续出现,继承分组与显式中文分组均有问题。
  • Evidence that the problem is in new-api rather than the client or upstream: 用户确认官方 v1.0.0-rc.41 可复现;官方组件存在零水平内边距、圆角和溢出裁切的组合。
  • Applicable types and their fields (relay / billing / frontend / deployment; write "not applicable" otherwise): Frontend:/keys,Chrome 126,默认主题;用户确认与 Console / Network 无关。Relay、billing、deployment:not applicable。

Change

为 API 密钥列表非 auto 分组的 GroupBadge 增加 type='text'。

该调用已使用 px-0,但默认徽标仍带圆角及固定高度,并受到 overflow-hidden 裁切。复用已有纯文字样式后,名称不再使用圆角裁切区域。

长名称截断、Tooltip、文字颜色,以及独立倍率和继承标签保持不变。仅修改一个文件、增加一行。

Research

Duplicate / prior art

Docs and code

  • https://docs.newapi.ai/ : 检查首页及管理使用入口,未找到针对该现象的配置说明。
  • https://deepwiki.com/QuantumNous/new-api : 请求返回 HTTP 429,未获取内容。
  • README / repo docs: 分组属于已有功能,未提供调整该文字裁切的配置。
  • Code paths and what they imply for this change: ApiKeyGroupCell 设置 px-0;GroupBadge 设置 overflow-hidden;内部 StatusBadge 默认带 rounded-4xl,已有 text 样式不带圆角。无需修改共享组件。

Alternatives considered

  • Option A: 修改共享 GroupBadge 的溢出策略或圆角样式。
  • Option B: 在当前单元格复用已有 type='text'。
  • Why this approach: Option B 匹配当前纯文字展示方式,保留截断能力,不影响其他页面的徽标样式。

Files

Path Why
web/src/features/keys/components/api-key-group-cell.tsx 为普通及继承分组名称指定已有纯文字样式,避免圆角裁切。

Behavior

  • Before: 名称取消水平内边距,但仍使用默认圆角徽标;靠近两端的中文笔画可能被裁切。
  • After: 名称使用纯文字样式,不再受到默认圆角边界裁切;倍率和继承标签仍独立显示。
  • Explicit non-goals / leftover work: 不修改分组数据、后端、计费、auto 分组逻辑或全局徽标样式。

Verification

  • Commands and results(前端命令在 web/ 执行):
    • bun run typecheck — 退出码 0,无类型错误。
    • bun x --no-install oxlint -c .oxlintrc.json --threads=4 src/features/keys/components/api-key-group-cell.tsx — 退出码 0。
    • bun x --no-install oxfmt --check --threads=4 src/features/keys/components/api-key-group-cell.tsx — 格式检查通过。
    • bun run test -- src/features/keys/components/__tests__/api-key-group-cell.test.tsx --maxWorkers=4 — 现有 9 项测试通过,覆盖倍率、继承标签、长名称 Tooltip 和 auto 分组显示。
    • git diff --check upstream/main...HEAD — 通过。
    • git diff --stat upstream/main...HEAD — 仅一个生产文件、一行新增,无测试文件改动;GitHub compare API 也确认一个提交、一个文件、+1/-0。
    • GitNexus impact — 一个直接调用方:API 密钥表格的 group 单元格;影响执行流 0,风险 LOW。
    • GitNexus detect_changes — 一个文件、一个符号 ApiKeyGroupCell,风险 low。
  • Manual steps and observed result: 报告者确认官方 v1.0.0-rc.41 在 Chrome 126、默认主题中可复现;Agent 未进行修复后的浏览器视觉验收。
  • UI: 当前未附修复前后对比截图;报告者将在 Issue 评论中补充问题截图。
  • Tests added or updated, or why none: 按用户要求仅提交单行生产代码修复,不新增或修改测试;已运行现有组件测试。
  • Databases / providers / platforms exercised: Windows 前端类型、lint、格式及 Vitest 检查;数据库和模型供应商 not applicable。
  • Not verified: 未运行此分支的生产构建或完整测试套件;未验证修复后的真实浏览器显示、其他浏览器、深色主题或不同字体与缩放比例。

Risks

  • Failure modes: 后续若该单元格重新使用默认圆角徽标并清零内边距,可能再次出现裁切。
  • Billing / quota / auth impact: 无;不修改倍率计算、额度、密钥数据或鉴权。
  • Follow-ups: 补充修复前后视觉对比。

Scope check

  • Single focused change: yes
  • Secrets included: no
  • Out of scope (Coding Plan / reverse-engineered channel / third-party wrapper / Codex / pass-through-only forwarding): no

Summary by CodeRabbit

  • Style
    • Updated the appearance of labels for manually assigned groups.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 97ed8918-63df-45ae-9703-2b70474beca2

📥 Commits

Reviewing files that changed from the base of the PR and between 1a4166d and ebc6da6.

📒 Files selected for processing (1)
  • web/src/features/keys/components/api-key-group-cell.tsx

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


Walkthrough

The API key group cell now sets GroupBadge to text for non-auto groups.

Changes

API key group badge

Layer / File(s) Summary
Non-auto group badge type
web/src/features/keys/components/api-key-group-cell.tsx
The non-auto group path now passes type='text' to GroupBadge.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: calcium-ion

Merge Risk: ⚪ Minimal · up to ebc6d

Non-auto group names receive the intended text styling, with the reported truncation, tooltips, and other labels unchanged. No merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing rounded clipping of API key group names.
Linked Issues check ✅ Passed The PR meets the coding requirements in [#7644]. In ApiKeyGroupCell, the non-auto path now passes type='text' to GroupBadge. This path covers ordinary groups and inherited groups. The existing…
Out of Scope Changes check ✅ Passed The PR changes one frontend call site for non-auto group display. It does not change group data, billing, backend behavior, auto-group logic, or global badge styles. The change stays within the disp…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

A rabbit checks the group badge glow
Text appears where group names go
No rounded edge to greet the day
The tiny patch hops on its way
A carrot waits beside the code
Then off the rabbit bounds and goes

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

@seefs001
seefs001 merged commit 973cf8e into QuantumNous:main Oct 6, 2026
3 checks passed
Javabcd pushed a commit to Javabcd/new-api that referenced this pull request Oct 9, 2026
timwenx pushed a commit to timwenx/new-api that referenced this pull request Nov 18, 2026
xiaolanawaqaq pushed a commit to xiaolanawaqaq/new-apiaaa that referenced this pull request Nov 26, 2026
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.

[Bug] API 密钥列表的中文分组名称边缘被裁切

2 participants