From 69edeecc45cf9f49976552cb6d9f182dc14cc82a Mon Sep 17 00:00:00 2001 From: npeter83 Date: Fri, 25 Sep 2026 23:59:20 +0200 Subject: [PATCH] fix(a11y): a labelled rail row says its label and the exact unread count, not the capped badge first (E28) With the labels on, the row's name was its text, badge first: 15 unread was heard as "9+ Alerts". The name is now the visible label plus the count, as the icon-only row's is, and the drawn badge is hidden. --- frontend/src/components/ui/NavRail.dom.test.tsx | 16 ++++++++++++++++ frontend/src/components/ui/NavRail.tsx | 14 +++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/ui/NavRail.dom.test.tsx b/frontend/src/components/ui/NavRail.dom.test.tsx index 4b359cd5..cd0b9b70 100644 --- a/frontend/src/components/ui/NavRail.dom.test.tsx +++ b/frontend/src/components/ui/NavRail.dom.test.tsx @@ -46,6 +46,22 @@ describe("NavRailItem", () => { const row = screen.getByRole("button", { name: "Alerts" }); expect(row.getAttribute("aria-current")).toBeNull(); }); + + // E28 audit: labelled, the name was the row's text, the corner badge first, so 20 unread was heard + // as "9+Alerts" where the icon-only row says "Notifications (20)". + it("labelled with a count: the visible label, then the exact count", () => { + render( + {}} + />, + ); + expect(screen.getByRole("button", { name: "Alerts (20)" })).toBeTruthy(); + }); }); // F32: the rail's footer (language, About, Sign out) drew 32 and 36 squares with 16 and 20px glyphs diff --git a/frontend/src/components/ui/NavRail.tsx b/frontend/src/components/ui/NavRail.tsx index f3c4c67b..0ce9e85d 100644 --- a/frontend/src/components/ui/NavRail.tsx +++ b/frontend/src/components/ui/NavRail.tsx @@ -97,10 +97,11 @@ export function NavRailItem({