Skip to content

feat(CopyLyrics): 选择是否在复制的每行歌词之间加入空行分隔#832

Merged
imsyy merged 1 commit into
SPlayer-Dev:devfrom
MoYingJi:pr/c
Feb 7, 2026
Merged

feat(CopyLyrics): 选择是否在复制的每行歌词之间加入空行分隔#832
imsyy merged 1 commit into
SPlayer-Dev:devfrom
MoYingJi:pr/c

Conversation

@MoYingJi
Copy link
Copy Markdown
Collaborator

@MoYingJi MoYingJi commented Feb 6, 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!

此拉取请求为歌词复制功能引入了一项新特性,允许用户控制复制歌词行之间的间距。具体来说,它增加了一个选项,用于在每行复制的歌词之间包含或排除空行,从而提高了用户导出歌词时的灵活性。

Highlights

  • 新增“空行”选项: 在歌词复制模态框中新增了一个“空行”复选框选项,允许用户选择是否在复制的每行歌词之间加入空行分隔。
  • 默认选中“空行”: 修改了默认选中的过滤器,使其包含新添加的“emptyLine”选项,这意味着默认情况下复制的歌词会包含空行。
  • 复制逻辑更新: 更新了歌词的连接逻辑,现在会根据“emptyLine”过滤器的选择,条件性地使用双换行符(“\n\n”)或单换行符(“\n”)来连接歌词。
Changelog
  • src/components/Modal/CopyLyrics.vue
    • 在复制选项中添加了一个新的“空行”复选框,并附带了提示信息。
    • 更新了 selectedFilters 的默认值,使其包含“emptyLine”选项。
    • 修改了歌词连接逻辑,使其根据“emptyLine”过滤器的状态来决定使用单行或双行分隔符。
Activity
  • 目前尚无人工活动(如评论或审查)。
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 增加了一个在复制歌词时,在每行歌词之间添加空行分隔的选项,实现清晰直接。代码改动主要集中在 CopyLyrics.vue 组件中,包括添加 UI 选项、更新默认值和调整复制逻辑。

我有一个关于代码可维护性的建议,即使用常量来代替魔法字符串,以提高代码的健壮性和可读性。具体细节请参见我的评论。

const musicStore = useMusicStore();

const selectedFilters = ref<string[]>(["translation", "romaji"]);
const selectedFilters = ref<string[]>(["translation", "romaji", "emptyLine"]);
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

为了提高代码的可维护性和可读性,并避免使用魔法字符串(magic strings),建议将筛选器名称('translation', 'romaji', 'emptyLine')定义为常量。

例如,你可以定义一个常量对象:

const LyricCopyFilter = {
  TRANSLATION: 'translation',
  ROMAJI: 'romaji',
  EMPTY_LINE: 'emptyLine',
} as const;

然后,在整个组件中都使用这些常量,例如:

  • value 属性:<n-checkbox :value="LyricCopyFilter.TRANSLATION" ... />
  • selectedFilters 初始值:ref<string[]>([LyricCopyFilter.TRANSLATION, ...])
  • computed 属性:selectedFilters.value.includes(LyricCopyFilter.TRANSLATION)

这样做可以使代码更健壮,防止因拼写错误导致的 bug,并且在未来需要修改筛选器名称时也更加方便。

@imsyy imsyy merged commit ba7a325 into SPlayer-Dev:dev Feb 7, 2026
@MoYingJi MoYingJi deleted the pr/c branch February 7, 2026 10:57
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