Skip to content

style(LyricsSetting): 优化设置中歌词预览的样式#675

Merged
imsyy merged 2 commits into
SPlayer-Dev:devfrom
MoYingJi:pr/lss
Dec 28, 2025
Merged

style(LyricsSetting): 优化设置中歌词预览的样式#675
imsyy merged 2 commits into
SPlayer-Dev:devfrom
MoYingJi:pr/lss

Conversation

@MoYingJi
Copy link
Copy Markdown
Collaborator

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!

此拉取请求旨在优化设置页面中歌词预览的样式显示。主要改进包括引入了翻译和音译歌词的动态字体大小计算,使其在特定模式下能更好地适应主歌词大小,并新增了自定义字体族功能,提升了用户体验和界面的灵活性。

Highlights

  • 动态字体大小计算: 优化了歌词预览中翻译和音译歌词的字体大小计算逻辑,使其在启用AMLL模式时能根据主歌词大小自动调整,提供更一致的视觉体验。
  • 自定义字体族支持: 为歌词预览添加了自定义字体族支持,用户现在可以在设置中选择歌词的字体,增强了界面的个性化设置。
  • 代码重构与可维护性: 将模板中直接绑定的字体大小属性替换为新的计算属性,提高了代码的可维护性和响应性,使字体大小的逻辑更加集中和易于管理。
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 主要优化了歌词设置中的预览样式,并重构了字体大小的逻辑。
主要改动包括:

  1. 新增了 fontSizeComputed 计算属性,用于根据是否启用 Apple Music-like Lyrics (AMLL) 动态计算翻译和音译歌词的字体大小。
  2. 在歌词预览中应用了全局歌词字体设置。

代码整体实现良好,我提出了一项关于 fontSizeComputed 的重构建议,旨在增强类型安全和代码健壮性,并简化模板中的逻辑。采纳该建议后,可以移除冗余的 @blur 事件处理器。

Comment on lines +654 to +666
const fontSizeComputed = (key: string) => computed({
get: () => settingStore.useAMLyrics ?
// AMLL 会为翻译和音译设置 `font-size: max(.5em, 10px);`
Math.max(0.5 * settingStore.lyricFontSize, 10) :
settingStore[key],
set: (value) => settingStore[key] = value,
});

// 真实显示的翻译字体大小
const tranFontSize = fontSizeComputed("lyricTranFontSize");

// 真实显示的音译字体大小
const romaFontSize = fontSizeComputed("lyricRomaFontSize");

This comment was marked as outdated.

</Transition>
<n-input-number
v-model:value="settingStore.lyricTranFontSize"
v-model:value="tranFontSize"

This comment was marked as outdated.

</Transition>
<n-input-number
v-model:value="settingStore.lyricRomaFontSize"
v-model:value="romaFontSize"

This comment was marked as outdated.

我才发现我导入成 lodash-es 的 max 了!我想用 Math.max 的!idea 自动导入害了我

这么个小更改,没必要新开 pr 了
@imsyy imsyy merged commit 2539e72 into SPlayer-Dev:dev Dec 28, 2025
@MoYingJi MoYingJi deleted the pr/lss branch December 28, 2025 10:46
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