修点问题 by kazukokawagawa · Pull Request #815 · imsyy/SPlayer

Summary of Changes

Hello @kazukokawagawa, 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!

此拉取请求旨在解决应用程序中的多项问题,主要集中于增强Electron IPC通信的健壮性、优化歌词交互的用户体验,并通过引入新设置提供更多应用行为控制。具体包括细化歌词窗口配置的保存方式、实现更智能的歌词跳转吸附机制,以及允许用户切换全局错误通知。此外,还包含了对原生模块命名规范的微小调整和组件生命周期管理的改进。

Highlights

  • IPC处理增强: 优化了Electron进程间通信(IPC)的处理逻辑,包括更严格的窗口存活检查和更精细的配置存储方式,从而提升了系统的稳定性和健壮性。
  • 智能歌词吸附: 改进了播放器进度条的歌词吸附功能,使其在用户调整播放进度时,能够更智能地根据前后歌词时间点进行吸附,提升了用户体验。
  • 全局错误弹窗开关: 新增了一个用户设置选项,允许用户自由选择是否启用全局错误提示弹窗,提供了更灵活的错误处理反馈机制。
  • 字体管理器逻辑修正: 修复了字体选择组件中,当用户更新字体设置时,配置保存逻辑的触发问题,确保了设置的及时生效。
  • IPC监听器生命周期管理: 解决了FontManager组件中IPC事件监听器的潜在内存泄漏问题,通过在组件挂载时注册、卸载时注销,确保了资源的正确管理。
Changelog
  • electron/main/ipc/ipc-lyric.ts
    • update-desktop-lyric-option IPC处理器中,移除了对lyricWin存活状态的早期返回检查。
    • 将歌词窗口的边界(x, y, width, height)保存到store的方式改为直接属性更新,例如store.set("lyric.x", x),以实现更细粒度的控制。
    • toggle-desktop-lyric-lock IPC处理器中,移除了对lyricWinmainWin存活状态的早期返回检查,并在执行相关操作前增加了isWinAlive检查。
    • 将歌词锁定状态的配置存储方式改为直接属性更新store.set("lyric.config.isLock", isLock)
    • 在向主窗口发送IPC消息前增加了isWinAlive(mainWin)检查。
  • native/external-media-integration/package.json
    • napi配置中的binaryNameexternal_media_integration更改为external-media-integration
  • native/taskbar-lyric/package.json
    • napi配置中的binaryNametaskbar_lyric更改为taskbar-lyric
  • src/components/Global/GlobalErrorHandler.vue
    • 引入了useSettingStore,并根据settingStore.enableGlobalErrorDialog的值来控制showErrorDialog的执行。
  • src/components/Modal/Setting/FontManager.vue
    • 修改了字体选择组件(s-inputn-select)的@update:value事件处理逻辑,确保在更新desktopLyricConfig.fontFamily后立即调用saveDesktopLyricConfig()
    • update-desktop-lyric-option IPC监听器的注册从getDesktopLyricConfig函数中移出,并在onMounted中注册,在onUnmounted中通过removeListener进行注销。
  • src/components/Player/PlayerComponents/PlayerSlider.vue
    • 重构了setSeek函数中当settingStore.progressAdjustLyric启用时的歌词吸附逻辑,实现了更复杂的吸附规则,包括对下一行歌词和当前歌词的吸附判断,并设置了2.5秒和10秒的阈值。
  • src/components/Setting/config/appearance.ts
    • playerBackgroundRenderScale设置的最大值从10调整为3。
  • src/components/Setting/config/general.ts
    • 在通用设置中新增了“启用全局错误弹窗”的开关选项。
  • src/stores/setting.ts
    • SettingState接口中添加了enableGlobalErrorDialog属性,并在默认状态中将其初始化为true
  • src/views/TaskbarLyric/index.vue
    • 导入了LyricScroll.vue组件。
Activity
  • 此拉取请求由用户kazukokawagawa创建。
  • 拉取请求的标题“修点问题”表明其目的是修复一些问题。
  • 更改涉及Electron主进程、原生模块、Vue组件和设置存储等多个文件,暗示这是一系列全面的修复和改进。
  • 拉取请求描述为空,表明作者可能希望通过代码更改本身来传达意图,或者这是一次快速修复。
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.

  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.