In-progress puzzles are remembered and can be resumed #6

Merged
cmoriarty merged 4 commits from osf/206-remember-in-progress-puzzles into main 2026-11-27 17:53:01 -05:00
Owner

Before, closing the app threw away any puzzle you were working on, and reopening it always showed the setup screen. Now, puzzles made from a bundled image are remembered while in progress: reopening the app lists each one with its image, grid size, placed pieces, and elapsed time, and picking one restores the board, move count, and timer where you left off. You can keep several puzzles in progress at once, and finishing one drops it from the list. Puzzles from your own uploads are still not remembered, and the game plays the same as before.

Checks: 2 things to look at

  • Code review: 4 notes left, 3 fixed
  • Tests it wrote were run: 1 test file the change wrote ran in no lane
    • e2e/resume.spec.ts
  • CI: no CI ran on the checked code: the project has no CI (no workflow under .forgejo/workflows, .gitea/workflows or .github/workflows); what only CI tests went unverified
  • Passed: Scenarios with proof: 15 of 15 have a passing test or a look; Tests: 79 passed in 2 lanes; Seen working: 6 of 6 looks passed, and a session was played start to end; Tasks: 10 of 10 done; Same code: The tests and screenshots are of what merges

Try it

  1. npm install and npm run dev, then open the printed URL.
  2. Start a puzzle, place a few pieces, and reload the page: the resume screen should list it with its image, grid, progress, and time.
  3. Resume it, and check the placed pieces, move count, and timer are restored.
  4. npm test runs the unit suite; npx playwright test runs the browser smoke test.
  5. Read the behaviour first: openspec/changes/remember-in-progress-puzzles-currently-i-96xs8p/specs/puzzle-persistence/spec.md.
Code review: 4 notes left, 3 fixed

Left for you

  • Left as is: cosmetic, tamper/clock-only, and a full fix would touch pre-existing elapsedMs; the spec does not require it. (src/components/ResumeScreen.tsx:34)
  • Left as is: tamper-only, and the spec's completion scenario (the real flow) is implemented and tested. (src/hooks/usePuzzle.ts:241)
  • Left as is: adding them to tsconfig.node.json would put a file in the commit the change did not plan for. (tsconfig.node.json:22)
  • Left as is: by design; worth revisiting if drag jank or quota issues ever show up. (src/components/Game.tsx:99)

Fixed before the commit

  • Added playwright-report/ and test-results/ to the Playwright section of .gitignore. (.gitignore:16)
  • Repointed the comment at the 'Completion ends a puzzle's in-progress state' requirement the removal primitive implements. (src/lib/persistence.test.ts:96)
  • Narrowed the header to the two requirements it actually verifies and noted where the rest is covered. (e2e/resume.spec.ts:3)
Tests: 79 passed in 2 lanes

All 15 scenarios of remember-in-progress-puzzles-currently-i-96xs8p have a tagged test.

The test lint found, in the run's tests on the last check:

Recorded, not decided

  • e2e/resume.spec.ts:14 B6 in an in-progress puzzle survives a reload and can be resumed: test has no // spec: <capability>/<scenario> tag, on itself, its describe or its file's top
  • src/lib/persistence.test.ts:99 B6 in removing a seed drops only that record: test has no // spec: <capability>/<scenario> tag, on itself, its describe or its file's top
  • src/lib/persistence.test.ts:182 B3 in reads and writes no-op when localStorage is unavailable: bare toThrow(): require toThrow(TypeName) or toThrow(/message/)
  • src/lib/persistence.test.ts:183 B3 in reads and writes no-op when localStorage is unavailable: bare toThrow(): require toThrow(TypeName) or toThrow(/message/)
  • src/lib/persistence.test.ts:199 B3 in a failing write is non-fatal and remembers nothing: bare toThrow(): require toThrow(TypeName) or toThrow(/message/)
Braid run 206: 2 h 40 m on vLLM · qwen3.8-27b
  • Workflow: Braid's OpenSpec flow, change remember-in-progress-puzzles-currently-i-96xs8p (32 steps)
  • Model: vLLM · qwen3.8-27b
  • Time: 2 h 40 m from start to this pull request, 1 h 26 m of it in the model
  • Tokens: 25.1M input, 88k output, 273k reasoning, over 325 model calls
  • Pre-flight estimate: fits, p50 261k / p80 424k tokens against a 224k-token step allowance

Opened by Braid from cmoriarty/brooke#5.

Before, closing the app threw away any puzzle you were working on, and reopening it always showed the setup screen. Now, puzzles made from a bundled image are remembered while in progress: reopening the app lists each one with its image, grid size, placed pieces, and elapsed time, and picking one restores the board, move count, and timer where you left off. You can keep several puzzles in progress at once, and finishing one drops it from the list. Puzzles from your own uploads are still not remembered, and the game plays the same as before. **Checks: 2 things to look at** - **Code review:** 4 notes left, 3 fixed - **Tests it wrote were run:** 1 test file the change wrote ran in no lane - e2e/resume.spec.ts - **CI:** no CI ran on the checked code: the project has no CI (no workflow under `.forgejo/workflows`, `.gitea/workflows` or `.github/workflows`); what only CI tests went unverified - **Passed:** Scenarios with proof: 15 of 15 have a passing test or a look; Tests: 79 passed in 2 lanes; Seen working: 6 of 6 looks passed, and a session was played start to end; Tasks: 10 of 10 done; Same code: The tests and screenshots are of what merges **Try it** 1. `npm install` and `npm run dev`, then open the printed URL. 2. Start a puzzle, place a few pieces, and reload the page: the resume screen should list it with its image, grid, progress, and time. 3. Resume it, and check the placed pieces, move count, and timer are restored. 4. `npm test` runs the unit suite; `npx playwright test` runs the browser smoke test. 5. Read the behaviour first: `openspec/changes/remember-in-progress-puzzles-currently-i-96xs8p/specs/puzzle-persistence/spec.md`. <details> <summary>Code review: 4 notes left, 3 fixed</summary> **Left for you** - Left as is: cosmetic, tamper/clock-only, and a full fix would touch pre-existing elapsedMs; the spec does not require it. (`src/components/ResumeScreen.tsx:34`) - Left as is: tamper-only, and the spec's completion scenario (the real flow) is implemented and tested. (`src/hooks/usePuzzle.ts:241`) - Left as is: adding them to tsconfig.node.json would put a file in the commit the change did not plan for. (`tsconfig.node.json:22`) - Left as is: by design; worth revisiting if drag jank or quota issues ever show up. (`src/components/Game.tsx:99`) **Fixed before the commit** - Added playwright-report/ and test-results/ to the Playwright section of .gitignore. (`.gitignore:16`) - Repointed the comment at the 'Completion ends a puzzle's in-progress state' requirement the removal primitive implements. (`src/lib/persistence.test.ts:96`) - Narrowed the header to the two requirements it actually verifies and noted where the rest is covered. (`e2e/resume.spec.ts:3`) </details> <details> <summary>Tests: 79 passed in 2 lanes</summary> All 15 scenarios of `remember-in-progress-puzzles-currently-i-96xs8p` have a tagged test. The test lint found, in the run's tests on the last check: **Recorded, not decided** - `e2e/resume.spec.ts:14` B6 in `an in-progress puzzle survives a reload and can be resumed`: test has no `// spec: <capability>/<scenario>` tag, on itself, its describe or its file's top - `src/lib/persistence.test.ts:99` B6 in `removing a seed drops only that record`: test has no `// spec: <capability>/<scenario>` tag, on itself, its describe or its file's top - `src/lib/persistence.test.ts:182` B3 in `reads and writes no-op when localStorage is unavailable`: bare toThrow(): require toThrow(TypeName) or toThrow(/message/) - `src/lib/persistence.test.ts:183` B3 in `reads and writes no-op when localStorage is unavailable`: bare toThrow(): require toThrow(TypeName) or toThrow(/message/) - `src/lib/persistence.test.ts:199` B3 in `a failing write is non-fatal and remembers nothing`: bare toThrow(): require toThrow(TypeName) or toThrow(/message/) </details> <details> <summary>Braid run 206: 2 h 40 m on vLLM · qwen3.8-27b</summary> - **Workflow:** Braid's OpenSpec flow, change `remember-in-progress-puzzles-currently-i-96xs8p` (32 steps) - **Model:** vLLM · qwen3.8-27b - **Time:** 2 h 40 m from start to this pull request, 1 h 26 m of it in the model - **Tokens:** 25.1M input, 88k output, 273k reasoning, over 325 model calls - **Pre-flight estimate:** fits, p50 261k / p80 424k tokens against a 224k-token step allowance </details> --- Opened by Braid from cmoriarty/brooke#5.
cmoriarty deleted branch osf/206-remember-in-progress-puzzles 2026-11-27 17:53:02 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/brooke!6
No description provided.