Split The code is public; the app answers only to the crew.

The menu remembers your map and your difficulty but forgets your name, your side and the match length #230

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Pushed successfully.

shipped merged

opened this

Pushed successfully.

Adds the three missing menu fields — Name, Match length and Side — to Settings in src/client/settings.ts, validated the same way difficulty and map already are: a name is trimmed and capped at the input's own maxlength="24" (NAME_MAX), a match length is "short" or "long", a side is "ct" or "t" — anything else, or a settings blob from before these fields existed, falls back to today's defaults rather than throwing.

match.ts gains SIDES, MatchLength, MATCH_LENGTHS and a RULES lookup ({ short: SHORT, long: COMPETITIVE }), so main.ts:761 reads RULES[settings.matchLength] rather than the raw select's value. The menu loads and writes the three fields back on change, exactly like the map select, plus a sync in start() itself so a name typed but never blurred isn't lost when Play is pressed. The old ad hoc cs.name key is gone — the name now lives in the same localStorage record as everything else and, per the risk note, still goes nowhere near POST /api/match and is only ever drawn through canvas fillText, never HTML.

settings.test.ts gets round-trip, rejection and default-placeholder tests for all three, mirroring the existing difficulty/map tests. README's Playing section now lists Name, Match and Side among what's remembered. bun run check (tsc + full test suite, 832 tests) passes.

Closes #180

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs