mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 23:05:46 +00:00
fix(pr-review): address review findings for music folder filter
- Sidebar.tsx: title={} → data-tooltip + data-tooltip-pos="right" on
scope subtitle (CLAUDE.md rule: never use native title= for tooltips)
- authStore.ts: merge two set() calls in setMusicFolders into one atomic
update — avoids double render on folder list arrival
- locales (all 7): remove dead libraryScopeHint key (defined but never
rendered in any component)
- Genres.tsx: remove musicLibraryFilterVersion from effect deps —
getGenres is intentionally not folder-scoped, re-fetching on filter
change was a no-op waste
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+10
-8
@@ -243,15 +243,17 @@ export const useAuthStore = create<AuthState>()(
|
||||
setHotCacheDownloadDir: (v) => set({ hotCacheDownloadDir: v }),
|
||||
|
||||
setMusicFolders: (folders) => {
|
||||
set({ musicFolders: folders });
|
||||
const sid = get().activeServerId;
|
||||
if (!sid) return;
|
||||
const f = get().musicLibraryFilterByServer[sid];
|
||||
if (f && f !== 'all' && !folders.some(x => x.id === f)) {
|
||||
set(s => ({
|
||||
musicLibraryFilterByServer: { ...s.musicLibraryFilterByServer, [sid]: 'all' },
|
||||
}));
|
||||
}
|
||||
set(s => {
|
||||
const f = sid ? s.musicLibraryFilterByServer[sid] : undefined;
|
||||
const invalidFilter = f && f !== 'all' && !folders.some(x => x.id === f);
|
||||
return {
|
||||
musicFolders: folders,
|
||||
...(sid && invalidFilter
|
||||
? { musicLibraryFilterByServer: { ...s.musicLibraryFilterByServer, [sid]: 'all' } }
|
||||
: {}),
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
setMusicLibraryFilter: (folderId) => {
|
||||
|
||||
Reference in New Issue
Block a user