Public: anyone can read this; the crew can change it.
forked from trevato/cs
The shooter's entry sheds its last concept: the menu's map, plan and link become their own module #409
Check · Review · Land · Live done — Landed and live in production.
The menu's map logic now lives in its own module, `src/client/chooser.ts`, which reads which map the menu is asking for, what it's called, its link and when its plan gets drawn. After all three extractions, **`src/client/main.ts` is 1,749 lines**, down 90 in this pull from the 1,839 on `main`. That's more than the 1,215 in the issue thread because rooms, radio, the daily match and the planner land…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
The menu's map logic now lives in its own module,
src/client/chooser.ts, which reads which map the menu is asking for, what it's called, its link and when its plan gets drawn. After all three extractions,src/client/main.tsis 1,749 lines, down 90 in this pull from the 1,839 onmain. That's more than the 1,215 in the issue thread because rooms, radio, the daily match and the planner landed onmainwhile the extractions were in flight.What moved. The new module takes the three controls' values (Map select, Map name field, Match id field) as plain strings, plus a clock reading and a source of ids. It returns plain data:
PLAN_WAIT, 200 ms, moved here), and never while a match runs.src/mapname.tsis still the only map-name grammar andpreview.tsis still the only drawing.main.tskeeps the fields, the elements and the plan canvas.Behaviour. It should be identical:
generated, and only when the menu names it.levelOfbuilds named maps withmap.ts's ownlevelNamedinstead of repeating itsDE_FORGEcheck. That keeps thelevel.test.tsrule that onlymap.tsandmain.tsnameDE_FORGE, and it produces the same levels.Tests.
src/client/chooser.test.tschecks the module directly:de_forgefallback for junk;In
main.test.ts, two tests were trimmed to their wiring, since the module test now covers the cells check and the loop over rejected links.SETTLEis now derived fromPLAN_WAIT. No test was changed because it was wrong.bun run testpasses (typecheck plus 1,698 tests), and the app boots and answers 200 on/.Bundle.
app.jswent from 137,757 raw / 53,497 gzip bytes to 138,106 / 53,681 (+349 / +184, the cost of passing the control values as small objects). It stays under the 140,500 / 54,500 ceilings, and no ceiling moved.What
main.tsstill holds. It isn't down to one concept, and there is no fourth issue for that:The room wiring is the clearest next seam if someone wants it.
Where to look. In the preview, pick
generatedand check the line above Play names the map before Play. Typegen_14u5j6ga character at a time: the plan appears once, after you stop typing. Paste<origin>/?match=<id>&map=gen_14u5j6ginto the Match id field and both controls should fill.#215 is still open against this block; whichever lands second should rebase rather than re-decide.
🤖 Generated with Claude Code
Closes #252