Skip to content

refactor(setting): 改个变量名什么的 还有一些小改#710

Merged
imsyy merged 1 commit intoimsyy:devfrom
MoYingJi:pr/l
Jan 3, 2026
Merged

refactor(setting): 改个变量名什么的 还有一些小改#710
imsyy merged 1 commit intoimsyy:devfrom
MoYingJi:pr/l

Conversation

@MoYingJi
Copy link
Copy Markdown
Collaborator

@MoYingJi MoYingJi commented Jan 3, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

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

本次拉取请求主要对应用程序的设置结构进行了重构和优化。核心改动是将与侧边栏可见性相关的多个独立设置项整合到一个名为 sidebarHide 的嵌套对象中,并对一个歌词相关的变量名进行了更清晰的重命名。这些改动旨在提高设置管理的逻辑性和代码的可读性,同时通过引入数据迁移确保了用户体验的无缝衔接。

Highlights

  • 设置结构重构: 将所有侧边栏隐藏相关的设置项(如 hideDiscover, hidePersonalFM 等)统一归集到 settingStore.sidebarHide 对象下,提升代码组织性和可维护性。
  • 变量名更新: 将 enableTTMLLyric 变量更名为 enableOnlineTTMLLyric,以更准确地反映其“在线TTML歌词”的功能。
  • 设置迁移: 引入了新的设置Schema版本(从5到6),并提供了迁移逻辑,确保用户现有设置在更新后能平滑过渡到新的结构。
  • 侧边栏项条件显示: 在侧边栏隐藏管理界面中,“下载管理”选项现在仅在开发者模式下显示。
  • 文本微调: 更新了歌词设置界面中的提示文本,将“你已使用 Apple-Music-like Lyrics”改为“正在使用 Apple Music-like Lyrics”。
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 主要对设置项进行了重构,将侧边栏的显示/隐藏选项整合到了 sidebarHide 对象下,并重命名了 enableTTMLLyric 变量,这有助于提升代码的组织性和可读性。同时,也更新了相应的迁移脚本。在审查中,我发现了一个关键问题:在 SidebarHideManager.vue 组件中,虽然更新了设置的逻辑,但模板部分未同步修改,将导致 UI 功能失效。此外,我对迁移脚本的健壮性提出了一点改进建议。请查看具体的评论。

Comment thread src/components/Modal/Setting/SidebarHideManager.vue Outdated
const oldState = state as OldSettingState;

return {
enableOnlineTTMLLyric: oldState.enableTTMLLyric,
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.

high

在迁移 enableTTMLLyric 属性时,当 oldState.enableTTMLLyric 可能为 undefined 时,直接赋值会导致新属性也为 undefined。建议像下面处理 sidebarHide 中的属性一样,提供一个 false 作为默认值,以确保状态的确定性。

Suggested change
enableOnlineTTMLLyric: oldState.enableTTMLLyric,
enableOnlineTTMLLyric: oldState.enableTTMLLyric || false,

@MoYingJi MoYingJi marked this pull request as draft January 3, 2026 01:09
@MoYingJi MoYingJi marked this pull request as ready for review January 3, 2026 01:21
@imsyy imsyy merged commit 469e4b5 into imsyy:dev Jan 3, 2026
@MoYingJi MoYingJi deleted the pr/l branch January 3, 2026 17:32
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