Public: anyone can read this; the crew can change it.
forked from trevato/cs
The board can be read one map at a time: the map a result carries becomes the comparison it was recorded for #419
Check · Review · Land · Live done — Landed and live in production.
The all-time leaderboard can now be read one map at a time. `/?board=de_forge` or `/?board=gen_…` narrows the table to results played on that map. With no `?board=`, it shows every map added together, as before. Anything that isn't a map falls back to every map, with a sentence saying so. The feed and today's board are unchanged, and each feed row's map name was already a link that plays it (`/?ma…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
The all-time leaderboard can now be read one map at a time.
/?board=de_forgeor/?board=gen_…narrows the table to results played on that map. With no?board=, it shows every map added together, as before. Anything that isn't a map falls back to every map, with a sentence saying so. The feed and today's board are unchanged, and each feed row's map name was already a link that plays it (/?map=…).bun run testpasses: typecheck plus 1735 tests. The app boots and/answers in a few milliseconds with and without?board=.Why the earlier pull (#411) stayed red: it was based on a main from before #412 and #413, so it conflicted with them and failed the typecheck. This push merges main into it, resolves the conflicts in
src/db.test.tsandsrc/pages/game.ts, and fixes the type error in the 20,000-row timing test by typing its map variable. That was a mistake in the test, not the code.What to look at:
standinghas amapcolumn. The empty string holds each player's row across every map, and there is one row per map they played.standings(db, limit, map)takes the map as a parameter, and the indexstanding_by_rankis now(map, kills DESC, damage DESC, user_id, name).- Query plan:
SEARCH standing USING INDEX standing_by_rank (map=?), with no sort step. - Time at 20,000 matches on 200 maps: about 0.04 ms for either board, and 0.9 ms for the list of maps. - A database written before this change rebuildsstandingonce frommatchthe first time it opens.?board=is checked insrc/server.tsbyplayedOnfromsrc/mapname.ts, the same rules a stored result must meet. Only a name it accepts is put into a link.?board=link.- Two maps give two different filtered boards and one combined one. - de_forge's board excludes rows from generated maps. - A junk
?board=falls back to every map. - The link on a feed row plays that map. - The map list is bounded. - Pruning keeps each map's board correct.Not done:
?board=parameter, which either of them can build on.To try it: in the preview, play a match on a generated map, then open
/?board=<that map>,/?board=de_forgeand/?board=junk.🤖 Generated with Claude Code
Closes #242