Skip to content

关注页卡片清爽化:瘦卡 + 加列(参照网易云关注页) - #740

Merged
ShellMonster merged 2 commits into
mainfrom
work/follow-slim
Nov 3, 2026
Merged

ShellMonster merged 2 commits into
mainfrom
work/follow-slim

Conversation

@ShellMonster

@ShellMonster ShellMonster commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

User description

改动

  • 瘦卡:头像边长 128→96,卡内留白 16→12,名字字号 18→16,签名 MaxLines(2)→MaxLines(1)
  • 加列:新增 followColumnsFor,关注页专属断点表(1536/1280/1024/768 → 7/6/5/4,<768→3),与首页歌卡断点刻意不同——人像卡比歌卡窄,密度参照网易云关注页
  • 用户 2026-11-03 拍板,偏离上游 HeroUI 的原因已写进注释

新旧列数对照

容器宽 旧(歌卡表) 新(人像卡表)
≥1536 6 7
≥1280 5 6
≥1024 4 5
≥768 3 4
<768 2 3
兜底 2 3

测试

  • 新增 follow_cols_test.go:followColumnsFor 断点边界断言 + 瘦卡尺寸断言(头像 96、留白 12、名字 16、签名一行)
  • 更新 follow_grid_test.go:1400 窗口下 5 列(原 4 列),留白断言 16→12
  • 更新 follow_test.go:名字字号断言 18→16,签名加一行断言
  • 更新 follow_grid_shot_test.go:列数等待逻辑改用 followColumnsFor,注释更新

Shot PNG(深浅两套):

  • /tmp/follow-slim-shots/45-浅色-关注-网格行间距.png
  • /tmp/follow-slim-shots/45-深色-关注-网格行间距.png

验证

  • go build -trimpath -p 4 ./... ✅
  • go vet -trimpath -p 4 ./... ✅
  • go test -p 4 $(go list ./... | grep -v '/internal/ui$') ✅
  • go test ./internal/ui/ -run 'Follow|CardCol|AvatarE2E|BackToTop|DisplayMode|CurrentStyle' ✅
  • go test ./internal/e2e/ -run Follow:跳过(e2e 编译错是 main 上已知问题,见 AGENTS.md 允许清单)

已知风险

  • 内部 UI 全量测试有大量 main 上本来红的测试(非本票引入),已对照确认本票相关的 follow 测试全绿
  • hover 操作条数值未改:卡片变矮后操作条仍从底边 16 升起 80,视觉上仍正确(见 shot PNG)

CodeAnt-AI Description

Make followed-user cards more compact and show more per row

What Changed

  • Follow cards use smaller avatars and names, tighter spacing, and a one-line signature
  • The follow page fits 3–7 cards per row depending on the available width

Impact

✅ More followed creators per row
✅ Shorter, more compact follow cards

💡 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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

- 头像边长 128→96,卡内留白 16→12,名字字号 18→16,签名 MaxLines(2)→MaxLines(1)
- 新增 followColumnsFor:关注页专属断点表(1536/1280/1024/768 → 7/6/5/4,<768→3),
  与首页歌卡断点刻意不同(人像卡比歌卡窄,密度参考网易云关注页)
- 更新相关测试与注释,注明用户 2026-11-03 拍板
@codeant-ai

codeant-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #5f610 Reviewed your PR 8721f35 Nov 03, 2026 · 02:32 02:38

@codeant-ai

codeant-ai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

PudMusic UI 截图

截图测试已通过。

截图来自项目现有的 MyGo UI 测试渲染器,使用本地 fixture,不启动真实登录态。

@codeant-ai

codeant-ai Bot commented Nov 3, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt Nitpicks

1 code suggestion

1. This short fixture signature fits on one line; restoring MaxLines(2) still keeps its height below 25, so the new checks miss that regression.

Possible bug · internal/ui/follow_cols_test.go:65

@codeant-ai

codeant-ai Bot commented Nov 3, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: 8721f3559d86

viewFollowCardGuarded 原来调 selectedCell(i, f.cols)——f.cols 要等
keepFollowAnchor 先拿旧列数算完锚点、画完这一段才换,而格子已经按新
列数摆了。换列数那一帧高亮拿旧列数去算「游标在第几格」,落错行:
选中行秃掉最后一格、下一行多一块环。

viewFollowRow 把它正在摆的 cols 顺着传下来,selectedCell 吃这一帧的
列数。f.cols 的赋值时序不动(keepFollowAnchor 依赖先算锚点后换列数)。

过渡帧无头 Tester 截不到(SetSize/Frame 内部会把帧推进到底),回归
钉在源码上:不许把 f.cols 递回给 selectedCell。

grid.go 那张表的注释也顺手换了:它管的是歌卡密度,人像卡更密那张表
在 follow.go——别让人把 followColumnsFor 改回去。
@ShellMonster
ShellMonster merged commit a70559d into main Nov 3, 2026
2 of 3 checks passed
@ShellMonster
ShellMonster deleted the work/follow-slim branch November 3, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant