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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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

opened this

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"> 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: GAMES and navFor(here), plain data that imports only the shell's NavEntry type — so game.ts and range.ts each call navFor with their own path and no page imports another page. src/server.ts builds 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, /range in 0.8 ms and the 404 in 0.4 ms. bun test is 313 passing; src/pages/shell.test.ts pins the markup, the escaping of a label carrying < and & and a hostile href, and that the current entry is not a link, while src/server.test.ts checks from the outside that each served page links the other game and marks itself and that the 404 names both. Worth a look: the header nav rules in the shell's one <style> block, and the NOT_FOUND constant in src/server.ts.

🤖 Generated with Claude Code

Closes #33

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs