Skip to content

feat(CopyLyrics): 可以预览复制的歌名和歌手#950

Merged
imsyy merged 1 commit intoimsyy:devfrom
MoYingJi:pr/c
Feb 27, 2026
Merged

feat(CopyLyrics): 可以预览复制的歌名和歌手#950
imsyy merged 1 commit intoimsyy:devfrom
MoYingJi:pr/c

Conversation

@MoYingJi
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings February 27, 2026 14:54
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

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

  • 歌名和歌手预览功能: 在复制歌词时,现在可以预览将要复制的歌名和歌手信息,提升用户体验。
  • UI 更新: 复制歌词模态框中新增了一个折叠过渡区域,用于动态显示歌名和歌手的后缀预览。
  • 逻辑重构: 引入了一个新的计算属性 displaySuffix 来统一生成歌名和歌手的后缀,并简化了 handleCopy 函数中的复制逻辑。
Changelog
  • src/components/Modal/CopyLyrics.vue
    • 新增了用于显示歌名和歌手后缀预览的UI组件,包括n-collapse-transition、n-divider、n-flex和n-text。
    • 实现了新的计算属性displaySuffix,根据用户选择动态生成歌曲名称和艺术家后缀。
    • 重构了handleCopy函数,使其利用displaySuffix计算属性,简化了附加歌曲和艺术家信息的逻辑。
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 在复制歌词时增加了歌名和歌手的预览功能。实现上将后缀生成的逻辑重构到了一个新的计算属性 displaySuffix 中,这是一个很好的改进,提高了代码的清晰度和可复用性。我对于新的计算属性的逻辑有一个简化建议。

Comment on lines +97 to +100
} else if (showArtist) {
return `—— ${artistName}`;
}
return "";
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

这里的 else if (showArtist) 条件是多余的,并且最后的 return "" 是无法访问到的代码。因为函数开头已经判断了 showSongNameshowArtist 都为 false 的情况并提前返回,所以如果代码能执行到这里,showArtist 必定为 true。你可以用一个 else 语句来简化这部分逻辑,这样代码更简洁,也移除了无法访问到的代码。

  } else {
    return `—— ${artistName}`;
  }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原有逻辑,未改动

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a preview feature to the copy lyrics modal that displays how the song name and artist will appear in the copied text. The implementation extracts duplicate suffix-building logic into a reusable computed property and displays it in a collapsible preview section.

Changes:

  • Added a collapsible preview section showing the formatted song name and artist suffix before copying
  • Refactored suffix-building logic from handleCopy into a new displaySuffix computed property for reusability
  • Improved code maintainability by eliminating code duplication

@imsyy imsyy merged commit 6063387 into imsyy:dev Feb 27, 2026
@MoYingJi MoYingJi deleted the pr/c branch March 11, 2026 19:42
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