mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 14:35:41 +00:00
refactor(lucky-mix): review follow-ups from Psychotoxical
- Drop the ~110 lines of dead full-screen overlay CSS that was never
referenced in JSX (.lucky-mix-overlay*, .lucky-mix-cube*, full-screen
@keyframes). Keep the .lucky-mix-pip* rules since the inline queue
variant re-uses them.
- Extract availability gate into hooks/useLuckyMixAvailable.ts (pure
predicate + hook). Replaces five duplicated inline checks in Sidebar,
MobileMoreOverlay, RandomLanding, Settings/SidebarCustomizer, and the
internal re-check in buildAndPlayLuckyMix.
- Add a cancel mechanic:
* luckyMixStore gets a cancelRequested flag + cancel() method
* LuckyMixCancelled sentinel is thrown from a bailIfCancelled() helper
sprinkled between await boundaries in the build loop
* catch-block swallows the sentinel silently (no toast, no error state)
* auto-cancel subscription on playerStore detects manual user track
changes (anything not in queuedIds) and flips cancelRequested so the
finished mix does not later overwrite the user's choice
* inline .queue-lucky-loading dice indicator is now a button — click
triggers explicit cancel, hover fades the dice to signal the action
- Restore the queue snapshot when the build fails before ever starting
playback, so the user does not land in an empty player after an error.
If playTrack already ran, leave current state alone (their track plus
whatever was enqueued is more useful than a stale pre-click queue).
- Rework locale labels to consistently carry the "Mix" suffix so the
entry reads well next to "Random Mix" / "Random Albums" in the
sidebar: DE Glücks-Mix, ES Mezcla Suerte, FR Mix Chance, NB Lykkemiks,
NL Geluksmix, ZH 好运混音. EN stays "Lucky Mix", RU stays
«Мне повезёт». Toast/settings/randomNavSplit copy aligned to the new
names. New luckyMix.cancelTooltip key added in all 8 locales.
AudioMuse gating stays — as Cuca confirmed, the feature's quality relies
on a correct similar-track selection, so the requirement is intentional.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+9
-8
@@ -31,7 +31,7 @@ export const zhTranslation = {
|
||||
expandPlaylists: '展开播放列表',
|
||||
collapsePlaylists: '收起播放列表',
|
||||
more: '更多',
|
||||
feelingLucky: '好运',
|
||||
feelingLucky: '好运混音',
|
||||
},
|
||||
home: {
|
||||
hero: '精选',
|
||||
@@ -282,7 +282,7 @@ export const zhTranslation = {
|
||||
mixByTracksDesc: '从整个媒体库随机选取曲目',
|
||||
mixByAlbums: '按专辑混音',
|
||||
mixByAlbumsDesc: '随机选取专辑,探索新音乐',
|
||||
mixByLucky: '好运',
|
||||
mixByLucky: '好运混音',
|
||||
mixByLuckyDesc: '基于高频艺人、专辑和高评分歌曲的智能 Instant Mix',
|
||||
},
|
||||
randomAlbums: {
|
||||
@@ -337,9 +337,10 @@ export const zhTranslation = {
|
||||
genreClickHint: '点击流派标签将其添加为过滤关键词。\\n匹配流派、标题、专辑和艺术家。',
|
||||
},
|
||||
luckyMix: {
|
||||
done: '幸运混音已就绪:{{count}} 首',
|
||||
failed: '生成混音失败,请重试。',
|
||||
unavailable: '此服务器不可用“好运”。',
|
||||
done: '好运混音已就绪:{{count}} 首',
|
||||
failed: '生成好运混音失败,请重试。',
|
||||
unavailable: '当前服务器不支持好运混音。',
|
||||
cancelTooltip: '取消生成好运混音',
|
||||
},
|
||||
albums: {
|
||||
title: '全部专辑',
|
||||
@@ -709,8 +710,8 @@ export const zhTranslation = {
|
||||
showChangelogOnUpdate: '更新时显示"新功能"',
|
||||
showChangelogOnUpdateDesc: '更新后在「正在播放」上方显示一个低调的更新日志横幅。点击打开发行说明,X 按钮关闭。',
|
||||
randomMixTitle: '随机混音黑名单',
|
||||
luckyMixMenuTitle: '在菜单中显示“好运”',
|
||||
luckyMixMenuDesc: '在“创建混音”中启用“好运”,并在分离导航时作为独立菜单项显示。仅当当前服务器启用 AudioMuse 时可见。',
|
||||
luckyMixMenuTitle: '在菜单中显示“好运混音”',
|
||||
luckyMixMenuDesc: '在“创建混音”中启用“好运混音”,并在分离导航时作为独立菜单项显示。仅当当前服务器启用 AudioMuse 时可见。',
|
||||
randomMixBlacklistTitle: '自定义过滤关键词',
|
||||
randomMixBlacklistDesc: '当任何关键词匹配流派、标题、专辑或艺术家时,歌曲将被排除(当上方复选框开启时生效)。',
|
||||
randomMixBlacklistPlaceholder: '添加关键词…',
|
||||
@@ -747,7 +748,7 @@ export const zhTranslation = {
|
||||
sidebarDrag: '拖动以重新排序',
|
||||
sidebarFixed: '始终显示',
|
||||
randomNavSplitTitle: '拆分混音导航',
|
||||
randomNavSplitDesc: '在侧边栏中将“随机混音”、“随机专辑”和“好运”显示为独立条目,而非“创建混音”合并入口。',
|
||||
randomNavSplitDesc: '在侧边栏中将“随机混音”、“随机专辑”和“好运混音”显示为独立条目,而非“创建混音”合并入口。',
|
||||
tabInput: '输入',
|
||||
tabUsers: '用户',
|
||||
tabSystem: '系统',
|
||||
|
||||
Reference in New Issue
Block a user