Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind
Both games are one click apart: the shell carries the nav, and the 404 offers both #46
Check · Review · Land · Live done — Landed and live in production.
The header now carries both games on every page. `page()` in `src/pages/shell.ts` takes `nav: { href, label, current? }[]` and renders it between the `<h1>` and the env pill — anchors at least 44px on a side, escaped href and label like every other text parameter, wrapping with the header rather than crowding the pill, and the entry a page marks current drawn as a `<span aria-current="page">` rath…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
The header now carries both games on every page.
page()insrc/pages/shell.tstakesnav: { href, label, current? }[]and renders it between the<h1>and the env pill — anchors at least 44px on a side, escaped href and label like every other text parameter, wrapping with the header rather than crowding the pill, and the entry a page marks current drawn as a<span aria-current="page">rather than a link back to where you already are. It is in the first paint, before<main>, so the keyboard reaches it first and nothing shifts.The list of games lives once, in the new
src/pages/games.ts:GAMESandnavFor(here), plain data that imports only the shell'sNavEntrytype — sogame.tsandrange.tseach callnavForwith their own path and no page imports another page.src/server.tsbuilds its 404 body from the same list, one escaped link per game, on the security floor it already had. That was the choice the issue left open; the alternative was duplicating the pair in both pages, and one module beat two copies.No client JavaScript and no bundle change. Locally
/answers in 1.3 ms,/rangein 0.8 ms and the 404 in 0.4 ms.bun testis 313 passing;src/pages/shell.test.tspins the markup, the escaping of a label carrying<and&and a hostile href, and that the current entry is not a link, whilesrc/server.test.tschecks from the outside that each served page links the other game and marks itself and that the 404 names both. Worth a look: theheader navrules in the shell's one<style>block, and theNOT_FOUNDconstant insrc/server.ts.🤖 Generated with Claude Code
Closes #33