Public: anyone can read this; the crew can change it.
forked from trevato/cs
The map you played has a name you can keep: the seed on the menu, in the URL, and a link that plays it again #213
Check · Review · Land · Live done — Landed and live in production.
A generated map now has a name you can read before you play it, type back in, and hand to somebody else. `src/mapname.ts` is the one door a name goes through — `nameOf`, `seedOf`, `mapFrom` — and its test is a round trip rather than a regular expression, so `gen_0ya` (that is `gen_ya` written badly) and `gen_zzzzzzzz` (nobody's seed) are typos, not maps. The server validates `?map=` with it before…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
A generated map now has a name you can read before you play it, type back in, and hand to somebody else.
src/mapname.tsis the one door a name goes through —nameOf,seedOf,mapFrom— and its test is a round trip rather than a regular expression, sogen_0ya(that isgen_yawritten badly) andgen_zzzzzzzz(nobody's seed) are typos, not maps. The server validates?map=with it before rendering andsrc/client/main.tsvalidates the field with it again before anything reachesgenerateLevel; neither trusts the other, and a junk value isde_forgewith a sentence, never an error page.On the menu there is a Map name field beside the select, and above Play a line that names the map Play is about to give you — on
generatedthe match id is drawn the moment the menu needs to name the map it carves, so the name on screen is the map you get rather than a guess, and the id the menu named is the id the match uses. Next to it, Copy this map's link: an<a href="/?map=gen_…">first, 44px and keyboard-reachable, with the clipboard as the thing the click adds; a browser without one just follows the link. The played map's name under the stage is a link to that map too. The match id is untouched: a named map overrides it,?match=still plays a match back, and?map=stays the shooter's parameter —/rangeand/exampleare asserted to carry nothing of it.src/client/generate.test.tsfoldsgen_14u5j6g's cells into a digest through the engine'sdigestdoor and pins it, which is the claim the name makes: same name, same forty-by-forty cells, every machine. The bundle grew 1,358 raw / 531 gzipped bytes and went 588 bytes past the raw ceiling, so the app's ceiling moves to 100,000 / 45,000 with the measurement written intosrc/games.tsbeside every earlier raise — #135 had already noted its 770 bytes of headroom was the thinnest on the page. I left the terminal alone: it browses saved matches, and no map name is stored with a result, so there was nothing there to show. The branch is rebased on currentmain;bun run testpasses (959 tests, typecheck included). In the preview, open/?map=gen_14u5j6g, then switch the select to generated and watch the name and its link change before you press Play.🤖 Generated with Claude Code
Closes #148