mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
refactor(settings): thematic tab regroup + accordion sub-sections + in-page search (closes #257) (#259)
* refactor(settings): regroup tabs thematically + accordion sub-sections (progress on #257) New tab structure: Servers (first) · Library · Audio · Lyrics · Appearance · Personalisation · Integrations · Input · Storage · System · Users. Reusable SettingsSubSection (native <details>) wraps related settings per tab, with an optional action slot for per-section reset buttons. Moved: - Lyrics sources + sidebar lyrics style → Lyrics - Sidebar / artist layout / home customisers → Personalisation - Last.fm / Discord / Bandsintown / Now-playing share → Integrations (with an opt-in privacy banner at the top) - Tray / minimize / Linux smooth-scroll → System (new App-Verhalten group) - Preload mini-player / custom titlebar / show artist images → Appearance visual options - Language picker → System Audio, Appearance and System tabs are now fully accordion-grouped. Library tab reduced to Random Mix + Ratings accordions. Servers tab is its own home (server cards + AudioMuse + logout) and the default landing tab. Indicators in the titlebar and offline banner route to the right tab. EN + DE translations added for the new tab labels and privacy banner; other locales fall back to English until the full i18n pass lands. * refactor(settings): audio/input/storage/system accordions, in-page search, Navidrome focus Settings refactor progress — every tab is now accordion-grouped: - Audio: Output · Hi-Res · EQ · Playback · Next-track buffer - Input: Keybindings · Global shortcuts (reset in accordion action slot) - Storage: Offline · Downloads - System: Language (default open) · Behavior · Backup · Logging · About · Contributors - Contributors: own card grid with per-contributor expand, sorted by contribution count. Changelog accordion removed (release-notes link and "show changelog on update" toggle now live inside About). - About: Navidrome focus; AI credit and Special Thanks removed; new Maintainers row (Psychotoxical + cucadmuh). In-page search: magnifier icon next to the Settings title. Click opens a 240px search field. Filters the active tab's sub-sections by title match (data-settings-search). Cross-tab search is tracked as a follow-up. serverCompatible updated in all 8 locales from "Compatible with: Navidrome Gonic Airsonic Subsonic" to a Navidrome-first wording that warns other Subsonic-compatible servers may have reduced functionality. Full i18n pass (tabLyrics/tabPersonalisation/tabIntegrations, aboutDesc, privacy banner, etc. in fr/nl/zh/nb/ru/es) follows in a separate commit after visual review. * i18n(settings): complete localisation pass for refactored tabs Added in all 8 locales (fr, nl, zh, nb, ru, es — en+de already in place): - Tab labels: tabLibrary, tabServers, tabLyrics, tabPersonalisation, tabIntegrations - inputKeybindingsTitle, searchPlaceholder, searchNoResults, aboutMaintainersLabel - integrationsPrivacyTitle, integrationsPrivacyBody - aboutContributorsCount_one/_other (ru also _few/_many for proper plural forms) - aboutDesc rewritten to describe a Navidrome-focused player instead of a generic Subsonic-compatible one. Removed dead keys in all 8 locales: - aboutAiCredit, aboutSpecialThanksLabel — no longer rendered - changelog — inline changelog accordion removed - tabServer, tabGeneral — superseded by new tab structure --------- Co-authored-by: Psychotoxical <dev@psysonic.app>
This commit is contained in:
committed by
GitHub
parent
f6f76723d8
commit
2a496c600b
@@ -0,0 +1,60 @@
|
||||
import React, { useId } from 'react';
|
||||
import { ChevronDown } from 'lucide-react';
|
||||
|
||||
interface SettingsSubSectionProps {
|
||||
title: string;
|
||||
icon?: React.ReactNode;
|
||||
defaultOpen?: boolean;
|
||||
description?: string;
|
||||
searchText?: string;
|
||||
// Rechts im Summary neben dem Chevron (z.B. Reset-Button). Clicks werden
|
||||
// gestoppt, damit sie das Accordion nicht togglen.
|
||||
action?: React.ReactNode;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
// Wird innerhalb eines Settings-Tabs als Accordion-Gruppe genutzt. Natives
|
||||
// <details> liefert Keyboard + ARIA gratis; der CSS-Stil setzt den Chevron
|
||||
// im Summary mittels [open]-Selektor.
|
||||
export default function SettingsSubSection({
|
||||
title,
|
||||
icon,
|
||||
defaultOpen = false,
|
||||
description,
|
||||
searchText,
|
||||
action,
|
||||
children,
|
||||
}: SettingsSubSectionProps) {
|
||||
const headingId = useId();
|
||||
return (
|
||||
<details
|
||||
className="settings-sub-section"
|
||||
data-settings-search={searchText ?? title}
|
||||
open={defaultOpen}
|
||||
>
|
||||
<summary
|
||||
className="settings-sub-section-summary"
|
||||
aria-labelledby={headingId}
|
||||
>
|
||||
{icon && <span className="settings-sub-section-icon">{icon}</span>}
|
||||
<span id={headingId} className="settings-sub-section-title">{title}</span>
|
||||
{action && (
|
||||
<span
|
||||
className="settings-sub-section-action"
|
||||
onClick={e => e.stopPropagation()}
|
||||
onKeyDown={e => e.stopPropagation()}
|
||||
>
|
||||
{action}
|
||||
</span>
|
||||
)}
|
||||
<ChevronDown size={16} className="settings-sub-section-chevron" aria-hidden="true" />
|
||||
</summary>
|
||||
{description && (
|
||||
<p className="settings-sub-section-desc">{description}</p>
|
||||
)}
|
||||
<div className="settings-sub-section-content">
|
||||
{children}
|
||||
</div>
|
||||
</details>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user