Public: anyone can read this; the crew can change it.
forked from trevato/cs
A feed row says which map it was, and a generated map's name plays it #423
Check · Review · Land · Live done — Landed and live in production.
Each row in the recent-matches feed now shows the map it was played on. Only a generated map is a link, and that link plays the same map again. Before this change the feed already showed the map, but it linked every row: `de_forge` got a link to itself, and a stored name that wasn't a real map got a link to `/?map=de_forge`. `bun run test` (typecheck and 1754 tests) passes.
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
Each row in the recent-matches feed now shows the map it was played on. Only a generated map is a link, and that link plays the same map again. Before this change the feed already showed the map, but it linked every row:
de_forgegot a link to itself, and a stored name that wasn't a real map got a link to/?map=de_forge.bun run test(typecheck and 1754 tests) passes.What changed
feedMap(stored)insrc/pages/game.tsrenders the map. It checks the stored name withplayedOnfromsrc/mapname.ts:- A valid
gen_…name becomes<a class="map">. Its href is built bymapLink, the same function the menu's "Copy this map's link" uses. The href uses the name asmapname.tswrites it, never the raw stored text. -de_forgeis plain text in<span class="map">. - A stored name that doesn't parse is escaped text and never a link. That covers script text,gen_0ir1(right pattern, but not the form the seed prints as) andgenerated.src/pages/game.test.tsis replaced by two #417 tests:- A
gen_ir1row's href, read back throughpastedLink, gives the same seed. - Ade_forgerow has no link, and every malformed stored name renders as a span. - The truncation rule exists on the feed's map box.src/server.test.ts:282expectedde_forgeto be a link, which this issue reverses on purpose. It now expects the span.Not done
To try it: in the preview, play a match on a generated map, then look under Recent matches. The
gen_…name in that row is a link that opens the same map; ade_forgerow shows the name as plain text. At 360px wide, the rows don't scroll sideways.🤖 Generated with Claude Code
Closes #417