Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions @nself-web/ui/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ function FooterCol({ group }: { group: FooterLinkGroup }) {
<li key={link.label}>
<a
href={link.href}
// Distinct focus identity from the header's link to the same
// destination — see the matching comment in Header.tsx.
data-testid={`footer-${group.title}-${link.label}`}
target={link.external ? '_blank' : undefined}
rel={link.external ? 'noopener noreferrer' : undefined}
className="text-slate-600 dark:text-slate-400 hover:text-sky-600 dark:hover:text-sky-400 transition-colors"
Expand Down
8 changes: 8 additions & 0 deletions @nself-web/ui/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ export function Header({
<a
key={item.label}
href={item.href}
// The same destination is linked from the desktop nav, the
// mobile nav and the footer. Keyboard-nav tests identify a
// link by `data-testid ?? aria-label ?? href`, so without a
// testid these collapse into one identity and read as a focus
// trap. An aria-label would fix the test but get announced to
// screen readers, so the disambiguator stays test-only.
data-testid={`nav-desktop-${item.label}`}
target={item.external ? '_blank' : undefined}
rel={item.external ? 'noopener noreferrer' : undefined}
aria-current={active ? 'page' : undefined}
Expand Down Expand Up @@ -218,6 +225,7 @@ export function Header({
<a
key={item.label}
href={item.href}
data-testid={`nav-mobile-${item.label}`}
target={item.external ? '_blank' : undefined}
rel={item.external ? 'noopener noreferrer' : undefined}
onClick={() => setMobileOpen(false)}
Expand Down
Loading