Repository navigation
播放条左下三枚键的读数收成网易云式角标:挂在图形右上角外侧、不占布局 - #736
Merged
Merged
Conversation
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
PudMusic UI 截图截图测试已通过。
截图来自项目现有的 MyGo UI 测试渲染器,使用本地 fixture,不启动真实登录态。 |
| // 给可用宽,而 `fitWidth` 取 `min(内容, 可用)`——不钉 MinWidth 的话, | ||
| // 角标那一格被夹成 18,「1亿+」(23.61)就被截成「1亿…」,**那个「+」 | ||
| // 没了**(它是这一族的语义)。钉到 24.5 = 上限那一档,一格都不截。 | ||
| MinWidth(playbarBadgeMaxW).MaxWidth(playbarBadgeMaxW). |
There was a problem hiding this comment.
Suggestion: With 99k+, the 24.5px badge spans about 9px into the next button’s icon box, so its text collides with that icon instead of staying beside its own.
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Css layout issue
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** internal/ui/playbar_counts.go
**Line:** 297:297
**Comment:**
*Css Layout Issue: With `99k+`, the 24.5px badge spans about 9px into the next button’s icon box, so its text collides with that icon instead of staying beside its own.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
|
改之前那三枚键(赞 / 收藏 / 评论)是「图形 18 │ 缝 2 │ 数字」横排: 数字占一格,带数字的那一枚键因此宽 44.5,第三段比没有数字时宽出 37.5——900 宽的窗口上左列右端离进度条滑块只剩 5.20 像素。 现在改成角标:数字折成固定 9 号的小字(list.CountText 那一套折法, 约是图标高的 1/3、和图标的视觉重量拉得开),Attach(AnchorTopRight, AnchorTopLeft) 把角标的左上角钉在图形盒子的右上角——左缘贴图形 右缘、上缘贴图形上沿,数字整个在图形右上外侧、不压图标本体也不 内收。角标是绝对定位、不占布局、PassThrough 不登记命中——三枚键 各回到 32 宽(图形 18 + 两侧各 7),第三段从 165.5 缩回 137(四枚 32 + 三道 3 的键间缝——角标探出之后叠在缝上,没缝三枚带数的键糊 成一串),净让 28.5 给了进度条。 约束照旧:「+」是这一族的语义(至少这么多),所以字号钉死在 9 (系统文本放大 115% 就会截掉它)、上限钉在 22.5(刚好装下最宽的 「99k+」≈22.0)、MinWidth=MaxWidth 双钉(attach 按父盒子 18 给可用 宽,不钉的话那一格被夹成 18,「1亿+」的「+」就没了)、TextMuted 色、MaxLines(1) + Ellipsis 兜底(当前折法一档都用不上截断)。 E2E(internal/e2e/counts_test.go)走真窗口的无障碍树 + capture: 三枚键的名字里带数(赞 9k+ / 收藏 2k+ / 评论 1k+),而画面上图形 右缘贴边那一带和右上外侧那一带都有墨迹——横排版(数字中线 ≈ 键中心、左缘在缝后)和内收版(左缘在图形上)都红。
ShellMonster
force-pushed
the
work/count-badges
branch
from
November 2, 2026 13:55
70e0b06 to
8f61c41
Compare
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.
User description
改了什么
播放条左下那三枚键(赞 / 收藏 / 评论)的读数,从「图形 18 │ 缝 2 │ 数字」横排收成网易云式角标:数字折成固定 10 号的小字,骑在图形盒子的右上角外侧——数字的左缘贴着图形的右肩、上缘贴着图形的上沿,不压住图标本体,图形完整露出。
形态
Attach(AnchorTopRight, AnchorTopLeft)——角标的左上角钉在图形盒子(18×18)的右上角,再Right(1.5)往左收进图形右缘一点、Top(2.5)往下压到上沿。数字像挂在图形右肩上的小尾巴。PassThrough()不登记命中——底下的按钮照点、悬停照常。TextMuted、上限 24.5、左对齐、单行 + 省略号。覆盖的键
原来
countKeyRow管的三枚全收:赞(like.go,它那两层背景 + 拇指是绝对定位的,角标走同一份countBadge)、收藏、评论(comments_entry.go,走countKeyIcon)。宽度账
角标不占布局 ⇒ 三枚键各回到 32(图形 18 + 两侧各 7,和没有数字时一模一样),第三段从 165.5 缩回 128,左列保底 272——那 37.5 像素让给了进度条(900 宽的窗口上左列右端离滑块的余量从 5.20 回到 42.7)。数字探出图形右缘的那一段叠在右侧空白间距上,不进任何一列的宽度账。
铁律没破
「+」是这一族的语义(至少这么多),截断先切末尾、它总是第一个没——所以字号钉死、上限钉死、
MinWidth = MaxWidth双钉(attach按父盒子 18 给可用宽,不钉会把「1亿+」截成「1亿…」)。当前折法最宽的「99k+」24.49 ≤ 24.5,一档都不截。验证
TestTheThreeCountsSitAsBadgesOnTheIconsTopRight:角标上缘贴图形上沿(±nudge)、左缘落在图形右肩([图形中点, 图形右缘])、主体在图形右缘以右——三枚键全过。TestTheCountDoesNotSqueezeTheTitleOrTheSlider重写成「带不带数字,键都是 32、标题和进度条一个字都不让」。TestThePlayBarCountsSitAsBadges(BIU_RUN_MYGO_E2E=1,internal/e2e/):真窗口capture回来的 PNG 上按像素断——图形右肩那一带(图形右缘往右、贴上沿)有数字墨迹,而且左端骑在肩上(横排版的缝是空的,这里有墨)。无障碍树上按钮是leafRole、角标文本收进按钮的名字里(「赞 9k+」),所以像素层断的是画面事实。go build -trimpath -p 4 ./... && go vet -trimpath -p 4 ./... && go test -p 4 $(go list ./... | grep -v '/internal/ui$')过;internal/ui里TestThePlayBarCoverIsRoundedSix是基线上就挂的既有失败(与本票无关,git stash验证过)。无绑票。
CodeAnt-AI Description
Move playback counts to compact badges above and right of their icons
What Changed
Impact
✅ Clearer count placement✅ More clearance before the progress bar✅ Clickable playback buttons💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.