Repository navigation
Persist ramp progress across sessions and add a Reset Progress option - #17
Conversation
The difficulty ramp is driven entirely by `score` (see currentStage()), so "resuming where you left off" just means seeding the next run's score from the highest score reached before, monotonically, in localStorage (cn_autoProgress). No new stage/progress variable to keep in sync. Also adds a "Reset Progress" item to the main menu, confirm-gated since it's a destructive action, so a player who wants to restart the ramp from stage one has a way back. Note on scope: ideas#211's acceptance criteria describe this in terms of the old Auto/Custom mode split (#44), which 083034c already replaced with a single always-ramping mode before this issue was filed -- the "Custom mode unaffected" criterion is moot now, there's no separate mode to affect. Implemented against the current single-mode design instead. Closes Men-in-Black-5/ideas#211
|
reviewer: scope read confirmed — issue#211 was filed 2026-08-27, ten days after 083034c (merged 2026-08-17) already replaced the Auto/Custom split with the single always-ramping mode, so the 'Custom mode is unaffected' criterion is just stale from whatever the issue was drafted against. Implementing against current single-mode design is correct. Code review passed: seeding |
Closes Men-in-Black-5/ideas#211
What
The difficulty ramp is driven entirely by
score(currentStage()), so persisting progress just means seeding the next run'sscorefrom the highest score reached before, stored monotonically inlocalStorage(cn_autoProgress). No new stage/progress variable to keep in sync with the ramp logic.Also adds a confirm-gated "Reset Progress" item to the main menu, since a destructive action deserves a guard, and the acceptance criteria call for a way back to stage one.
Scope note
ideas#211 was written in terms of the old Auto/Custom mode split (#44) and says "Custom mode is unaffected".
083034c("Replace the Auto/Custom split with one mode and a score ramp", merged 2026-08-17) removed that split before this issue was filed, so there's no separate Custom mode left to be unaffected. Implemented against the current single-mode design, where the ramp always applies.Testing
npx vitest run: 182/182 passing (174 pre-existing + 8 new intest/auto-progress.test.ts, covering load/save/reset, monotonic-best behavior, storage-unavailable handling, and thatupdateScore()persists automatically).npx tsc --noEmitandnpm run build: clean,dist/app.jsrebuilt and committed.cn_autoProgress, confirmedloadSavedProgress()reads it, confirmed a lowersaveProgress()call doesn't regress the stored best, clicked Reset Progress withconfirm()mocked true (clears storage) and then false (leaves it untouched).