From 072eee69970f94442a3da6e2c8ebd461d9877ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 10 May 2026 00:39:55 +0200 Subject: [PATCH] fix(nav): bottom-nav 5+More overflow protects 44px tap targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 7-item bottom nav collapsed each touch target to ~50 px wide on a 375 px viewport — only just-passing WCAG 2.5.5's 44 px floor and visibly cramped on iPhone-13-mini-class screens. The mobile audit (`.planning/phase-A5-mobile-findings.md`) recommended 5+More. Primary strip keeps the four most-used surfaces plus Insights: Home, Measurements, Mood, Medications, Insights. Targets and Achievements move into a Radix `` triggered by a sixth "More" entry. Order matches the v1.4.15 layout for the four core items so muscle memory holds. The More button mirrors the same `min-h-11 min-w-11` hit area; `aria-haspopup="dialog"` + `aria-expanded` keeps screen-reader behaviour tight; the sheet renders bottom-anchored with safe-area padding so the inner links stay reachable above the iPhone home indicator. Active styling lights the More entry whenever any of its overflow children is the current route, so the user always knows which strip-level link "owns" their position. --- messages/de.json | 5 +- messages/en.json | 5 +- .../layout/__tests__/bottom-nav.test.tsx | 75 ++++++++ src/components/layout/bottom-nav.tsx | 167 ++++++++++++++---- 4 files changed, 213 insertions(+), 39 deletions(-) create mode 100644 src/components/layout/__tests__/bottom-nav.test.tsx diff --git a/messages/de.json b/messages/de.json index fdfd90c37..9580a0822 100644 --- a/messages/de.json +++ b/messages/de.json @@ -169,7 +169,10 @@ "sidebar": "Sidebar", "mainNavigation": "Hauptnavigation", "mobileNavigation": "Mobile Navigation", - "loadingScreen": "Laden…" + "loadingScreen": "Laden…", + "more": "Mehr", + "moreSheetTitle": "Mehr", + "moreSheetDescription": "Seiten, die nicht in die untere Leiste passen." }, "auth": { "login": "Anmelden", diff --git a/messages/en.json b/messages/en.json index cd6869721..62f3fcdea 100644 --- a/messages/en.json +++ b/messages/en.json @@ -169,7 +169,10 @@ "sidebar": "Sidebar", "mainNavigation": "Main navigation", "mobileNavigation": "Mobile navigation", - "loadingScreen": "Loading…" + "loadingScreen": "Loading…", + "more": "More", + "moreSheetTitle": "More", + "moreSheetDescription": "Pages that don't fit the bottom bar." }, "auth": { "login": "Sign in", diff --git a/src/components/layout/__tests__/bottom-nav.test.tsx b/src/components/layout/__tests__/bottom-nav.test.tsx new file mode 100644 index 000000000..d137b06f1 --- /dev/null +++ b/src/components/layout/__tests__/bottom-nav.test.tsx @@ -0,0 +1,75 @@ +/** + * v1.4.16 Wave-C MED — bottom-nav 5+More layout. + * + * SSR contract for ``: + * - exactly five primary links + one "More" button render in the strip + * - the More button is keyboard-reachable as a ` + + + + + + + {t("nav.moreSheetTitle")} + {t("nav.moreSheetDescription")} + +
+ {OVERFLOW.map((item) => { + const isActive = isActiveLink(item.href); + return ( + setMoreOpen(false)} + aria-current={isActive ? "page" : undefined} + className={cn( + "border-border flex min-h-11 items-center gap-3 rounded-lg border px-4 py-3 transition-colors", + isActive + ? "text-primary bg-primary/5" + : "text-foreground hover:bg-accent/40", + )} + > +
+
+
+ ); }