diff --git a/src/App.tsx b/src/App.tsx index 6e1ab8d..4c495f8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -328,6 +328,9 @@ function App() { const [showShortcutsModal, setShowShortcutsModal] = useState(false); const [showAboutModal, setShowAboutModal] = useState(false); const [zoom, setZoom] = useState(100); + const [theme, setTheme] = useState<'dark' | 'light'>(() => { + return (localStorage.getItem('vesper-theme') as 'dark' | 'light') || 'dark'; + }); const [uiZoom, setUiZoom] = useState(() => { const saved = localStorage.getItem('vesper-ui-zoom'); return saved ? parseInt(saved, 10) : 100; @@ -863,6 +866,11 @@ function App() { localStorage.setItem('vesper-ui-zoom', String(Math.round(uiZoom))); }, [uiZoom]); + // Persist theme to localStorage + useEffect(() => { + localStorage.setItem('vesper-theme', theme); + }, [theme]); + // Menu bar keyboard navigation (WAI-ARIA menu pattern) const handleMenuBarKeyDown = (e: React.KeyboardEvent) => { if (e.key === 'ArrowRight') { @@ -1080,7 +1088,7 @@ function App() { }; return ( -