Conversation
This branch has not been deployed
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.
改动类型
是否包含破坏性变更
改动说明
新增「听歌排行」页面(
/ranking),读取当前登录用户的网易云听歌排行,提供「最近一周」与「所有时间」两个榜单,可整单播放或追加到播放列表,并在每行显示播放次数。页面复用
SongList,因此搜索、批量管理、右键菜单、红心等能力与普通歌单一致,只是多一列播放次数;结构对齐既有的Liked.vue。主要改动:
src/pages/Ranking.vue(229 行):页面本体。首次进入时并发拉取两个榜单,之后切换 tab 不再请求;用Promise.allSettled允许单边失败,只渲染成功的一侧。src/apis/user/netease.ts:新增fetchPlayRanking(uid, range)。type=1(一周)与type=0(所有时间)返回的字段名不同(weekData/allData),已在 JSDoc 中注明;曲目转换复用既有的songToTrack()。src/types/user.ts:新增PlayRankingRange与PlayRankingEntry。src/components/list/SongList.vue:新增extraHeader/extra两个 slot(共 +2 行)。没有加playCountsprop,是为了让列表组件保持通用,列宽与文案由页面自己掌控。electron/main/apis/netease/index.ts:将user_record加入NON_CACHEABLE。该模块在迁移到内置 NCM API 时就已存在,但此前没有任何渲染层调用;它原本会命中 2 分钟响应缓存(core/cache.ts的DEFAULT_TTL),导致「刷新排行」在 2 分钟内点了没反应,而播放次数恰好是刷新后想立刻看到变化的场景。sidebarNav.ts、DEFAULT_SIDEBAR_NAV_GROUPS、cachedViews、PlaybackSourcePage,以及 zh-CN / en-US 双语文案。注意侧边栏入口需要同时改
sidebarNav.ts与DEFAULT_SIDEBAR_NAV_GROUPS,否则reconcileNavGroups()会把该 key 从用户已保存的侧边栏配置中静默剔除。关联 Issue
无。
测试情况
测试环境:
静态检查在三平台各自独立执行,均通过:
pnpm typecheck、pnpm lint、pnpm prettier --check .全部通过(lint 仅剩 2 条与本次改动无关的既有 warning)pnpm test通过:35 个 node test + 195 个 vitest,0 失败pnpm build:native在 Windows 与 Linux 均构建成功;pnpm exec electron-vite build三端构建成功运行时验证在三平台均以
--remoteDebuggingPort挂 CDP 驱动真实窗口完成。为不影响本机既有数据,验证使用隔离 profile,仅复制登录会话:playCount一致,降序正确。# / 标题 / 专辑 / 播放次数 / 操作 / 时长;新增列的右边缘与既有「时长」列几何一致。播放全部以该榜单替换当前播放队列:最近一周 → 84 首、所有时间 → 100 首,队首切换为对应榜首。添加到播放列表追加到队尾并去重:100 → 179(84 首中 5 首因已在队列中被跳过),符合insertManyToQueue的既有语义。播放全部置灰。三平台行为一致。
本 PR 包含 AI 辅助生成的代码,已自行完整测试与审阅,未做未经验证的提交(上述三平台运行时验证即为该过程的一部分)。
截图 / 录屏
macOS(最近一周,深色):
Windows 11(所有时间,深色):
Ubuntu 24.04(最近一周,浅色):
自查清单
pnpm format,并确认pnpm typecheck、pnpm lint通过pnpm build:native验证;未手写native/*/index.d.tsdev分支提交