add skip navigation, page title, and global ARIA live region
This commit is contained in:
10
src/App.tsx
10
src/App.tsx
@@ -13,12 +13,15 @@ import { SettingsDialog } from "@/components/settings/SettingsDialog";
|
||||
import { ToastContainer } from "@/components/toast/ToastContainer";
|
||||
import { ShortcutHelpModal } from "@/components/shortcuts/ShortcutHelpModal";
|
||||
import { useKeyboardShortcuts } from "@/hooks/useKeyboardShortcuts";
|
||||
import { useAnnounceStore } from "@/hooks/useAnnounce";
|
||||
|
||||
export default function App() {
|
||||
const initialized = useAppStore((s) => s.initialized);
|
||||
const init = useAppStore((s) => s.init);
|
||||
const view = useAppStore((s) => s.view);
|
||||
const reduceMotion = useAppStore((s) => s.settings.reduceMotion);
|
||||
const boardTitle = useBoardStore((s) => s.board?.title);
|
||||
const announcement = useAnnounceStore((s) => s.message);
|
||||
|
||||
const [settingsOpen, setSettingsOpen] = useState(false);
|
||||
const [shortcutHelpOpen, setShortcutHelpOpen] = useState(false);
|
||||
@@ -111,6 +114,10 @@ export default function App() {
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
document.title = boardTitle ? `${boardTitle} - OpenPylon` : "OpenPylon";
|
||||
}, [boardTitle, view]);
|
||||
|
||||
const handleOpenSettings = useCallback(() => {
|
||||
setSettingsOpen(true);
|
||||
}, []);
|
||||
@@ -129,6 +136,9 @@ export default function App() {
|
||||
|
||||
return (
|
||||
<MotionConfig reducedMotion={reduceMotion ? "always" : "user"}>
|
||||
<div aria-live="assertive" aria-atomic="true" className="sr-only">
|
||||
{announcement}
|
||||
</div>
|
||||
<AppShell>
|
||||
<AnimatePresence mode="wait">
|
||||
{view.type === "board-list" ? (
|
||||
|
||||
Reference in New Issue
Block a user