Skip to content

fix: 修复 Windows 11 小任务栏下歌词显示不全 - #428

Merged
imsyy merged 1 commit into
SPlayer-Dev:devfrom
lyimoexiao:fix/taskbar-lyric-small-mode-height
Oct 30, 2026
Merged

imsyy merged 1 commit into
SPlayer-Dev:devfrom
lyimoexiao:fix/taskbar-lyric-small-mode-height

Conversation

@lyimoexiao

@lyimoexiao lyimoexiao commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

改动类型

  • 新功能(feat)
  • 缺陷修复(fix)
  • 重构 / 优化(不改变对外行为)
  • 文档(docs)
  • 其他(请在「改动说明」中注明)

是否包含破坏性变更

  • 是(请在「改动说明」中详细描述)
  • 否

改动说明

修复 Windows 11 26H2 任务栏处于小模式时,双行歌词和悬停歌曲信息显示不全的问题。

排查时发现,原生模块获取的任务栏高度为 32px,但 Electron 在设置窗口高度后,实际窗口和渲染视口仍为 39px。原先按 100vh 布局,内容会超出任务栏可见范围;固定的上下留白也进一步压缩了双行文字的可用空间。

本次修改:

  • 通过布局事件将任务栏实际可用高度传给渲染端,不再直接依赖视口高度
  • 根据可用高度调整上下留白,空间不足时缩小显示字号,不修改用户保存的字号设置
  • 歌词和悬停歌曲信息共用同一套高度预算,并同步调整文字宽度测量
  • 始终按任务栏可用区域裁切窗口,限制渲染和鼠标命中范围
  • 提前订阅布局事件,避免异步读取配置时错过首次布局

关联 Issue

暂无

测试情况

验证平台:Windows 11 26H2,Windows x64

  • pnpm typecheck 通过
  • pnpm lint 通过
  • 已对本次修改的文件执行 Prettier 格式化
  • pnpm build:win 通过,已生成安装版和便携版,构建过程包含原生模块编译
  • dev 环境中实测:渲染视口为 39px,内容区域按任务栏实际的 32px 布局,双行歌词和歌曲信息的行盒均位于 1–31px 范围内

未验证 macOS / Linux,本次未修改原生模块源码

截图 / 录屏

修复前

修复前

修复后

修复后

自查清单

  • 本 PR 只包含一个主要功能 / 修复,没有夹带无关改动
  • 已在本地完整测试通过;AI 生成的代码同样自行测试并审阅过,未做未经验证的提交
  • 已运行 pnpm format,并确认 pnpm typecheck、pnpm lint 通过
  • 改动涉及原生模块时已 pnpm build:native 验证;未手写 native/*/index.d.ts
  • 已向 dev 分支提交

Copilot AI balanced review requested due to automatic review settings October 29, 2026 13:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@imsyy
imsyy merged commit b3b4480 into SPlayer-Dev:dev Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants