fix(nav): stop the small-screen layout overflowing and give navigation real touch targets #170

Sammanfogat
supernaut sammanfogade 6 incheckningar från fix/nav-small-screen in i main 2026-08-02 19:38:41 +00:00
Ägare

Closes #153, closes #160, closes #155, closes #159. Refs #156.

Small-screen layout, reflow and target size. Deliberately adds no disclosure or hamburger — the
header has no JavaScript today and that is worth keeping.

Ordering was load-bearing: the row has to wrap (#153) before targets grow (#155), or the 320 px
overflow gets worse rather than better.

Reflow — measured, scrollWidth vs clientWidth

width / /docs/ /pricing/ /en/pricing/
320 347 → 320 348 → 320 437 → 320 387 → 320
375 ok ok 438 → 375 388 → 375
414 ok ok 437 → 414 ok

Zero overflow across 8 widths × 6 pages. 768 px and above is unchanged.

A second overflow source only became visible once the first was fixed: at 320 px the Dokumentation
heading is 321 px in a 272 px column. Fixed with overflow-wrap: break-word on headings.

#160 restacks the add-ons table below small rather than adding a scroller — each cell carries
its column heading as a visible label and thead is dropped, so there is no unlabelled tab stop.

#155 gives every header, footer and breadcrumb target 48 px on the block axis, honouring
--min-touch-target, which the repo already applies to buttons and the logo but to no navigation
link. It previously passed SC 2.5.8 only through the spacing exception — compliance that breaks the
moment any gap is tightened.

#159 adds env(safe-area-inset-*) behind @supports. Verified with CDP
Emulation.setSafeAreaInsetsOverride at 780×375 landscape: link boxes moved from 30..750 — twelve
links inside the 44 px notch band — to 74..706, none inside. Values are byte-identical where no
insets exist.

#156 is partial, and deliberately so

Header height at 375 px: 278 baseline → 210. The issue asks for ≤170 px, which is not reachable
while every target is 48 px. The header is now three rows — brand band plus two navigation rows —
which is 144 px of targets; the remaining 66 px is padding and gaps. Reaching 170 means cutting
~40 px more of padding (brand 32→8, nav 16→8, gap 16→8), which is a visual-density decision rather
than a layout one.

Per the operator decision, the small-screen logo now matches the footer's 24 px, which is what
freed the third row. #156 stays open for the padding question.

Verification

pnpm lint, pnpm check, pnpm test (206 passing). src/lib/nav.test.ts untouched;
aria-current="page" still marks the current page in both languages.

Closes #153, closes #160, closes #155, closes #159. Refs #156. Small-screen layout, reflow and target size. Deliberately adds **no** disclosure or hamburger — the header has no JavaScript today and that is worth keeping. Ordering was load-bearing: the row has to wrap (#153) before targets grow (#155), or the 320 px overflow gets worse rather than better. ### Reflow — measured, `scrollWidth` vs `clientWidth` | width | `/` | `/docs/` | `/pricing/` | `/en/pricing/` | | --- | --- | --- | --- | --- | | 320 | 347 → **320** | 348 → **320** | 437 → **320** | 387 → **320** | | 375 | ok | ok | 438 → **375** | 388 → **375** | | 414 | ok | ok | 437 → **414** | ok | Zero overflow across 8 widths × 6 pages. 768 px and above is unchanged. A second overflow source only became visible once the first was fixed: at 320 px the `Dokumentation` heading is 321 px in a 272 px column. Fixed with `overflow-wrap: break-word` on headings. **#160** restacks the add-ons table below `small` rather than adding a scroller — each cell carries its column heading as a visible label and `thead` is dropped, so there is no unlabelled tab stop. **#155** gives every header, footer and breadcrumb target 48 px on the block axis, honouring `--min-touch-target`, which the repo already applies to buttons and the logo but to no navigation link. It previously passed SC 2.5.8 only through the spacing exception — compliance that breaks the moment any gap is tightened. **#159** adds `env(safe-area-inset-*)` behind `@supports`. Verified with CDP `Emulation.setSafeAreaInsetsOverride` at 780×375 landscape: link boxes moved from `30..750` — twelve links inside the 44 px notch band — to `74..706`, none inside. Values are byte-identical where no insets exist. ### #156 is partial, and deliberately so Header height at 375 px: **278 baseline → 210**. The issue asks for ≤170 px, which is not reachable while every target is 48 px. The header is now three rows — brand band plus two navigation rows — which is 144 px of targets; the remaining 66 px is padding and gaps. Reaching 170 means cutting ~40 px more of padding (brand 32→8, nav 16→8, gap 16→8), which is a visual-density decision rather than a layout one. Per the operator decision, the small-screen logo now matches the footer's 24 px, which is what freed the third row. `#156` stays open for the padding question. ### Verification `pnpm lint`, `pnpm check`, `pnpm test` (206 passing). `src/lib/nav.test.ts` untouched; `aria-current="page"` still marks the current page in both languages.
supernaut tvångsskickade fix/nav-small-screen från 45c61631b6
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m14s
till 958050d3f5
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m15s
2026-08-02 19:25:32 +00:00
Jämför
supernaut tvångsskickade fix/nav-small-screen från 958050d3f5
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m15s
till 316f645a45
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m15s
2026-08-02 19:29:35 +00:00
Jämför
supernaut sammanfogade incheckning 2d2b925936 till main 2026-08-02 19:38:41 +00:00
supernaut tog bort grenen fix/nav-small-screen 2026-08-02 19:38:41 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-web!170
Ingen beskrivning angiven.