From 07ac3d3631b365ecf4b00cd59ea1f7bf2763ca43 Mon Sep 17 00:00:00 2001 From: KeelrLeek <156356974+KeelrLeek@users.noreply.github.com> Date: Tue, 8 Sep 2026 15:43:13 -0500 Subject: [PATCH] =?UTF-8?q?settings:=20the=20long=20lists=20use=20the=20ap?= =?UTF-8?q?p's=20own=20chooser=20=E2=80=94=20the=20sort=20menu's=20popover?= =?UTF-8?q?=20under=20a=20pill=20=E2=80=94=20instead=20of=20native=20selec?= =?UTF-8?q?ts=20the=20webview=20draws=20with=20the=20OS's=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Chooser.svelte | 149 ++++++++++++++++++++++++++++++++++ src/views/Settings.svelte | 67 ++++----------- 2 files changed, 167 insertions(+), 49 deletions(-) create mode 100644 src/components/Chooser.svelte diff --git a/src/components/Chooser.svelte b/src/components/Chooser.svelte new file mode 100644 index 0000000..4fda85a --- /dev/null +++ b/src/components/Chooser.svelte @@ -0,0 +1,149 @@ + + + + +{#if open} + +{/if} + + diff --git a/src/views/Settings.svelte b/src/views/Settings.svelte index 758b504..e04efe8 100644 --- a/src/views/Settings.svelte +++ b/src/views/Settings.svelte @@ -10,6 +10,7 @@ import { applyGlass } from "../lib/glass.js"; import * as api from "../lib/api.js"; import Icon from "../components/Icon.svelte"; + import Chooser from "../components/Chooser.svelte"; import { community, refreshFreenet, @@ -311,6 +312,19 @@ return d.toLocaleDateString([], { month: "short", day: "numeric" }); } + // ---- the long lists, as [value, label] for the chooser ------------------- + const RETENTION = [["1", "1 day"], ["3", "3 days"], ["7", "1 week"], ["14", "2 weeks"], ["30", "1 month (recommended)"], ["90", "3 months"], ["forever", "Forever — save to library"]]; + const CACHE = [["512", "512 MB"], ["1024", "1 GB"], ["2048", "2 GB (recommended)"], ["5120", "5 GB"], ["10240", "10 GB"], ["20480", "20 GB"], ["0", "Unlimited"]]; + const MIN_QUALITY = [["any", "Any quality"], ["kbps192", "192 kbps and up"], ["kbps256", "256 kbps and up"], ["kbps320", "320 kbps and up"], ["lossless", "Lossless only"]]; + const audioOutputs = $derived.by(() => { + if (!settings) return []; + const out = [["", "System default (recommended)"]]; + const cur = settings.audio_output_device; + if (cur && !settings.audio_output_devices.includes(cur)) out.push([cur, `${cur} (unavailable)`]); + for (const d of settings.audio_output_devices) out.push([d, d]); + return out; + }); + // ---- the index --------------------------------------------------------- const SECTIONS = [ { id: "account", title: "Account", group: "You" }, @@ -533,17 +547,7 @@
Audio output
System default follows Windows when headphones or speakers change.
-
- -
+
setAudioOutput(v)} disabled={saving} />
@@ -611,34 +615,14 @@
Keep streamed tracks
Streamed songs stay in a private cache for instant replay — not in your library. Forever adds everything you stream to the library instead.
-
- -
+
setStreamRetention(v)} disabled={saving} />
Cache size limit
Oldest streamed tracks are removed first once the cache passes this size. Saved and downloaded music is never touched.
-
- -
+
setStreamCacheMax(v)} disabled={saving} />
Retention counts from the last time a track was played. Tracks you save stay in your library regardless.
@@ -721,15 +705,7 @@
Minimum
Reject files below this floor. Lossy files must report a bitrate to qualify.
-
- -
+
setSourcePref(mode.key, "min", v)} disabled={saving} />
@@ -876,13 +852,6 @@ .seg button.on { background: var(--accent); color: #000; } .seg button:hover:not(.on):not(:disabled) { color: #fff; } .seg button:disabled { opacity: 0.6; cursor: default; } - /* a long list stays a real