Skip to content

评论抽屉面板盖住底下的播放条 - #734

Merged
ShellMonster merged 2 commits into
mainfrom
work/drawer-covers
Nov 3, 2026
Merged

ShellMonster merged 2 commits into
mainfrom
work/drawer-covers

Conversation

@ShellMonster

@ShellMonster ShellMonster commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

User description

语义选择:面板盖住,不是蒙版盖住

用户要求「抽屉展开时要盖住底下的播放器(播放条)区域」。两种盖法里选了面板盖住:

  • 蒙版盖住(Bottom 也取 0):点播放条那条带 = 点蒙版 = 关抽屉——按播放会顺手把抽屉关了(queue_drawer.go 注释警告过的那个坑)。
  • 面板盖住:面板自己向下延伸遮住播放条——那一截底下的控件看不见也拿不到点击,而蒙版依然只在上面那段接「点外面」。✅ 选这个。

怎么盖的

蒙版照旧在窗口上面留出 playbarHeight(76;满屏时 fullControlsHeight = 108)那一截——它是「点外面」的那一层,盖住播放条那条带就会让按播放变成「点外面关抽屉」。

面板的 Bottom 是相对蒙版的:Bottom(0) 时它的下缘 = 蒙版底 − 76 = 窗口底 − 76。让 Bottom 取负值(-playbarHeight / -fullControlsHeight),面板就伸出蒙版的底边、贴着窗口下沿。

hit-test 按的是元素自己的框(mygo/ui/runtime.go 的 commitElement 记 Rect{e.x, e.y, e.w, e.h}),不查蒙版的裁切——所以面板虽然画在蒙版的底边下面,它那截伸出来的部分照样能吃点击、底下的播放条控件也够不到指针。

验证

  • TestTheCommentsDrawerPanelCoversThePlayBarStrip(新):断面板下缘贴到窗口底(改动前断到 824 = 900−76,改动后 900)。
  • TestTheCommentsDrawerDoesNotEatThePlayBarClick:照旧绿——蒙版让出的那一截还在,按播放不关抽屉。
  • TestRenderCommentsDrawerCoversPlayBarShot(新 shot):深浅各一张,右下角裁的是面板下缘和播放条交界。
  • 受影响测试(comments / queue / playbar)全绿;internal/ui 里有十几条基线上就红的用例(像素级断言,与本票无关,已用 git stash 对照过)。

队列抽屉

queue_drawer.go 同构——它的蒙版也留出 playbarHeight,面板 Bottom(0) 也悬在播放条上面。本票只改评论抽屉(用户只点了这一处);要不要队列抽屉也盖,是另一张票的事。

没跑真窗口 E2E

internal/e2e/ 那一族要开一个真应用、而评论键只在有歌在放时才摆——E2E 起的那一份没有歌(要么真登录、要么走「打开文件」那个原生对话框),两条路都塞不进测试。改用 Tester 量面板框 + shot 出图覆盖。

改动文件

  • internal/ui/comments_drawer.go:面板 Bottom 取负值 + 文件头和现场注释。
  • internal/ui/comments_drawer_test.go:TestTheCommentsDrawerPanelCoversThePlayBarStrip。
  • internal/ui/comments_shot_test.go:TestRenderCommentsDrawerCoversPlayBarShot。

CodeAnt-AI Description

Hide the playback bar behind the open comments drawer

What Changed

  • The comments drawer now extends to the bottom of the window, covering the playback bar; in fullscreen, it also covers the bottom control strip.
  • The dimming layer still stops above the playback area, so clicks there do not become outside-clicks that close the drawer.

Impact

✅ Playback bar hidden while comments are open
✅ Covered playback controls no longer receive clicks
✅ Playback-area clicks do not close the comments drawer

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

@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)
✅  #3adc4 Incremental review completed 967d476 Nov 03, 2026 · 01:41 01:41
✅  #642b7 Incremental review completed 84e77ec Nov 02, 2026 · 14:45 14:45
✅  #cadd0 Reviewed your PR 4cb4cf2 Nov 02, 2026 · 12:58 13:02

@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:M This PR changes 30-99 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,不启动真实登录态。

@codeant-ai

codeant-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt Nitpicks

1 code suggestion

1. When s.full.open is true, panelBottom is -108, not -76 as this comment states, so the documented panel position is wrong in fullscreen mode.

Comment mismatch · internal/ui/comments_drawer.go:35-36

@codeant-ai

codeant-ai Bot commented Nov 2, 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: 84e77ec3f97c

抽屉展开时底下的播放器(播放条)不该露出来——那是用户看到它浮在
**底下**的东西,而不是浮在它**上面**的东西。蒙版照旧留出
playbarHeight(76)那一截——它是「点外面」的那一层,盖住播放条
那条带就会让按播放变成「点外面关抽屉」(queue_drawer.go 警告过的
那个坑)。面板跟着留是另一回事:它的 Bottom 是相对**蒙版**的,
Bottom(0) 时它的下缘 = 蒙版底 − 76 = 窗口底 − 76——还不够。让面板
Bottom 取负值(−playbarHeight / −fullControlsHeight)就伸出蒙版的
底边、贴着窗口下沿:那一截底下的播放条被面板**藏在自己底下**,
看不见也点不到,而蒙版依然只在上面那段接「点外面」。

hit-test 按的是元素自己的框(runtime.go 的 commitElement),不查
蒙版的裁切——所以面板虽然画在蒙版的底边下面,它那截伸出来的部分
照样能吃点击、底下的播放条控件也够不到指针。

验证:TestTheCommentsDrawerPanelCoversThePlayBarStrip 断面板下缘贴
到窗口底;播放键那一条(TestTheCommentsDrawerDoesNotEatThePlayBar-
Click)照旧绿——蒙版让出的那一截还在,播放照旧点得动。
@ShellMonster
ShellMonster merged commit 99d1512 into main Nov 3, 2026
@ShellMonster
ShellMonster deleted the work/drawer-covers branch November 3, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant