mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-21 22:15:40 +00:00
feat(queue): switchable queue display mode (Queue vs Playlist) (#922)
* feat(queue): add queueDisplayMode setting with rehydrate (default queue) * feat(queue): render upcoming-only or full timeline by mode, with header toggle * feat(settings): add queue display mode toggle to Personalisation * i18n: queue display mode strings across all locales * test(queue): display-mode rendering and absolute index mapping * docs: changelog + credits for queue display mode (#922)
This commit is contained in:
committed by
GitHub
parent
7b06be5ba2
commit
1de2b0e850
@@ -17,6 +17,7 @@ import type {
|
||||
DiscordCoverSource,
|
||||
DurationMode,
|
||||
LyricsSourceConfig,
|
||||
QueueDisplayMode,
|
||||
SeekbarStyle,
|
||||
} from './authStoreTypes';
|
||||
|
||||
@@ -103,6 +104,15 @@ export function computeAuthStoreRehydration(state: AuthState): Partial<AuthState
|
||||
? {}
|
||||
: { queueDurationDisplayMode: 'total' as DurationMode };
|
||||
|
||||
// Missing key (pre-feature persist) / garbage maps to 'queue' — the default
|
||||
// mode, which lists only upcoming tracks.
|
||||
const VALID_QUEUE_DISPLAY_MODES = new Set<string>(['playlist', 'queue']);
|
||||
const queueDisplayModeMigrated = VALID_QUEUE_DISPLAY_MODES.has(
|
||||
(state as { queueDisplayMode?: unknown }).queueDisplayMode as string,
|
||||
)
|
||||
? {}
|
||||
: { queueDisplayMode: 'queue' as QueueDisplayMode };
|
||||
|
||||
const VALID_WAYLAND_TEXT_PROFILE = new Set<string>(['balanced', 'sharp', 'gpu', 'minimal']);
|
||||
const rawWaylandProfile = (state as { linuxWaylandTextRenderProfile?: unknown }).linuxWaylandTextRenderProfile;
|
||||
const linuxWaylandTextRenderProfileMigrated = VALID_WAYLAND_TEXT_PROFILE.has(rawWaylandProfile as string)
|
||||
@@ -162,6 +172,7 @@ export function computeAuthStoreRehydration(state: AuthState): Partial<AuthState
|
||||
...wheelSmoothOneTime,
|
||||
...seekbarStyleMigrated,
|
||||
...queueDurationDisplayModeMigrated,
|
||||
...queueDisplayModeMigrated,
|
||||
...linuxWaylandTextRenderProfileMigrated,
|
||||
...discordCoverSourceMigrated,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user