Repository navigation
fix(ui): 托盘悬停卡片的指标名称不再逐字母换行 - #153
Merged
Merged
Conversation
名称列原为固定的 40 px,英文的 Memory、Network 和德文的 Arbeitsspeicher 放不下, 会在字母之间折行。现在名称列按当前语言中最长的名称取宽(不窄于原来的 40 px)且不换行, 各行的进度条仍然对齐。
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>
Ray-lea
approved these changes
Nov 22, 2026
Ray-lea
left a comment
Owner
There was a problem hiding this comment.
已核对测量字体与实际绘制字号。用德语模拟快照捕获了深色、浅色的托盘卡片,Arbeitsspeicher 单行完整显示,各进度条起点对齐。
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>
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.
改动概述 / 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
改动后界面截图 / UI screenshots
验证 / Validation
cargo build -p argus --bin argusdev.argus.taskmanager.test.traycardcargo build -p argus --bin arguspnpm check(单文件布局改动)。提交前检查 / Checklist
pnpm i18n/ N/A:无文案改动THIRD-PARTY-NOTICES.txt/ N/A