Skip to content

我的关注:左栏分组收成页头右上角的下拉(#367 改版) - #737

Merged
ShellMonster merged 3 commits into
mainfrom
work/follow-pane-to-header
Nov 3, 2026
Merged

ShellMonster merged 3 commits into
mainfrom
work/follow-pane-to-header

Conversation

@ShellMonster

@ShellMonster ShellMonster commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

User description

改动

  • 200 宽常驻分组栏 → 页头一枚「全部关注 ▾」下拉(follow.go 的 viewFollowPane 整列删除,viewFollowGroupSelect 接手):选组是主动动作,常驻一栏只为这一件事占地;内容区现在一行顶到窗口右缘。
  • 弹层里三态一句不少:加载中 / 「分组没拉出来」+ 原始错误 + 重试 / 「还没有分组」。「全部关注(N)」和第一个分组之间仍有一道分界。
  • 收起那一格写当前组名(followPaneTitle 复用),页头新增 24 号「我的关注」+ 总数徽章——页名不换,下拉跟着组换(上游 index.tsx:206 那支的口径)。
  • 下拉项画法照 enumSelect:高亮走 flatSolid 实心底,当前值淡底。
  • chevronSVG 解析一次缓存:每帧 MustParseSVG 实测 70 分配 / 5.4KB,关注页帧预算实测顶爆(+56 分配 / +5.9KB)。

修掉的两个真 bug(TDD 抓出来的)

  • SelectBase 的值绑在暂存格上 → choose() 写在输入处理里、回填在视图构建里跑,顺序反过来把用户那一选抹掉;改绑 f.tab 本体。
  • Changed() 放在 Popup 之前查 → applyInputs 跑的时候这帧的 Item 还没建出来,choose() 落空;改为放在 Popup 之后。

测试

  • follow_test.go / ticket213_test.go / realdata_test.go / currentitem_test.go 全部改为「断言前先点开下拉」;ticket213 换成弹层口径(分界线、长名截断、三态、收起那一格跟组换)。
  • follow_grid_test.go 列数断言 3→4(左栏收掉后同窗口网格宽 948→1148,过 1024 档)。
  • E2E 新族 internal/e2e/follow_test.go:真窗口上种假登录态 → 按 id 发 press 点侧栏「我的关注」→ 点开分组下拉 → Esc 收弹层。E2E 基础加 startRealAppWith / seedFakeSession(假 SESSDATA 只让侧栏那一项显示,B 站那拉真发真败——「分组没拉出来」是真实路径)。

验证

  • go build -trimpath -p 4 ./... && go vet -trimpath -p 4 ./... ✅
  • go test -p 4 $(go list ./... | grep -v '/internal/ui$') ✅
  • go test ./internal/ui/ 失败集与 main 对拍:仅计时噪声差异,无分支引入的失败
  • E2E:BIU_RUN_MYGO_E2E=1 go test -tags e2e ./internal/e2e/ -run TestTheFollowGroupSelect ✅(19.97s)
  • 帧预算实测:改版后 47 分配 / 2601 B,低于原上限 76/3000 与原基线 62/2297

CodeAnt-AI Description

将关注分组选项收进页头下拉,让关注列表获得更多空间

What Changed

  • 移除占据整列的分组栏,将分组选择移至页头下拉,关注内容区横向空间增加
  • 页头固定显示「我的关注」和关注总数;下拉收起时显示当前分组,切换分组后列表内容正确更新
  • 下拉保留加载中、加载失败及无分组三种提示;加载失败时可重试,并区分「没有分组」和「分组未加载成功」

Impact

✅ 更宽的关注列表
✅ 分组切换后显示对应关注内容
✅ 加载失败时可重试,空分组状态更清楚

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

- 200 宽常驻分组栏 → 页头一枚「全部关注 ▾」下拉,内容区一行顶到右缘
- 弹层里保留三态:加载中 / 分组没拉出来(可重试)/ 还没有分组,「全部
  关注(N)」和分组之间仍有一道分界
- 收起那一格写当前组名(followPaneTitle 复用);触发器 Label 固定「选择
  关注分组」让读屏和测试找得到人
- SelectBase 直接绑 f.tab 本体;Changed() 放在 Popup 之后查——
  applyInputs 跑的是弹层 Item 的 choose(),先查会永远漏掉那一选
- chevronSVG 解析一次缓存:每帧 MustParseSVG 实测 70 分配 / 5.4KB,会顶爆
  关注页的帧预算
- 网格列数断言 3→4:左栏收掉之后同窗口网格宽 948→1148,过 1024 那一档
- E2E 新族:真窗口上按 id 发 press 点开侧栏与下拉、Esc 收弹层;E2E 跑前
  先种假登录态(假 SESSDATA 只让侧栏显示那一项,B 站那拉真发真败)
@codeant-ai

codeant-ai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #daa4c Incremental review completed 0f64691 Nov 02, 2026 · 15:52 15:53
✅  #4763f Reviewed your PR 7338e42 Nov 02, 2026 · 14:48 14:57

@codeant-ai

codeant-ai Bot commented Nov 2, 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:XL This PR changes 500-999 lines, ignoring generated files label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

PudMusic UI 截图

截图测试已通过。

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

Comment thread internal/ui/follow.go
})

sel.Popup(func(panel ui.Element) {
popupPanel(t, panel.Grow(1).MaxWidth(280).Padding(space.Px4)).Children(func() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The popup renders every group without a height limit or scrolling, so a long group list or short window can leave later groups off-screen and unreachable.

Assessment: 🟠 Major · 🔁 Occurrence: Rarely · 🏷️ Css layout issue

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** internal/ui/follow.go
**Line:** 554:554
**Comment:**
	*Css Layout Issue: The popup renders every group without a height limit or scrolling, so a long group list or short window can leave later groups off-screen and unreachable.

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
👍 | 👎

@codeant-ai

codeant-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt Nitpicks

3 code suggestions

1. For a group with an empty name and positive count, name becomes “(N)” before this check, so the “这一组” fallback never appears.

Incorrect condition logic · internal/ui/follow.go:582-584


2. The prior group-item click closes the popup, so this condition becomes true as soon as the new account ID appears; it does not test whether reopening the menu shows the old count.

Incomplete implementation · internal/ui/follow_test.go:1090


3. Only one frame is allowed after opening, but tag loading is independent of the completed user request; the popup can still show loading and fail the new assertions.

Race condition · internal/ui/realdata_test.go:361-364

@codeant-ai

codeant-ai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🟡  Medium Risk

  • The PR needs attention before merging: the group popup has no visible height limit or scrolling, so long lists may put options beyond the window.

Assessed commit: 0f6469158c13

- E2E 两处把「全部关注」当「弹层开了/收了」的判据:它同时是触发器收起
  时写的字(停在全部关注那一格时),弹层收掉后它还在树上——gone 名单里
  有它这一条永远等不到。只能拿三态独有的三句。
- follow_test 的「页头画了我的关注/总数」判据是空的:侧栏里也有
  「我的关注」,Find/showsText 找到侧栏那一枚也算过。改成数「我的关注」
  有几枚(≥2 才说明页头画了)+ 总数「3」量在侧栏右缘之外。
- 过时时注释:网格登记的注释还写着「在分组栏之后登记」,分组栏已没了;
  竞争报告里的函数名 selectFollowTab 换成 applyFollowTab。
@ShellMonster
ShellMonster merged commit 80fc9da into main Nov 3, 2026
3 checks passed
@ShellMonster
ShellMonster deleted the work/follow-pane-to-header branch November 3, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant