Repository navigation
换页的时候把四层浮层收掉:评论/队列抽屉、分集浮层、倍速菜单 - #735
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,不启动真实登录态。 |
ShellMonster
force-pushed
the
work/drawer-close-nav
branch
from
November 2, 2026 14:53
0865d45 to
023a7a1
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.
什么
评论抽屉(以及其它浮层)开着的时候换页,浮层不收——盖的是上一页的东西悬在新页上。报告的是「评论抽屉开着 → 点播放条上的 UP 主 → 换到 UP 空间页,抽屉还在」。
为什么收在
syncRoute而不是navigatenavigate只走得到「调用方调了s.navigate」的那几条道,而换页不止那一条:ui.BackButton/ForwardButton是框架控件——按下去直接r.Go(±1),走 Router 自己的历史,根本不经过 Shell;navigateBack)走s.router.Back();goLogin走s.router.Push;s.navigate。syncRoute(internal/ui/notfound.go)是「换页了」唯一的收口:它在syncUnderlay里每帧跑,拿s.shownPath的边沿认出换页——任何一条换页路径都会过它。收哪几层(
closeOverlaysForNav)对抗性审查之后收齐到 16 个标志,两类:
commentsOpen、drawerOpen、queueClearOpen(清空队列确认不是抽屉的一部分,抽屉收了它状态还活着,下次开抽屉直接复活——状态泄漏)。partOpen、rateOpen、sleepOpen、volOpen、errDetailOpen、searchSuggest、avatarMenuOpen、dynMenuOpen、favPanelOpen、full.partsOpen、lyric.offsetOpen/lyric.fontOpen、fullLyric.offsetOpen/fullLyric.fontOpen。收的是「意图」(
open=false),不是阶段机——commentsPhase/drawerPhase各自的syncXxx会走drawerOut,面板滑出那 200ms 照旧。Popover 的「点外面自己关」对换页无效,必须显式收。明确不收的(取舍写成显式决策,见函数顶上那段)
folderEdit/crop/folderSelect/folderDelete):装着用户敲了一半的输入,换页收掉等于静默丢工作。laterClearOpen、collection.confirm、downloads.ask、local.rmOpen):没回答完的问题,doIt闭包攥着页面上下文,换页不该替用户回答。lyricSearch.open/preview):同上,词和候选是用户的工作。full.open):它是播放面不是浮层。验证
internal/ui/notfound_test.go四条新测试——前进收、后退收、联想单独一条(它和抽屉在无头 Tester 里造不出同框:抽屉蒙版盖住搜索框)、阶段机走drawerOut不硬消失。连同既有 404 一族全绿。internal/e2e/drawer_nav_test.go的TestNavigatingClosesTheQueueDrawer(队列抽屉代评论抽屉:评论入口要在线曲目,CLI 交的本地文件开不出;队列抽屉是同一副 Overlay +RoleDialog骨架、同一个收口)。BIU_RUN_MYGO_E2E=1 go test -tags e2e ./internal/e2e/ -run TestNavigatingClosesTheQueueDrawer通过。Modal,模态开着时无障碍树只给模态内的节点,页面上没有可按的键——菜单是系统画的、不走元素树,也是真人换页唯一还点的着的路。startRealApp:裸go build不注入packageFileExtensionsldflags(那是go tool mygo build的事),命令行音频文件一件都投不出去——补了startRealAppWithArgs并带上那行 ldflags。go build -trimpath -p 4 ./...、go vet -trimpath -p 4 ./...、go test -p 4 $(go list ./... | grep -v '/internal/ui$')全过。TestThePartsPanelSaysWhyWhenTheyCannotBeAsked在基线上也偶发(waitFrames等到PartsErr的那一拍和把手画上之间差一帧)——先记在这里,和这一票无关。