Split The code is public; the app answers only to the crew.
Resume match: the menu offers the round you were in, and the row on the board continues #179
Check · Review · Land · Live done — Landed and live in production.
Pushed. Here's the PR description:
shipped merged
Sign in to join this conversation.
new above
offline
Pushed. Here's the PR description:
Wires the snapshot machinery
saved.tsandworld.tsalready had (both map-aware since #155/#134 landed) intomain.ts, the last third of #71:main.tswrites a snapshot tolocalStorageat the start of every freeze time — fresh match, next round or resumed match alike, tracked by round number so it writes once and not every frame — and clears it when the match is decided or Leave match is pressed.resumeLineinsaved.ts, new and tested) whenever a valid snapshot is on disk, and a line under it says starting a new match discards it. Both are rendered server-side inpages/game.ts(#resume-match,#discard-warning), somain.test.ts's id/selector contract covers them for free. The old snapshot is only actually discarded whenstart()runs, not by merely showing the menu.restoreWorld(save, settings.difficulty)and continues undersave.matchId, so the leaderboard row already open for that match keeps updating instead of forking a second one.start()andresumeMatch()now share oneenterMatch()tail.saveMatchonly ever takes the larger of what's stored and what arrives per column, and the score is taken whole from whichever post knows the most rounds — the worst outcome is a row that over-counts progress neither tab alone made, never one that goes backwards or leaks to another identity. Nothing needed changing here; #108's monotone guard already covers it, and an abandoned-by-age row already reads live again the instant a fresh post lands, sincewalked_out(the sticky flag) and the age rule are different things.Left out: no server-side match-history reconciliation beyond what already existed — this issue was wiring, not a new safety net.
bun run checkpasses (735 tests). Tried the page by renderinggamePage()directly and confirming both new ids appear (the sandbox already had ~80 strayserver.tsprocesses squatting on ports from before this session, so I skipped a live curl and used the same harnessmain.test.tsuses instead).Closes #135