Skip to content

fix(ui): 托盘悬停卡片的指标名称不再逐字母换行 - #153

Merged
Ray-lea merged 6 commits into
Ray-lea:mainfrom
digital-bombyx:fix/tray-card-labels
Nov 22, 2026
Merged

Ray-lea merged 6 commits into
Ray-lea:mainfrom
digital-bombyx:fix/tray-card-labels

Conversation

@digital-bombyx

Copy link
Copy Markdown
Contributor

改动概述 / Summary

托盘悬停卡片的指标名称列不再是固定的 40 px:宽度取当前语言中最长的名称,“Memory”“Network”等不再在字母之间换行,进度条仍然对齐。

The tray hover card's metric names no longer break between letters: the name column takes the width of the longest name in the current language instead of a fixed 40 px, and the bars stay aligned.

改动原因 / Motivation

复现:界面语言设为 English,将指针悬停在托盘图标上。名称列只有 40 px,“Memory”显示为“Memor / y”,“Network”显示为“Networ / k”;德文的“Arbeitsspeicher”更长。期望:每个名称在一行内显示,各行的进度条起点一致。

Repro: set the language to English and hover the tray icon. The 40 px name column shows "Memor / y" and "Networ / k" (German "Arbeitsspeicher" is longer still). Expected: each name on one line, bars starting at the same x.

改动思路 / Approach

用文本系统测量当前语言的四个名称(CPU、内存、GPU、网络),取最大值作为名称列的宽度,下限保持原来的 40 px,因此中文等较短的名称与改动前完全相同。名称不换行、不收缩。卡片宽度不变(252 px),德文最长名称下进度条仍有约 80 px。

Measure the four names with the text system and use the widest, never below the former 40 px, so short names (e.g. Chinese) look exactly as before. Names don't wrap or shrink. The card stays 252 px wide; with the longest German name the bars keep ~80 px.

改动明细 / Changes

  • tray.rs:card 接收 window 与 cx 以测量名称;四行共用同一名称列宽度(whitespace_nowrap、flex_shrink_0)。

影响与依赖 / Impact and dependencies

  • 影响范围 / Affected behavior: 仅托盘悬停卡片的名称列。
  • 兼容性与权限 / Compatibility and permissions: 无 / None.
  • 依赖 PR 与合并顺序 / PR dependencies and merge order: 无 / None.

改动后界面截图 / UI screenshots

改动前 / Before 改动后 / After
11111 22222

验证 / Validation

  • 验证提交或构建版本 / Tested commit or build: 36780f9,开发构建 cargo build -p argus --bin argus
  • 环境与数据来源 / Environment and data source: Windows 11 (26200),实时采集,英文界面,深色主题;独立测试标识 dev.argus.taskmanager.test.traycard
命令或操作步骤 / Command or steps 预期结果 / Expected 实际结果与证据 / Actual result and evidence
cargo build -p argus --bin argus 无警告 通过
英文界面下悬停托盘图标 CPU / Memory / GPU / Network 各在一行,进度条对齐 符合,见截图
  • 未覆盖的场景与原因 / Unverified scenarios and reasons: 未在德文界面与大字号下截图(计算按最长名称取宽,德文最长名称下进度条仍约 80 px);未运行完整 pnpm check(单文件布局改动)。

提交前检查 / Checklist

  • 标题与提交信息符合 Conventional Commits / The title and commit messages follow Conventional Commits.
  • 已完成与改动范围相符的验证,并填写实际结果 / Validation appropriate to the change is complete and actual results are recorded.
  • 涉及 UI 的改动已附可直接查看的改后截图,交互与显示行为修复同样适用 / UI changes include viewable after screenshots, including interaction and visibility fixes.
  • 涉及持续开销的改动已附对照测量 / N/A
  • 新增或修改文案已同步全部支持的语言,遵循术语表,并通过 pnpm i18n / N/A:无文案改动
  • 行为变化已同步相关文档及受影响的官网演示 / N/A:修复显示缺陷,行为不变
  • 依赖变化已更新 THIRD-PARTY-NOTICES.txt / N/A

名称列原为固定的 40 px,英文的 Memory、Network 和德文的 Arbeitsspeicher 放不下,
会在字母之间折行。现在名称列按当前语言中最长的名称取宽(不窄于原来的 40 px)且不换行,
各行的进度条仍然对齐。
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-20T08:45:30.006804Z
We couldn’t complete this review. Comment @codex review to try again.
36780f9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Ray-lea and others added 3 commits November 21, 2026 15:45
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>

@Ray-lea Ray-lea left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已核对测量字体与实际绘制字号。用德语模拟快照捕获了深色、浅色的托盘卡片,Arbeitsspeicher 单行完整显示,各进度条起点对齐。

Ray-lea and others added 2 commits November 21, 2026 16:20
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>
@Ray-lea
Ray-lea merged commit 67bbf7a into Ray-lea:main Nov 22, 2026
2 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.

2 participants