feat(settings): global Advanced Mode toggle + playlist page layout (#556) (#720)

Adds a per-element visibility toggle for the playlist detail page (Add
Songs, Import CSV, Download ZIP, Cache Offline, Suggestions) and reworks
the way uncommon options are surfaced: instead of a per-tab collapsible
group, a global "Advanced" toggle in the Settings header reveals all
`advanced` sub-sections across every tab and marks each one with a small
badge. Sets the pattern up so any future advanced option lives in its
natural tab, gated by the same switch.

- New `advancedSettingsEnabled` boolean on `authStore`
  (UiAppearance slice, persisted with the rest of the store).
- `SettingsSubSection` gains an `advanced?: boolean` prop. Hidden when
  the toggle is off; renders an "Advanced" pill in the header when on.
- Settings header gets a Toggle-Switch next to the search lupe.
- `PersonalisationTab` flattens — Sidebar + Home stay always visible;
  Artist sections, Queue Toolbar, and the new Playlist layout get
  `advanced` and disappear by default. `PersonalisationAdvancedGroup`
  component + CSS removed.
- New `playlistLayoutStore` (Zustand + persist, items[{id,visible}] +
  rehydrate sanitize) following the queueToolbarStore pattern.
- `PlaylistHero` and `PlaylistSuggestions` gate the four toolbar buttons
  and the suggestions rail on the store directly.
- One-time migration in MainApp on mount: if the user had opened the
  old per-tab Advanced group (`psysonic_personalisation_advanced_open
  === 'true'`) OR already customised any of the three sub-sections,
  Advanced Mode auto-enables on first launch. Idempotent via a
  localStorage flag; legacy key removed afterwards.
- New i18n keys `settings.advancedMode`, `settings.advancedModeTooltip`,
  `settings.advancedBadge`, `settings.playlistLayout*` in all 9 locales.

Reuses kveld9's design from PR #556; not merged because the locale split
landed afterwards. Credited under the existing kveld9 entry in
settingsCredits.ts.

Co-authored-by: Kveld. <kveld912@proton.me>
This commit is contained in:
Frank Stellmacher
2026-05-15 15:55:11 +02:00
committed by GitHub
parent e1283f4068
commit 651a3f276a
24 changed files with 404 additions and 39 deletions
+51
View File
@@ -145,6 +145,51 @@
display: none;
}
/* ── Advanced Mode: Header-Toggle + Sub-Section Badge ──────────────────────
Globaler Schalter im Settings-Header schaltet das Sichtbar-Werden aller
<SettingsSubSection advanced> Bloecke um. Der Badge markiert die jeweilige
Section nochmal optisch sobald sie eingeblendet ist. */
.settings-advanced-toggle {
display: inline-flex;
align-items: center;
gap: var(--space-2);
cursor: pointer;
user-select: none;
flex-shrink: 0;
padding: 4px 8px;
border-radius: var(--radius-md);
transition: background 120ms ease;
/* Lupe sitzt neben dem Titel; der Toggle wird durch auto-margin ans rechte
Ende der Header-Zeile geschoben. */
margin-left: auto;
}
.settings-advanced-toggle:hover {
background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.settings-advanced-toggle-label {
font-size: 13px;
color: var(--text-secondary);
font-weight: 500;
}
.settings-sub-section-advanced-badge {
display: inline-flex;
align-items: center;
font-size: 10px;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
padding: 2px 6px;
border-radius: 4px;
color: var(--text-muted);
background: color-mix(in srgb, var(--accent) 14%, transparent);
border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
flex-shrink: 0;
margin-right: var(--space-2);
}
/* ── In-Page-Suche fuer Settings ─────────────────────────────────────────── */
.settings-header {
display: flex;
@@ -156,12 +201,18 @@
.settings-header .page-title {
margin-bottom: 0;
line-height: 1;
}
.settings-search {
display: flex;
align-items: center;
flex-shrink: 0;
/* h1.page-title hat im Display-Font einen visuellen Glyph-Mittelpunkt
unterhalb der Box-Mitte. align-items: center wirkt deshalb so, als hänge
die Lupe zu hoch. Wir verschieben sie auf die Glyph-Baseline runter. */
align-self: end;
padding-bottom: 4px;
}
.settings-search-wrap {