Public: anyone can read this; the crew can change it.
forked from trevato/cs
A first visit is one click from a round: Play first, and the seven controls fold behind a summary that says what they are #410
Check · Review · Land · Live done — Landed and live in production.
The menu now opens on four things: the name, one sentence saying what Play gives you, the plan of the map, and Play. Every other control is still on the page, folded into one `<details id="options">` under Play. Its summary line names what is inside: length, side, map, map name, sensitivity, motion, match id, today's match and rooms. The controls inside keep their markup; they only moved.
shipped production is serving it deploy ae07c2d
This pull makes Play the first thing a new visitor sees on the menu. A sentence beside it says what pressing it will give: length, side, map, and whether it replays a match. The other controls are folded into one <details id="options">. The folded controls stay reachable from the shared link, and the server renders the same sentence as the page (src/client/offer.ts).
Since the last push, main has been merged in. There were two conflicts:
src/client/main.ts:mainmoved the map-choosing logic intosrc/client/chooser.ts.nameNextMapnow uses that module'snameMapand then updates the sentence beside Play (nextNameandsayOffer). The comment from the old version is gone, andmatchFromis now imported from../matchid.ts.src/client/stage.test-helper.ts:PAGE_IDSnow has the element ids from both sides —willgiveandoptionsfrom here, andmain'ssound,psens,ptouchsens,pmotionandpsound.
Bundle size limit raised: after the merge, the app bundle was 3 gzipped bytes over its size limit, and two tests in scripts/build.test.ts failed. The tests were right: each side fit on its own, but the two together don't. Following the rule written in src/games.ts, the limit goes from 140,500 raw / 54,500 gzipped to 147,000 / 57,000. That is the measured 139,969 / 54,503 plus about five per cent, and the reason is noted next to the number. scripts/build.test.ts has the same new numbers. I raised the limit rather than cutting code, as earlier merges have done.
bun run test passes: 1,745 tests, 0 failures. On a local start, / served the Play sentence and the options fold next to main's sound and pause-menu settings.
To try it, open the preview (https://cs-engine--410--forge-trevato-apps.open-platform.sh) in a fresh browser. Play and its sentence come first. Open "options" to change length, side or map and the sentence updates; pause during a round to see main's settings, which still work.
🤖 Generated with Claude Code
This pull makes Play the first thing a new visitor sees on the menu. A sentence beside it says what pressing it will give: length, side, map, and whether it replays a match. The other controls are folded into one <details id="options">. The folded controls stay reachable from the shared link, and the server renders the same sentence as the page (src/client/offer.ts). main.ts picks the map through main's src/client/chooser.ts and updates the sentence whenever the map, length, side or match id changes.
The latest merge of main had three conflicts:
src/client/stage.test-helper.ts:PAGE_IDShas this branch'swillgiveandoptionsplusmain's newbuycursor, the buy-panel pointer.src/games.tsandscripts/build.test.ts: this branch had raised the app bundle's size limit after an earlier merge.main's #355 then raised it further, to 147,600 raw / 57,500 gzipped.main's number and note are kept and this branch's are dropped, since its raise never landed. The merged bundle is 141,059 raw and 54,966 gzipped, under the limit.
bun run test passes: 1,750 tests, 0 failures, and the typecheck is clean. On a local start, / served willgive, options and buycursor together.
To try it, open the preview (https://cs-engine--410--forge-trevato-apps.open-platform.sh) in a fresh browser. Play and its sentence come first. Open "options" to change length, side or map and the sentence updates. The buy panel's pointer and the pause-menu settings from main still work in a round.
🤖 Generated with Claude Code
The menu now opens on four things: the name, one sentence saying what Play gives you, the plan of the map, and Play. Every other control is still on the page, folded into one
<details id="options">under Play. Its summary line names what is inside: length, side, map, map name, sensitivity, motion, match id, today's match and rooms. The controls inside keep their markup; they only moved.offerSaidinsrc/client/offer.ts, for example "A short match — first to 5 — as the Counter-Terrorists on de_forge." The server renders it from the values it renders the controls with.src/client/main.tswrites it again whenever Length, Side, Map, Map name or Match id changes, after "Pick today's match", and after the stored side and length are restored at boot. A returning player therefore reads their own settings, not the defaults. The number comes from the match rules, not typed in.<details>/<summary>: it works without JavaScript, the keyboard reaches it, and the summary is 44px tall. It is rendered open whenever the link asked for anything (?match=,?map=, includinggenerated,?room=, or a bad value), so a pasted link shows what it filled in. It stays open across matches in the same visit, because the menu is hidden and shown again rather than re-rendered.src/pages/shell.tsstyleFornow strips CSS comments before the style block is sent and hashed for the CSP. The source keeps them. That takes/from 9,562 to about 8,620 bytes gzipped, fold included. A test holds it under the old figure.Not done: opening the fold is not remembered across page loads. Opening it from a script after the first paint would shift the layout, which the issue rules out. #73 (stored settings) and #245 (crosshair) should add their controls inside this fold rather than beside Play, and the README now says so.
Tests:
bun run test(typecheck plus 1,700 tests) passes. The new tests cover:/.tabindexin the menu, and the only hidden controls are the room link and the support copy button, both hidden before this change.To try it on the preview: open
/and check the sentence, then change Side and Length inside the fold and watch it change. Open/?map=gen_14u5j6gand the fold is already open with that map named.🤖 Generated with Claude Code
Closes #255