mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
fix(pr168): title→data-tooltip, i18n playlist toggle, cold-start playlist fetch
- Replace title= with data-tooltip on sidebar playlist expand button (CLAUDE.md) - Replace hardcoded Spanish aria-label strings with i18n keys (sidebar.expandPlaylists / collapsePlaylists) across all 8 locales - AddToPlaylistSubmenu now fetches playlists on first open if store is empty (regression fix) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,13 @@ export function AddToPlaylistSubmenu({ songIds, onDone, dropDown, triggerId }: {
|
|||||||
const recentIds = usePlaylistStore((s) => s.recentIds);
|
const recentIds = usePlaylistStore((s) => s.recentIds);
|
||||||
const createPlaylist = usePlaylistStore((s) => s.createPlaylist);
|
const createPlaylist = usePlaylistStore((s) => s.createPlaylist);
|
||||||
const touchPlaylist = usePlaylistStore((s) => s.touchPlaylist);
|
const touchPlaylist = usePlaylistStore((s) => s.touchPlaylist);
|
||||||
|
const fetchPlaylists = usePlaylistStore((s) => s.fetchPlaylists);
|
||||||
|
|
||||||
|
// Fetch playlists on first open if the store hasn't been populated yet
|
||||||
|
useEffect(() => {
|
||||||
|
if (storePlaylists.length === 0) fetchPlaylists();
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, []);
|
||||||
|
|
||||||
// Sort playlists by recent usage
|
// Sort playlists by recent usage
|
||||||
const playlists = useMemo(() => {
|
const playlists = useMemo(() => {
|
||||||
|
|||||||
@@ -250,8 +250,8 @@ export default function Sidebar({
|
|||||||
className={`sidebar-playlists-toggle ${playlistsExpanded ? 'expanded' : ''}`}
|
className={`sidebar-playlists-toggle ${playlistsExpanded ? 'expanded' : ''}`}
|
||||||
onClick={() => setPlaylistsExpanded(!playlistsExpanded)}
|
onClick={() => setPlaylistsExpanded(!playlistsExpanded)}
|
||||||
aria-expanded={playlistsExpanded}
|
aria-expanded={playlistsExpanded}
|
||||||
aria-label={playlistsExpanded ? 'Colapsar listas' : 'Expandir listas'}
|
aria-label={playlistsExpanded ? t('sidebar.collapsePlaylists') : t('sidebar.expandPlaylists')}
|
||||||
title={playlistsExpanded ? 'Colapsar listas' : 'Expandir listas'}
|
data-tooltip={playlistsExpanded ? t('sidebar.collapsePlaylists') : t('sidebar.expandPlaylists')}
|
||||||
>
|
>
|
||||||
<ChevronRight size={14} />
|
<ChevronRight size={14} />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export const deTranslation = {
|
|||||||
folderBrowser: 'Ordner-Browser',
|
folderBrowser: 'Ordner-Browser',
|
||||||
libraryScope: 'Bibliotheksumfang',
|
libraryScope: 'Bibliotheksumfang',
|
||||||
allLibraries: 'Alle Bibliotheken',
|
allLibraries: 'Alle Bibliotheken',
|
||||||
|
expandPlaylists: 'Playlists ausklappen',
|
||||||
|
collapsePlaylists: 'Playlists einklappen',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
hero: 'Featured',
|
hero: 'Featured',
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ export const enTranslation = {
|
|||||||
folderBrowser: 'Folder Browser',
|
folderBrowser: 'Folder Browser',
|
||||||
libraryScope: 'Library scope',
|
libraryScope: 'Library scope',
|
||||||
allLibraries: 'All libraries',
|
allLibraries: 'All libraries',
|
||||||
|
expandPlaylists: 'Expand playlists',
|
||||||
|
collapsePlaylists: 'Collapse playlists',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
hero: 'Featured',
|
hero: 'Featured',
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ export const esTranslation = {
|
|||||||
folderBrowser: 'Explorar Carpetas',
|
folderBrowser: 'Explorar Carpetas',
|
||||||
libraryScope: 'Ámbito de biblioteca',
|
libraryScope: 'Ámbito de biblioteca',
|
||||||
allLibraries: 'Todas las bibliotecas',
|
allLibraries: 'Todas las bibliotecas',
|
||||||
|
expandPlaylists: 'Expandir listas',
|
||||||
|
collapsePlaylists: 'Colapsar listas',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
hero: 'Destacado',
|
hero: 'Destacado',
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export const frTranslation = {
|
|||||||
folderBrowser: 'Explorateur de dossiers',
|
folderBrowser: 'Explorateur de dossiers',
|
||||||
libraryScope: 'Portée de la bibliothèque',
|
libraryScope: 'Portée de la bibliothèque',
|
||||||
allLibraries: 'Toutes les bibliothèques',
|
allLibraries: 'Toutes les bibliothèques',
|
||||||
|
expandPlaylists: 'Développer les playlists',
|
||||||
|
collapsePlaylists: 'Réduire les playlists',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
hero: 'En vedette',
|
hero: 'En vedette',
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export const nbTranslation = {
|
|||||||
folderBrowser: 'Mappeleser',
|
folderBrowser: 'Mappeleser',
|
||||||
libraryScope: 'Biblioteksomfang',
|
libraryScope: 'Biblioteksomfang',
|
||||||
allLibraries: 'Alle biblioteker',
|
allLibraries: 'Alle biblioteker',
|
||||||
|
expandPlaylists: 'Utvid spillelister',
|
||||||
|
collapsePlaylists: 'Skjul spillelister',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
hero: 'Utvalgt',
|
hero: 'Utvalgt',
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export const nlTranslation = {
|
|||||||
folderBrowser: 'Mappenverkenner',
|
folderBrowser: 'Mappenverkenner',
|
||||||
libraryScope: 'Bibliotheekbereik',
|
libraryScope: 'Bibliotheekbereik',
|
||||||
allLibraries: 'Alle bibliotheken',
|
allLibraries: 'Alle bibliotheken',
|
||||||
|
expandPlaylists: 'Afspeellijsten uitklappen',
|
||||||
|
collapsePlaylists: 'Afspeellijsten inklappen',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
hero: 'Uitgelicht',
|
hero: 'Uitgelicht',
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ export const ruTranslation = {
|
|||||||
folderBrowser: 'Браузер папок',
|
folderBrowser: 'Браузер папок',
|
||||||
libraryScope: 'Область медиатеки',
|
libraryScope: 'Область медиатеки',
|
||||||
allLibraries: 'Все библиотеки',
|
allLibraries: 'Все библиотеки',
|
||||||
|
expandPlaylists: 'Развернуть плейлисты',
|
||||||
|
collapsePlaylists: 'Свернуть плейлисты',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
hero: 'Подборка',
|
hero: 'Подборка',
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export const zhTranslation = {
|
|||||||
folderBrowser: '文件夹浏览器',
|
folderBrowser: '文件夹浏览器',
|
||||||
libraryScope: '资料库范围',
|
libraryScope: '资料库范围',
|
||||||
allLibraries: '所有资料库',
|
allLibraries: '所有资料库',
|
||||||
|
expandPlaylists: '展开播放列表',
|
||||||
|
collapsePlaylists: '收起播放列表',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
hero: '精选',
|
hero: '精选',
|
||||||
|
|||||||
Reference in New Issue
Block a user