support vertical play queue layout

This commit is contained in:
jeffvli
2026-03-17 19:00:55 -07:00
parent 8ccd97b574
commit db88a6bc22
14 changed files with 268 additions and 32 deletions
+9 -2
View File
@@ -75,6 +75,7 @@ type SidebarProps = {
image: boolean;
leftWidth: string;
rightExpanded: boolean;
rightHeight: string;
rightWidth: string;
};
@@ -222,6 +223,7 @@ export const useAppStore = createWithEqualityFn<AppSlice>()(
image: false,
leftWidth: '400px',
rightExpanded: false,
rightHeight: '320px',
rightWidth: '600px',
},
titlebar: {
@@ -240,7 +242,12 @@ export const useAppStore = createWithEqualityFn<AppSlice>()(
return {} as AppState;
}
return persistedState;
const state = persistedState as AppState;
if (version <= 4 && !state.sidebar.rightHeight) {
state.sidebar.rightHeight = '320px';
}
return state;
},
name: 'store_app',
partialize: (state) => {
@@ -248,7 +255,7 @@ export const useAppStore = createWithEqualityFn<AppSlice>()(
const { globalExpanded: _, ...rest } = state;
return rest;
},
version: 4,
version: 5,
},
),
);
@@ -40,6 +40,7 @@ const LYRICS_ALIGNMENTS = new Set(['center', 'left', 'right']);
const FONT_TYPES = new Set(['builtIn', 'custom', 'system']);
const HOME_FEATURE_STYLES = new Set(['multiple', 'single']);
const SIDE_QUEUE_TYPES = new Set(['sideDrawerQueue', 'sideQueue']);
const SIDE_QUEUE_LAYOUTS = new Set(['horizontal', 'vertical']);
export type EnvSettingsOverrides = DeepPartial<
Pick<SettingsState, 'autoDJ' | 'css' | 'discord' | 'font' | 'general' | 'lyrics' | 'playback'>
@@ -200,6 +201,12 @@ const ENV_SETTING_SPECS: EnvSettingSpec[] = [
path: ['general', 'sideQueueType'],
type: 'enum',
},
{
enumSet: SIDE_QUEUE_LAYOUTS,
key: 'FS_GENERAL_SIDE_QUEUE_LAYOUT',
path: ['general', 'sideQueueLayout'],
type: 'enum',
},
{ key: 'FS_GENERAL_RESUME', path: ['general', 'resume'], type: 'bool' },
{
key: 'FS_GENERAL_USE_THEME_ACCENT_COLOR',
+14 -1
View File
@@ -171,6 +171,7 @@ const GenreTargetSchema = z.enum(['album', 'track']);
const PlaylistTargetSchema = z.enum(['album', 'track']);
const SideQueueTypeSchema = z.enum(['sideDrawerQueue', 'sideQueue']);
const SideQueueLayoutSchema = z.enum(['horizontal', 'vertical']);
const SidebarPanelTypeSchema = z.enum(['queue', 'lyrics', 'visualizer']);
@@ -498,6 +499,7 @@ export const GeneralSettingsSchema = z.object({
sidebarPlaylistList: z.boolean(),
sidebarPlaylistListFilterRegex: z.string(),
sidebarPlaylistSorting: z.boolean(),
sideQueueLayout: SideQueueLayoutSchema,
sideQueueType: SideQueueTypeSchema,
skipButtons: SkipButtonsSchema,
spotify: z.boolean(),
@@ -893,6 +895,7 @@ export interface SettingsSlice extends z.infer<typeof SettingsStateSchema> {
export interface SettingsState extends z.infer<typeof SettingsStateSchema> {}
export type SidebarItemType = z.infer<typeof SidebarItemTypeSchema>;
export type SideQueueLayout = z.infer<typeof SideQueueLayoutSchema>;
export type SideQueueType = z.infer<typeof SideQueueTypeSchema>;
export type SortableItem<T extends string> = {
@@ -1158,6 +1161,7 @@ const initialState: SettingsState = {
sidebarPlaylistList: true,
sidebarPlaylistListFilterRegex: '',
sidebarPlaylistSorting: false,
sideQueueLayout: 'horizontal',
sideQueueType: 'sideQueue',
skipButtons: {
enabled: false,
@@ -2381,10 +2385,16 @@ export const useSettingsStore = createWithEqualityFn<SettingsSlice>()(
});
}
if (version <= 27) {
if (!state.general.sideQueueLayout) {
state.general.sideQueueLayout = initialState.general.sideQueueLayout;
}
}
return persistedState;
},
name: 'store_settings',
version: 26,
version: 27,
},
),
);
@@ -2492,6 +2502,9 @@ export const useThemeSettings = () =>
export const useSideQueueType = () =>
useSettingsStore((state) => state.general.sideQueueType, shallow);
export const useSideQueueLayout = () =>
useSettingsStore((state) => state.general.sideQueueLayout, shallow);
export const useVolumeWheelStep = () =>
useSettingsStore((state) => state.general.volumeWheelStep, shallow);