fix: aria-current on active nav links and stepper step

- header: mark active page with aria-current="page" + highlight underline
- portal-shell sidebar: aria-current="page" on active nav link
- order-stepper: aria-current="step" on the active step

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-25 17:54:23 +02:00
co-authored by Claude Sonnet 4.6
parent 8424c61b8a
commit 64dda16493
3 changed files with 19 additions and 10 deletions
+17 -10
View File
@@ -3,6 +3,7 @@
import Link from "next/link";
import { useEffect, useState } from "react";
import { useTheme } from "next-themes";
import { usePathname } from "next/navigation";
import { useT } from "@/components/locale-provider";
import { LocaleSwitcher } from "@/components/locale-switcher";
@@ -47,6 +48,7 @@ function ThemeToggle() {
export function Header() {
const t = useT();
const pathname = usePathname();
const [scrolled, setScrolled] = useState(false);
const [open, setOpen] = useState(false);
@@ -69,16 +71,21 @@ export function Header() {
<Wordmark />
<nav className="hidden items-center md:flex">
{NAV.map((n) => (
<Link
key={n.href}
href={n.href}
className="group relative px-4 py-2 font-mono text-[12px] uppercase tracking-[0.12em] text-muted-foreground transition-colors hover:text-foreground"
>
{t(n.label)}
<span aria-hidden className="pointer-events-none absolute bottom-1 left-4 right-4 h-px origin-left scale-x-0 bg-foreground transition-transform duration-300 group-hover:scale-x-100" />
</Link>
))}
{NAV.map((n) => {
const active = !n.href.includes("#") && pathname === n.href;
return (
<Link
key={n.href}
href={n.href}
aria-current={active ? "page" : undefined}
className="group relative px-4 py-2 font-mono text-[12px] uppercase tracking-[0.12em] text-muted-foreground transition-colors hover:text-foreground"
style={{ color: active ? "var(--foreground)" : undefined }}
>
{t(n.label)}
<span aria-hidden className="pointer-events-none absolute bottom-1 left-4 right-4 h-px origin-left bg-foreground transition-transform duration-300 group-hover:scale-x-100" style={{ transform: active ? "scaleX(1)" : "scaleX(0)", transformOrigin: "left" }} />
</Link>
);
})}
</nav>
<div className="hidden items-center gap-4 md:flex">
+1
View File
@@ -45,6 +45,7 @@ export function OrderStepper({ active }: { active: 1 | 2 | 3 | 4 }) {
<div
key={s.n}
className="flex flex-1 items-center justify-center border-r border-border px-4 py-3 last:border-r-0"
aria-current={isActive ? "step" : undefined}
>
{s.href && (isDone || isActive) ? (
<Link href={s.href} className="transition-opacity hover:opacity-70">
+1
View File
@@ -86,6 +86,7 @@ export function PortalShell({
<Link
key={n.href}
href={n.href}
aria-current={active ? "page" : undefined}
className="border-l-2 px-4 py-2.5 font-mono text-[11px] uppercase tracking-[0.1em] transition-colors"
style={{
borderColor: active ? "var(--accent-red)" : "transparent",