From 04ec81c7a271e086b9aaab1abba08f113d68d210 Mon Sep 17 00:00:00 2001 From: Daniel Castro <2968031+odanieldcs@users.noreply.github.com> Date: Sun, 11 Oct 2026 21:51:56 -0300 Subject: [PATCH 1/2] fix(a11y): landmark posts, skip to content, and mark the view switch (ENG-155) Posts sat outside a main landmark, the header took several tabs before the content, and the list/grid links used aria-pressed. --- app/globals.css | 6 ++ components/layout/site-shell.tsx | 2 + components/layout/skip-link.test.tsx | 49 ++++++++++++++++ components/layout/skip-link.tsx | 41 +++++++++++++ components/views/blog-view.test.tsx | 17 ++++-- components/views/blog-view.tsx | 2 +- components/views/post-article.test.tsx | 67 ++++++++++++++++++++++ components/views/post-article.tsx | 6 +- components/views/view-mode-switch.test.tsx | 52 +++++++++++++++++ components/views/view-mode-switch.tsx | 2 +- e2e/skip-link.spec.ts | 43 ++++++++++++++ lib/i18n/dictionary.test.ts | 6 ++ lib/i18n/dictionary.ts | 12 ++++ 13 files changed, 296 insertions(+), 9 deletions(-) create mode 100644 components/layout/skip-link.test.tsx create mode 100644 components/layout/skip-link.tsx create mode 100644 components/views/post-article.test.tsx create mode 100644 components/views/view-mode-switch.test.tsx create mode 100644 e2e/skip-link.spec.ts diff --git a/app/globals.css b/app/globals.css index d1f74a0..a1543b6 100644 --- a/app/globals.css +++ b/app/globals.css @@ -4,6 +4,12 @@ @import "./theme/spacing.css"; @import "./theme/containers.css"; +/* Skip-link focus is programmatic. Beats the preflight :focus-visible outline. */ +main:focus, +main:focus-visible { + outline: none; +} + @custom-variant dark (&:where(.dark, .dark *)); @theme { diff --git a/components/layout/site-shell.tsx b/components/layout/site-shell.tsx index 3d99d47..a372bac 100644 --- a/components/layout/site-shell.tsx +++ b/components/layout/site-shell.tsx @@ -7,6 +7,7 @@ import { Footer } from '@/components/layout/footer' import { Header } from '@/components/layout/header' import { LoadingBar } from '@/components/layout/loading-indicator' import { NavigationProgress } from '@/components/layout/navigation-progress' +import { SkipLink } from '@/components/layout/skip-link' import { ThemeProvider } from '@/components/theme-provider' import { htmlLang, type InterfaceLanguage } from '@/lib/i18n/types' import '@/app/globals.css' @@ -46,6 +47,7 @@ export function SiteShell({ /> +
{children}