Skip to content

🦄 refactor: 全局设置重构,支持搜索 / 跳转#778

Merged
imsyy merged 4 commits into
devfrom
dev-set
Jan 28, 2026
Merged

🦄 refactor: 全局设置重构,支持搜索 / 跳转#778
imsyy merged 4 commits into
devfrom
dev-set

Conversation

@imsyy
Copy link
Copy Markdown
Member

@imsyy imsyy commented Jan 28, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @imsyy, 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

  • 全局设置重构: 对全局设置模块进行了彻底重构,引入了模块化、可配置的设置项定义,并支持搜索和直接跳转到特定设置。
  • 通用设置渲染器: 移除了旧的独立设置组件(如 GeneralSetting, PlaySetting 等),并引入了 UniversalSetting 和 SettingItemRenderer,通过配置对象动态渲染所有设置项,提高了可维护性和扩展性。
  • 设置搜索与跳转: 新增了设置搜索功能,用户可以通过关键词快速查找设置项,并支持直接跳转到搜索结果对应的设置位置。
  • 桌面歌词优化: 桌面歌词窗口现在支持设置 zoomFactor,并优化了 Provider 的条件渲染,以更好地适应桌面歌词模式。
  • 版本更新: 项目版本已从 3.0.0-beta.9 更新至 3.0.0-rc.1
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.

@imsyy imsyy requested a review from kazukokawagawa January 28, 2026 06:23
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

这是一个非常出色的重构!将设置页面从多个独立的组件重构为一个由配置驱动的通用系统,极大地提高了代码的可维护性和可扩展性。新的 UniversalSettingSettingItemRenderer 组件设计得非常灵活和通用。

新增的搜索和跳转功能也是一个巨大的用户体验提升。代码结构清晰,使用了组合式函数来组织配置,并将复杂的 UI 封装到更小的组件中,这些都是非常好的实践。

我只发现了一个可以改进的小地方,以增强类型安全。总体来说,这是一次高质量的提交!

Comment on lines +146 to +153
for (const key in shortcutStore.shortcutList) {
// @ts-ignore
const item = shortcutStore.shortcutList[key];
// 如果该快捷键在失败列表中,标记为已注册(即冲突),否则为未注册(成功)
// @ts-ignore
shortcutStore.shortcutList[key].isRegistered =
item.globalShortcut && failedShortcuts.includes(item.globalShortcut);
}
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

这里的 @ts-ignore 注释可以被移除。通过使用 Object.keys 和类型断言,可以实现类型安全,使代码更健壮。

        for (const key of Object.keys(shortcutStore.shortcutList)) {
          const shortcutKey = key as keyof typeof shortcutStore.shortcutList;
          const item = shortcutStore.shortcutList[shortcutKey];
          // 如果该快捷键在失败列表中,标记为已注册(即冲突),否则为未注册(成功)
          item.isRegistered = !!(
            item.globalShortcut && failedShortcuts.includes(item.globalShortcut)
          );
        }

@kazukokawagawa kazukokawagawa marked this pull request as ready for review January 28, 2026 06:31
@imsyy imsyy merged commit 515a5ad into dev Jan 28, 2026
4 checks passed
@kazukokawagawa kazukokawagawa deleted the dev-set branch January 28, 2026 06:45
kazukokawagawa added a commit that referenced this pull request Jan 28, 2026
🦄 refactor: 全局设置重构,支持搜索 / 跳转
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