Fluidité et ménage
- Catalogue : grille affichée par tranches de 60 au fil du défilement (sans revenir en haut quand une fiche change), images décodées en arrière-plan, avatars chargés à la demande - Réglage « couleur d'accent » retiré des réglages, de la synchro et des sauvegardes (n'existait plus) - CLAUDE.md à jour (adresse du site, état au 28 nov.) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
8 files changed
+31
-18
No files matched your search
+5
-5
@@ -35,7 +35,7 @@ function persistLists(lists: CustomList[]) {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
const DEFAULT_SETTINGS: Settings = { topCategories: ALL_TOP_CATEGORIES, accentColor: '#f0a63a', themeMode: 'auto' }
|
||||
const DEFAULT_SETTINGS: Settings = { topCategories: ALL_TOP_CATEGORIES, themeMode: 'auto' }
|
||||
|
||||
/** Relit les réglages en ne gardant que des valeurs valides (le localStorage peut avoir été modifié). */
|
||||
function loadSettings(): Settings {
|
||||
@@ -242,9 +242,9 @@ export function MediaProvider({
|
||||
getLists: () => listsRef.current,
|
||||
applyLists: (next) => setLists(() => next, true),
|
||||
getSettings: () => {
|
||||
const { topCategories, accentColor, themeMode, statsHiddenMonths } = settingsRef.current
|
||||
const { topCategories, themeMode, statsHiddenMonths } = settingsRef.current
|
||||
// Mois masqués : liste vide plutôt qu'absente, sinon « tout réafficher » ne partirait jamais au serveur
|
||||
return { topCategories, accentColor, themeMode, statsHiddenMonths: statsHiddenMonths ?? [] }
|
||||
return { topCategories, themeMode, statsHiddenMonths: statsHiddenMonths ?? [] }
|
||||
},
|
||||
applySettings: (patch) => updateSettingsRef.current(patch, true),
|
||||
itemsChanged: () => void reloadItems().catch(() => {}),
|
||||
@@ -285,7 +285,7 @@ export function MediaProvider({
|
||||
}, [settings.themeMode])
|
||||
|
||||
const updateSettings = useCallback((patch: Partial<Settings>, silent = false) => {
|
||||
if (!silent && syncRef.current && ('topCategories' in patch || 'accentColor' in patch || 'themeMode' in patch || 'statsHiddenMonths' in patch)) syncRef.current.markSettings()
|
||||
if (!silent && syncRef.current && ('topCategories' in patch || 'themeMode' in patch || 'statsHiddenMonths' in patch)) syncRef.current.markSettings()
|
||||
setSettings((prev) => {
|
||||
const next = { ...prev, ...patch }
|
||||
try {
|
||||
@@ -574,7 +574,7 @@ export function MediaProvider({
|
||||
const current = settingsRef.current
|
||||
const merged = oldSettings
|
||||
const patch: Partial<Settings> = {}
|
||||
for (const k of ['topCategories', 'accentColor', 'themeMode'] as const) {
|
||||
for (const k of ['topCategories', 'themeMode'] as const) {
|
||||
if (mine[k] === undefined && merged[k] !== undefined) Object.assign(patch, { [k]: merged[k] })
|
||||
}
|
||||
if (oldSettings.statsHiddenMonths?.length) patch.statsHiddenMonths = [...new Set([...(current.statsHiddenMonths ?? []), ...oldSettings.statsHiddenMonths])].sort()
|
||||
|
||||
Reference in new issue
Block a user