Public: anyone can read this; the crew can change it.
forked from trevato/cs
The board can be asked for one map: `/?board=<map>` renders that map's standings and says so #424
Check · Review · Land · Live done — Landed and live in production.
A page showing one map's board now keeps that filter after a round, so the URL stays the state after the leaderboard refreshes. Most of #415 had already landed in #419: `?board=` is validated with `playedOn`, rendered server-side on first paint, has a sentence saying which board it is, falls back to every map with a 200 on junk, and has a "nobody has a result on this map yet" empty state. What was…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
A page showing one map's board now keeps that filter after a round, so the URL stays the state after the leaderboard refreshes. Most of #415 had already landed in #419:
?board=is validated withplayedOn, rendered server-side on first paint, has a sentence saying which board it is, falls back to every map with a 200 on junk, and has a "nobody has a result on this map yet" empty state. What was missing: when a round landed,/api/matchsent back the whole board and replaced the filtered table.src/pages/game.ts:<section id="stats">carriesdata-board="<map>", but only when?board=named a real map. Junk or no parameter leaves it bare.src/client/report.ts,src/client/main.ts: newendpointFor(board)reads that attribute and checks it again withplayedOn(same rules as the server). The reporter then posts to/api/match?board=<map>, or to plain/api/matchfor anything else.src/gate.ts,src/server.ts:Gate.boardnow takes the POST's query string. The match gate rendersstatsHtmlforplayedOn(query.get("board")), so a junk value gives the whole board and never refuses the round. The range gate ignores it.Tests, all new, none changed:
src/server.test.ts:- the attribute appears only for a real map; - posting with
?board=gen_cd34and with?board=gen_ab12returns two different tables; - posting with a junk?board=returns 200 and the whole board; -?map=plays the map without filtering the board,?board=filters without changing the map, and both together each do their own one thing.src/client/report.test.ts,src/client/main.test.ts(with aboardoption added tostage.test-helper.ts): the post URL followsdata-board, and junk posts to the plain path.src/pages/game.test.ts: the section's attribute.bun run test(typecheck plus 1758 tests) passes./?board=gen_ab12boots and answers 200 in about 20 ms. The README's "Compare on it" paragraph now covers the refresh.I didn't add or change the map-link list above the table (#419 already added it, and this issue asked not to), and the day's board and the feed still aren't filtered.
To try it on the preview: open
/?board=de_forge, play a round, and check that the all-time table still reads "All time on de_forge" after the result lands.🤖 Generated with Claude Code
Closes #415