Skip to content

1#859

Merged
kazukokawagawa merged 6 commits into
dev-ipc-01from
dev
Feb 10, 2026
Merged

1#859
kazukokawagawa merged 6 commits into
dev-ipc-01from
dev

Conversation

@kazukokawagawa
Copy link
Copy Markdown
Collaborator

No description provided.

kazukokawagawa and others added 6 commits February 9, 2026 19:35
添加歌词字体大小自适应模式,可根据窗口高度自动缩放歌词大小,避免全屏时过小或窗口时过大。新增设置选项允许用户在固定大小和自适应模式之间切换,并更新了歌词预览和播放器组件以支持新的字体大小计算逻辑。
将多个组件中重复的字体大小计算逻辑提取到统一的工具函数 getFontSize 中
该函数根据字体大小模式(自适应或固定)返回相应的 CSS 值
feat(歌词): 增加自适应歌词字体大小模式  添加歌词字体大小自适应模式,可根据窗口高度自动缩放歌词大小,避免全屏时过小或窗口时过大。新增设置选项允许用户在固定大小和自适应模式之间切换,并更新了歌词预览和播放器组件以支持新的字体大小计算逻辑。
…taskbar-window

🦄 refactor: 优化在任务栏歌词窗口中的开发者工具打开
@kazukokawagawa kazukokawagawa merged commit f564a00 into dev-ipc-01 Feb 10, 2026
10 checks passed
@gemini-code-assist
Copy link
Copy Markdown
Contributor

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!

此拉取请求主要增强了歌词显示的用户体验和开发调试效率。它引入了歌词字体大小的自适应功能,使得歌词能够根据应用窗口的高度动态调整,从而在不同窗口尺寸下保持良好的视觉效果。同时,为了方便调试,为任务栏歌词窗口添加了分离式开发者工具的快捷访问方式。此外,还对 QRC 歌词解析逻辑进行了优化,提升了其对非标准格式歌词文件的处理能力。

Highlights

  • 自适应歌词字体大小: 新增了歌词字体大小自适应模式,允许歌词根据窗口高度自动缩放,以避免在全屏或窗口模式下字体过大或过小。这通过引入一个新的设置项和 getFontSize 工具函数实现。
  • 任务栏歌词窗口开发者工具: 为任务栏歌词窗口添加了 F12 快捷键,用于切换分离模式的开发者工具,解决了该小窗口默认嵌入式开发者工具难以使用的问题。
  • QRC 歌词解析器增强: 改进了 QRC 歌词解析器,使其能够更健壮地处理非标准 XML 属性(特别是 LyricContent),通过尝试贪婪匹配和回退机制,并解码 XML 实体,提高了兼容性。
Changelog
  • electron/main/windows/taskbar-lyric-window.ts
    • 为任务栏歌词窗口添加了 F12 快捷键,用于切换分离模式的开发者工具。
  • src/components/Player/PlayerLyric/AMLyric.vue
    • 更新了歌词字体大小的计算方式,以使用新的 getFontSize 工具函数。
  • src/components/Player/PlayerLyric/DefaultLyric.vue
    • 更新了歌词字体大小的计算方式,以使用新的 getFontSize 工具函数。
  • src/components/Setting/components/LyricPreview.vue
    • 更新了歌词字体大小的计算方式,以使用新的 getFontSize 工具函数,并调整了 CSS 变量的使用方式。
  • src/components/Setting/config/lyric.ts
    • 新增了自适应歌词字体大小模式的设置项。
    • 更新了现有字体大小设置的描述,以反映自适应模式下的行为。
  • src/stores/setting.ts
    • 在应用设置状态中添加了 lyricFontSizeMode 属性,并设置了默认值。
  • src/utils/lyric/qrc-parser.ts
    • 增强了 QRC 解析器,使其能够更健壮地处理非标准 XML 属性并解码 XML 实体。
  • src/utils/style.ts
    • 新增了 getFontSize 工具函数,用于计算自适应或固定像素的字体大小。
Activity
  • 此拉取请求的标题为“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.

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

This pull request introduces several enhancements. A major feature is the adaptive lyric font size, which scales with window height, improving readability across different window sizes. The QRC lyric parser has been made more robust to handle non-standard formats with unescaped quotes. Additionally, a developer quality-of-life improvement has been added to easily open DevTools for the taskbar lyric window.

The implementation is solid. I have a couple of suggestions to improve robustness and type safety in the new logic. Please see my detailed comments.

const content = greedyMatch[1];
// 启发式检查:如果提取的内容中包含类似 ` Attribute="` 的结构,说明贪婪匹配吃掉了其他属性
// 这种情况下回退到非贪婪匹配
if (!/\s+\w+\s*=\s*"/.test(content)) {
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

The regex used in the heuristic check for attributes is a bit too restrictive. \w+ only matches letters, numbers, and underscores. XML attribute names can also contain hyphens (-) and periods (.). To make this check more robust and correctly handle attributes like data-foo, I suggest using [\w.-]+ instead.

Suggested change
if (!/\s+\w+\s*=\s*"/.test(content)) {
if (!/\s+[\w.-]+\s*=\s*"/.test(content)) {

Comment thread src/utils/style.ts
* @param mode 字体大小模式 ('adaptive' | 'fixed')
* @returns CSS font-size 字符串
*/
export const getFontSize = (size: number, mode: string) => {
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

For better type safety and code clarity, it's recommended to use a more specific type for the mode parameter instead of a generic string. The store defines this as "fixed" | "adaptive", and using that union type here will prevent potential errors and make the function's contract clearer.

export const getFontSize = (size: number, mode: "fixed" | "adaptive") => {

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