Conversation
Summary of ChangesHello @apoint123, 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! 此拉取请求的核心目标是为应用程序添加任务栏歌词功能,提升用户体验。通过引入一个专门的Rust原生模块,实现了与Windows任务栏的深度集成,能够将歌词窗口嵌入到任务栏中,并根据系统状态动态调整其显示。这一改动为后续在Vue和TypeScript中开发更丰富的歌词动画和交互奠定了坚实的基础,同时最大程度地减少了对原生代码的直接修改。 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new feature: taskbar lyrics. It includes changes to Cargo.lock and Cargo.toml to add the taskbar-lyric crate as a dependency, modifications to electron-builder.config.ts and electron.vite.config.ts to handle the new native module, and additions to electron/main to manage the taskbar lyric window and IPC. The new taskbar-lyric crate contains Rust code for embedding the lyric window in the taskbar and handling system events. The code introduces a new window, IPC handlers, and store configurations for managing the taskbar lyrics. I have identified some areas for improvement, mainly focusing on error handling and code clarity.
e3cfe83 to
37ba6be
Compare
ae260cf to
4dbc82f
Compare
|
/gemini review |
4dbc82f to
bfbe0b9
Compare
bfbe0b9 to
712ccba
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'Taskbar Lyric' feature, allowing lyrics to be displayed directly on the Windows taskbar. This involves adding two new native Rust modules, taskbar-lyric and tools, to the project workspace and build process. The taskbar-lyric module handles embedding the lyric window into the taskbar, dynamically adjusting its layout based on Windows 10 or 11 taskbar configurations, and monitoring taskbar changes via registry, UI Automation (UIA), and tray events. The tools module provides a utility to detect Explorer restarts. The Electron main process now manages the lifecycle of the taskbar lyric window, including creating/closing it, updating its content (metadata, lyrics, progress, playback state), and responding to taskbar layout changes and Explorer restarts. A new IPC channel taskbar: is established for communication between the renderer and main processes for this feature. The tray menu is updated with an option to toggle taskbar lyrics, and the application's store now persists the enabled state of this feature. The renderer process includes new Vue components for rendering the taskbar lyrics with animations and media controls. Review comments suggest refactoring several magic numbers into named constants for improved readability and maintainability, and ensuring consistent import type usage for type-only imports.
| setTimeout(() => { | ||
| taskbarLyricWindow.create(); | ||
| }, 500); |
| const GAP = 10 * scaleFactor; | ||
| const MAX_WIDTH_PHYSICAL = 300 * scaleFactor; | ||
| const MIN_WIDTH_PHYSICAL = 50 * scaleFactor; |
| setTimeout(() => { | ||
| if (winToClose && !winToClose.isDestroyed()) { | ||
| winToClose.close(); | ||
| } | ||
| }, 350); |
| import type { PlayModePayload, RepeatModeType, ShuffleModeType } from "@/types/shared"; | ||
| import { isElectron } from "@/utils/env"; | ||
| import { getPlaySongData } from "@/utils/format"; | ||
| import { DiscordConfigPayload, MetadataParam, PlaybackStatus, RepeatMode } from "@emi"; | ||
| import type { LyricLine } from "@applemusic-like-lyrics/lyric"; | ||
| import type { DiscordConfigPayload, MetadataParam, PlaybackStatus, RepeatMode } from "@emi"; |
There was a problem hiding this comment.
为了保持代码风格一致,建议对所有仅用于类型的导入使用 import type。
import type { PlayModePayload, RepeatModeType, ShuffleModeType } from "@/types/shared";
import { isElectron } => "@/utils/env";
import { getPlaySongData } => "@/utils/format";
import type { LyricLine } } from "@applemusic-like-lyrics/lyric";
import type { DiscordConfigPayload, MetadataParam, PlaybackStatus, RepeatMode } } from "@emi";| const updateLyric = () => { | ||
| if (state.lyrics.length) { | ||
| // 提前 0.4s 以便让歌词进场动画跑完 | ||
| const firstLineCompensation = state.lyricIndex === -1 ? 400 : 0; |
添加了任务栏歌词功能