Conversation
在设置中添加任务栏歌词显示模式选择,支持"依附任务栏"和"独立悬浮窗口"两种模式。更新了前后端类型定义、存储配置、IPC通信以及设置界面,确保显示模式能够正确同步到任务栏歌词组件。
- 新增浮动歌词窗口模式,用户可选择任务栏或浮动显示歌词 - 添加浮动窗口位置记忆功能,支持拖拽保存位置 - 重构任务栏歌词模块,引入管理器统一处理不同模式的窗口生命周期 - 更新配置结构,添加浮动窗口位置坐标字段
- 通过路由查询参数 mode=floating 启用浮动模式 - 浮动模式下启用窗口拖动区域,同时确保控制按钮可正常交互 - 添加对应的样式类名和 CSS 属性
由于 rawTime 在初始化后未被重新赋值,使用 const 声明更符合其不可变性,提高代码可读性。
- 新增悬浮对齐选项(左对齐/右对齐) - 新增悬浮自动宽度开关,关闭后可手动设置宽度 - 新增悬浮高度配置项 - 窗口现在可调整大小并保存位置和尺寸 - 增加设置迁移以初始化新配置项
- 新增 `floatingAlwaysOnTop` 配置,控制悬浮窗口是否置顶显示 - 新增 `floatingAnchor` 配置,支持左、中、右三种锚点位置,用于自动宽度变化时保持窗口位置 - 在设置界面添加对应的开关和下拉选择控件
- 新增置顶功能,可通过配置控制窗口是否保持置顶 - 引入锚点定位(左/中/右),调整窗口大小时保持相对位置 - 扩展窗口最大高度限制为工作区高度 - 修复窗口边界计算,确保始终保持在屏幕可见区域内
- 将悬浮歌词窗口的最大高度从100px增加至600px,提供更大的自定义范围 - 重构悬停逻辑,仅在浮动模式下显示媒体控制按钮,避免非浮动模式下的布局干扰 - 将CSS单位从px转换为em,提升样式在不同字体大小下的适应性 - 优化内边距和间距,改善视觉一致性和响应式表现
移除不再使用的 floatingAnchor 配置项,简化悬浮窗口位置计算逻辑。 现在窗口位置仅基于左右对齐方式确定,不再支持居中锚点。
将悬浮歌词窗口的最大高度限制从600px调整为100px,最小高度从30px调整为48px,以匹配实际UI设计需求。 同时修复了窗口初始化时高度可能超过最大限制的问题,并确保窗口在显示前正确更新布局。
简化任务栏歌词组件,移除鼠标悬停显示媒体控制按钮的功能及相关动画过渡。 删除与悬停状态相关的计算属性、事件处理及样式,专注于歌词展示的核心逻辑。
悬停或点击浮动歌词时不应出现背景色变化,并禁用内部元素的鼠标事件以避免干扰拖拽操作。
初始化时同步所有任务栏歌词配置到主进程,确保 electron-store 与 settingStore 状态一致。
|
Warning Gemini is experiencing higher than usual traffic and was unable to create the summary. Please try again in a few hours by commenting |
There was a problem hiding this comment.
Pull request overview
This pull request adds two display modes for taskbar lyrics (taskbar-embedded vs floating window) and enhances the floating window with customization features. The implementation introduces a new TaskbarLyricManager to handle switching between modes, removes the hover-based media controls from the taskbar lyric view, and adds comprehensive settings for the floating mode including alignment, size, and always-on-top behavior.
Changes:
- Added floating window mode for taskbar lyrics with independent positioning, sizing, and always-on-top options
- Removed hover state and inline media controls from taskbar lyric view, simplifying the UI
- Implemented TaskbarLyricManager to coordinate between taskbar-embedded and floating window modes
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/views/TaskbarLyric/index.vue | Removed hover controls and metadata switching, simplified to direct lyric display with floating mode detection |
| src/utils/initIpc.ts | Added new floating mode config fields to taskbar config sync |
| src/types/shared/taskbar-ipc.ts | Extended TaskbarConfig interface with mode and floating-specific settings |
| src/stores/setting.ts | Added 5 new settings for taskbar lyric mode and floating window behavior |
| src/stores/migrations/settingMigrations.ts | Added migrations 12 and 13 for new settings, incremented schema version to 13 |
| src/composables/useInit.ts | Added initialization sync and watchers for new floating mode settings |
| src/components/Setting/config/lyric.ts | Added UI controls for mode selection and floating window configuration |
| electron/main/windows/taskbar-lyric-window.ts | Refactored to remove IPC listener and add setContentWidth method |
| electron/main/windows/taskbar-lyric-manager.ts | New manager class to coordinate between taskbar and floating window modes |
| electron/main/windows/floating-taskbar-lyric-window.ts | New window implementation for floating mode with position persistence and dynamic sizing |
| electron/main/store/index.ts | Added electron-store schema for floating window settings |
| electron/main/ipc/ipc-taskbar.ts | Updated IPC handlers to use manager and support mode switching |
| electron/main/index.ts | Updated cleanup to use destroyAll method from manager |
| src/core/automix/AutomixManager.ts | Changed rawTime from let to const (code quality improvement) |
| taskbarLyricFloatingAlign: "right", | ||
| taskbarLyricFloatingAutoWidth: true, | ||
| taskbarLyricFloatingWidth: 300, | ||
| taskbarLyricFloatingHeight: 48, |
There was a problem hiding this comment.
Migration function 13 is missing the taskbarLyricFloatingAlwaysOnTop field. The default state in setting.ts includes this field (line 544), and it's added to the store defaults in electron/main/store/index.ts (lines 130-135), but the migration function doesn't initialize it. This could cause the setting to be undefined for users migrating from older versions until they manually change it or reinstall.
| taskbarLyricFloatingHeight: 48, | |
| taskbarLyricFloatingHeight: 48, | |
| taskbarLyricFloatingAlwaysOnTop: false, |
| if (modeChanged) { | ||
| taskbarLyricManager.close(false); | ||
| } | ||
|
|
There was a problem hiding this comment.
Redundant close call: When mode changes, the window is closed twice - once explicitly in the IPC handler (line 85) and again inside the create method of the manager (taskbar-lyric-manager.ts line 19). Consider removing the explicit close call here since the create method already handles closing the old window when mode changes. This redundancy doesn't cause bugs but is inefficient.
| if (modeChanged) { | |
| taskbarLyricManager.close(false); | |
| } |
No description provided.