Skip to content

feat(Dashboard): 趋势页签更名为「Requests」「Token / Vendor」「Token / Model」 - #323

Merged
ThreeFish-AI merged 3 commits into
feature/1.x.xfrom
rename-overview-tab-labels
Dec 1, 2026
Merged

ThreeFish-AI merged 3 commits into
feature/1.x.xfrom
rename-overview-tab-labels

Conversation

@ThreeFish-AI

Copy link
Copy Markdown
Owner

变更摘要

Overview 趋势图位的三个页签更名:「请求量」改为 Requests,「Token(按供应商)」改为 Token / Vendor,「Token(Vendor / 模型)」改为 Token / Model。只改页签文案,图表数据、交互与读屏摘要不动。

改动

  • src/coding/proxy/server/dashboard.py:三个页签按钮的文案。同时给 .trend-tab 钉 line-height: 18px:行高为 normal 时含汉字的标签行盒是 18px,纯英文标签只有 16px,更名后页签行会从 38px 缩到 36px,页签文字与右侧「近 N 天」的基线也会错开 1px,钉住后两项都与更名前一致。
  • tests/test_dashboard_overview.py:页签文案锚点 _TREND_TABS 同步;test_overview_css_constraints 增加 .trend-tab 行高断言。
  • docs/guide/dashboard.md:图表表里的三个名称同步,并按新的内容宽度重排列宽。
  • assets/dashboard/overview.png:README 首图重拍,页签处可见新名称。

验证

  • 全量 pytest:2284 passed;ruff check 与 ruff format 通过。
  • 隔离实例(本工作树)加 mock 数据,在 390 / 600 / 601 / 768 / 1024 / 1180 / 1440 七个视口宽度下逐项比较更名前后:页签行高、页签文字基线、与「近 N 天」的基线差都一致。页签条总宽由 378px 收到 316px;390px 仍折成两行,其余宽度单行且无横向滚动;1440 宽页面自然高度仍为 1269px。
  • README 首图:与更名前页面在同一环境下的截图逐像素比较,只有页签文字与选中下划线的长度不同(8,076 像素,包围盒 x 114–804、y 1730–1783),其余逐像素一致。

风险点

  • 只动文案与一条 CSS 声明,不涉及接口、数据与交互;页签 id、data-trend 与 ARIA 引用都没变,键盘切换不受影响。
  • 图表 canvas 的读屏摘要(「请求量趋势」「Token 量趋势(按供应商)」「Token 用量趋势(Vendor / 模型)」)不属于页签,仍是中文,本 PR 没改。
  • 首图里的等宽文字(版本徽标、KPI 数值、Model Calling 名称)沿用旧图的口径:旧首图是在 JetBrains Mono 没加载上时截的,等宽文字走系统回退字体,拦掉 Google Fonts 请求重截更名前的页面,与旧首图逐字节相同。提交 5a89934 先按加载了 JetBrains Mono 的口径截了一版,字形随之变了,85caf6d 改回旧口径,所以首图在历史里有三个版本,最终只比旧图多出页签处的变化。要把首图换成真字体的话,另起一个提交。
  • CHANGELOG 与版本号未改,发布时再写。

🤖 Generated with Claude Code

ThreeFish-AI and others added 3 commits December 1, 2026 15:44
页签文案由「请求量」「Token(按供应商)」「Token(Vendor / 模型)」改为英文,页签条总宽由 378px 收到 316px:390px 视口仍折成两行,其余视口单行且不出横向滚动。

更名后页签行矮了 2px(38px 到 36px),页签文字与右侧「近 N 天」的基线错开 1px。行高为 normal 时含汉字的标签行盒 18px,纯拉丁标签只有 16px,页签行高跟着文案语言变。给 .trend-tab 钉 line-height: 18px:390 到 1440 的 7 个视口宽度下,改前改后的页签行高与基线位置逐项一致,测试钉住这条声明。文档的图表表同步改名。

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
截图改用 Playwright 自带的 headless-shell 加本地字体快照,两次截图逐字节一致,尺寸仍为 2880×2538。与改前页面在同一环境下的截图相比,差异只在页签文字与选中下划线的长度(8,076 像素,包围盒 x 114–804、y 1730–1783)。

与入库首图相比,除页签外还有 JetBrains Mono 文字的差异(24,051 像素,字形略粗)。换浏览器内核或字体格式都复现不出入库图的字形,应是 11-28 截图时取到的字体文件不同;页面其余部分逐像素一致。

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5a89934 重拍的首图里 JetBrains Mono 加载成功,数值与名称的字形随之变了,这不属于页签更名。旧首图是在 JetBrains Mono 没加载上时截的,等宽文字走系统回退的 monospace:给改前页面拦掉 Google Fonts 请求重截,与旧首图逐字节相同(2880×2538,0 像素差异)。本次首图按同一口径重截,与旧首图相比只有页签文字与选中下划线的长度不同(8,076 像素,包围盒 x 114–804、y 1730–1783),其余逐像素一致。

5a89934 提交信息里「旧图的字体文件版本不同、复现不了」的说明有误,以本提交为准;历史按规约不改写。

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ThreeFish-AI
ThreeFish-AI merged commit 1e0a32f into feature/1.x.x Dec 1, 2026
6 checks passed
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