From c9dfbcc19f9e9d246850f137e423d28804afc2fb Mon Sep 17 00:00:00 2001 From: Psychotoxical Date: Fri, 10 Apr 2026 11:17:33 +0200 Subject: [PATCH] chore(settings): reset uiScale to 1.0 on startup while scaling is disabled Users who had previously set a custom scale are silently reset to 100% on next launch so they are not stuck at a broken zoom level. The stored value is cleared in fontStore so the slider starts at 100% once the feature is re-enabled. Also credits nisrael for the ICY / AzuraCast PR #146. TODO: remove the reset effect and re-enable the slider in Settings.tsx when UI scaling is properly reworked. Co-Authored-By: Claude Sonnet 4.6 --- src/App.tsx | 9 +++++++++ src/pages/Settings.tsx | 1 + 2 files changed, 10 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 62299fdd..00c08c38 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -557,6 +557,7 @@ export default function App() { const effectiveTheme = useThemeScheduler(); const font = useFontStore(s => s.font); const uiScale = useFontStore(s => s.uiScale); + const setUiScale = useFontStore(s => s.setUiScale); const [exportPickerOpen, setExportPickerOpen] = useState(false); useEffect(() => { @@ -567,6 +568,14 @@ export default function App() { document.documentElement.setAttribute('data-font', font); }, [font]); + // TODO(ui-scale): UI scaling is disabled pending a cross-platform rework. + // Reset any stored non-100% value so users aren't stuck at a broken scale. + // When re-enabling: remove this effect AND re-enable the slider in Settings.tsx. + useEffect(() => { + if (uiScale !== 1.0) setUiScale(1.0); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + useEffect(() => { document.documentElement.style.zoom = String(uiScale); }, [uiScale]); diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 48bfe6bf..7d36f48b 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -116,6 +116,7 @@ const CONTRIBUTORS = [ contributions: [ 'Nightfox.nvim theme group in Open Source Classics (PR #114)', 'Switch reqwest to rustls-tls for cross-platform TLS (PR #112)', + 'ICY stream metadata & AzuraCast Now Playing support (PR #146)', ], }, ] as const;