fix(a11y): add hidden SheetTitle к MobileSidebar (Radix warning)

This commit is contained in:
Александр Зимин
2026-05-14 22:42:00 +00:00
parent 55a1171ac4
commit dfae205c95
@@ -26,7 +26,7 @@ import {
useReviewsBadgeCount,
useWebhookSubscriptions,
} from '@/api/queries'
import { Sheet, SheetContent } from '@/ui'
import { Sheet, SheetContent, SheetTitle } from '@/ui'
import { ThemeSwitch } from '@/components/layout/ThemeSwitch'
import { cn } from '@/lib/utils'
@@ -527,6 +527,14 @@ export function MobileSidebar({ open, onClose }: { open: boolean; onClose: () =>
size="md"
className="!w-[260px] !max-w-[260px] !p-0 !gap-0 flex flex-col bg-surface"
>
{/* Hidden title — Radix DialogContent (which Sheet wraps) требует
DialogTitle для screen reader а11y. Визуально не нужен (logo
block внутри SidebarContent уже служит heading), поэтому
sr-only. Без этого Radix кидает dev-mode warning + screen
reader users не понимают что за dialog открыт. */}
<SheetTitle className="sr-only">
{t('nav.menu', { defaultValue: 'Меню навигации' })}
</SheetTitle>
<SidebarContent sections={visibleSections} auth={auth} onNavigate={onClose} />
</SheetContent>
</Sheet>