fix(web): a11y labelling — useId, named drawer/breadcrumb, translated combobox (#62)

This commit is contained in:
2026-06-08 19:00:28 +02:00
parent 546680017d
commit 0def81ab42
9 changed files with 40 additions and 13 deletions
+1
View File
@@ -26,6 +26,7 @@ test("renders the trail with a link on non-leaf crumbs", async () => {
const link = await screen.findByRole("link", { name: "Objects" });
expect(link).toHaveAttribute("href", "/objects");
expect(screen.getByText("LM-0042")).toBeInTheDocument();
expect(screen.getByRole("navigation", { name: /breadcrumb/i })).toBeInTheDocument();
});
test("a nested route sets the header breadcrumb inside AppShell", async () => {
+3 -1
View File
@@ -1,13 +1,15 @@
import { Fragment } from "react";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import { useBreadcrumbTrail } from "./breadcrumb-context";
export function Breadcrumb() {
const { t } = useTranslation();
const trail = useBreadcrumbTrail();
if (trail.length === 0) return <div className="min-w-0 flex-1" />;
return (
<nav aria-label="Breadcrumb" className="flex min-w-0 flex-1 items-center gap-1 text-sm">
<nav aria-label={t("nav.breadcrumb")} className="flex min-w-0 flex-1 items-center gap-1 text-sm">
{trail.map((item, i) => {
const last = i === trail.length - 1;
return (