Skip to content

fix &feat 修复打开桌面歌词按钮报错bug,和增加点击桌面歌词设置按钮后直接跳转桌面歌词设置部分#638

Merged
imsyy merged 4 commits into
SPlayer-Dev:devfrom
flystar233:dev
Dec 19, 2025
Merged

fix &feat 修复打开桌面歌词按钮报错bug,和增加点击桌面歌词设置按钮后直接跳转桌面歌词设置部分#638
imsyy merged 4 commits into
SPlayer-Dev:devfrom
flystar233:dev

Conversation

@flystar233
Copy link
Copy Markdown
Contributor

@flystar233 flystar233 commented Dec 16, 2025

修复设置中打开桌面歌词按钮报错bug:
Snipaste_2025-12-16_20-43-38

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @flystar233, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求主要解决了桌面歌词功能的一个已知问题,并优化了其设置入口。通过引入新的参数和更新相关组件,确保了桌面歌词按钮的稳定运行,并为用户提供了更便捷的设置导航体验,使得用户能够更快速地访问和调整桌面歌词的各项配置。

Highlights

  • 修复桌面歌词按钮报错: 解决了点击桌面歌词按钮时可能出现的报错问题,确保了功能的稳定性。
  • 优化桌面歌词设置跳转: 增强了用户体验,现在点击桌面歌词设置按钮可以直接跳转到设置界面的桌面歌词部分,无需手动查找。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

这个 PR 修复了点击桌面歌词按钮时因方法调用方式不正确而导致的报错,同时增加了一个新功能:从桌面歌词窗口的设置按钮可以直接跳转到主设置窗口的桌面歌词配置区域,提升了用户体验。

代码改动整体上是有效的。Bug 修复是正确的,新功能的实现逻辑清晰,通过 props 和 IPC 事件将参数一路传递到目标组件。

我提出了两点建议:

  1. LyricsSetting.vue 中,可以优化 n-switch 的事件处理,使其代码更简洁和直观。
  2. 我注意到 useIpcEvents.tsinitIpc.ts 中存在重复的 IPC 事件监听逻辑,建议将它们合并,以提高代码的可维护性。

请查看具体的代码注释以获取详细信息。

:round="false"
class="set"
@update:value="player.toggleDesktopLyric"
@update:value="() => player.toggleDesktopLyric()"
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.

medium

建议优化此处的事件处理。n-switch@update:value 事件会传递更新后的布尔值。PlayerController 中有 setDesktopLyricShow(show: boolean) 方法,它接收一个布尔值来设置桌面歌词的显示状态,这与事件的行为完全匹配。
使用 player.setDesktopLyricShow 可以让代码更简洁、更符合事件驱动的逻辑。

当前的实现 () => player.toggleDesktopLyric() 也能工作,但它忽略了事件传递的值,而是自己去获取并切换状态,略显冗余。

          @update:value="player.setDesktopLyricShow"

Comment thread src/hooks/useIpcEvents.ts Outdated
Comment on lines +30 to +31
const handleOpenSetting = (_: any, type: SettingType, scrollTo?: string) =>
openSetting(type, scrollTo);
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.

medium

我注意到 src/hooks/useIpcEvents.tssrc/utils/initIpc.ts 这两个文件都注册了许多相同的 IPC 事件监听器,例如 openSetting。这可能会导致事件处理器被多次调用,并增加了代码维护的难度。

建议将所有 IPC 事件的监听逻辑统一到一个地方。useIpcEvents 这个 composable hook 看起来是更合适的选择,因为它通过 onMountedonUnmounted 正确地管理了监听器的生命周期,可以避免内存泄漏。

initIpc.ts 中的逻辑合并到这里,并在应用的根组件(如 App.vue)中调用一次 useIpcEvents(),可以使代码结构更清晰。

Copy link
Copy Markdown
Contributor Author

@flystar233 flystar233 Dec 16, 2025

Choose a reason for hiding this comment

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

ignore,not the point in this pr

@flystar233
Copy link
Copy Markdown
Contributor Author

one update by gemini-code-assist

@flystar233
Copy link
Copy Markdown
Contributor Author

flystar233 commented Dec 16, 2025

修复点击桌面歌词设置按钮重复打开设置页面的issue,现会进行提醒,并阻止重复打开设置页面
image

@imsyy imsyy merged commit b6ff4a8 into SPlayer-Dev:dev Dec 19, 2025
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.

2 participants