Make ratings/favourites a bit more customizable (#2262)

* Replace show ratings toggle with favorite/rating controls setting

Swap `genera.showRatings` (previously a simple bool) for a
`favoriteRatingControls` enum, exposed via derived `useShowRatings` /
`useShowFavorites` hooks. Settings switch becomes a select, with a
migration to a new v32 schema mapping the old boolean forward with no
user change.

* Gate favorite controls on `favoriteRatingControls` setting

Hide the playerbar and mobile fullscreen favorite buttons and the
context-menu favorite action when the setting excludes favorites,
mirroring how ratings are already gated.

* Gate favorite controls on item cards and detail list

Drill a `showFavorite` flag through the item-card tree (mirroring
`showRating`), and gate the card/detail-list favorite badges and hover
buttons on the `favoriteRatingControls` setting.

* Gate favorite controls in detail headers and album group controls

* Keep the original `showRatings` switch and add a `showFavorites`

* Gate album header favorite hander at definition
This commit is contained in:
Marc Plano-Lesay
2026-07-26 22:59:17 +10:00
committed by GitHub
parent d0710f3549
commit 07ef323ccc
15 changed files with 143 additions and 69 deletions
+7 -1
View File
@@ -537,6 +537,7 @@ export const GeneralSettingsSchema = z.object({
primaryShade: z.number().min(0).max(9),
qobuz: z.boolean(),
resume: z.boolean(),
showFavorites: z.boolean(),
showLyricsInSidebar: z.boolean(),
showQueueInSidebar: z.boolean(),
showRatings: z.boolean(),
@@ -991,6 +992,7 @@ export type DataGridProps = {
export type DataTableProps = z.infer<typeof ItemTableListPropsSchema>;
export type ItemDetailListProps = z.infer<typeof ItemDetailListPropsSchema>;
export type ItemListSettings = {
detail?: ItemDetailListProps;
display: ListDisplayType;
@@ -1005,7 +1007,6 @@ export type PlayerFilter = z.infer<typeof PlayerFilterSchema>;
export type PlayerFilterField = z.infer<typeof PlayerFilterFieldSchema>;
export type PlayerFilterOperator = z.infer<typeof PlayerFilterOperatorSchema>;
export interface SettingsSlice extends z.infer<typeof SettingsStateSchema> {
actions: {
addCollection: (collection: SavedCollection) => void;
@@ -1031,6 +1032,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>;
@@ -1314,6 +1316,7 @@ const initialState: SettingsState = {
primaryShade: 6,
qobuz: true,
resume: true,
showFavorites: true,
showLyricsInSidebar: true,
showQueueInSidebar: true,
showRatings: true,
@@ -2937,6 +2940,9 @@ export const usePlayerbarOpenDrawer = () =>
export const useShowRatings = () => useSettingsStore((state) => state.general.showRatings, shallow);
export const useShowFavorites = () =>
useSettingsStore((state) => state.general.showFavorites, shallow);
export const useArtistRadioCount = () =>
useSettingsStore((state) => state.general.artistRadioCount, shallow);