Add dark mode, export preview, and keyboard navigation
- Add theme store with light/dark/system modes and ThemeToggle component - Prevent flash of wrong theme on initial load via inline script - Add ExportPreviewModal for previewing session exports before download - Add copy-to-clipboard functionality to session export - Implement keyboard shortcuts for tree navigation (1-9 options, Esc back, Enter continue) - Display keyboard hints in tree navigation UI - Fix findNode to safely handle undefined structure parameter - Update page title to "Apoklisis" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,9 +2,11 @@ import { useEffect } from 'react'
|
||||
import { RouterProvider } from 'react-router-dom'
|
||||
import { router } from '@/router'
|
||||
import { useAuthStore } from '@/store/authStore'
|
||||
import { useThemeStore } from '@/store/themeStore'
|
||||
|
||||
function App() {
|
||||
const { isAuthenticated, fetchUser, setLoading } = useAuthStore()
|
||||
const { theme, setTheme } = useThemeStore()
|
||||
|
||||
useEffect(() => {
|
||||
// On app load, check if we have a token and fetch user data
|
||||
@@ -18,6 +20,19 @@ function App() {
|
||||
}
|
||||
}, [])
|
||||
|
||||
// Listen for system theme changes
|
||||
useEffect(() => {
|
||||
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
|
||||
const handleChange = () => {
|
||||
if (theme === 'system') {
|
||||
setTheme('system') // Re-apply to update resolvedTheme
|
||||
}
|
||||
}
|
||||
|
||||
mediaQuery.addEventListener('change', handleChange)
|
||||
return () => mediaQuery.removeEventListener('change', handleChange)
|
||||
}, [theme, setTheme])
|
||||
|
||||
return <RouterProvider router={router} />
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user