v0.8.0 — remove a saved game & redirect on missing/deleted game (#20) #21

Merged
kamilkrzywda merged 1 commits from feat/delete-saved-games into master 2026-10-11 22:35:58 +02:00
Owner

Fixes #20

v0.8.0

Closes the last user-facing gap on the games list: remove a saved game, and redirect to the home screen when a game is missing or has been deleted.

What changed

  • DELETE /api/games/:id — new route; returns 404 {error:'game not found'} when absent, otherwise {deleted:true} and pushes an SSE error event to any open tab of that game.
  • Db.delete(id) — prepared DELETE FROM games WHERE id=?, reports whether a row was removed.
  • Home screen — each saved-game card gains a small trash button that opens a confirm dialog (Cancel / Delete); deleting removes it from the list.
  • Missing/deleted games no longer get stuck — useSse now surfaces the server's error event, and the app returns to home on deleted/not found. So a live tab whose game is deleted (by you or another tab) goes home, and a deep link to a deleted/never-existing game lands on the home screen instead of a broken game view.
  • DeleteGameResponse added to shared/protocol.ts; api.deleteGame() added to the client helper.
  • Tests — new Db.delete unit test (45 total) + 2 e2e tests: (1) delete from the home screen with confirmation (cancel keeps it, confirm removes it and a follow-up GET 404s); (2) deleting an open game returns the active tab home via the SSE error, and a fresh deep link to the deleted id lands on home.

Verification

typecheck ✓ · lint ✓ · unit 45/45 ✓ · build ✓ (client bundle index-CXkLWnfV.js). e2e runs in CI.

Full notes in CHANGELOG.md (v0.8.0).

Fixes #20 ## v0.8.0 Closes the last user-facing gap on the games list: **remove a saved game**, and **redirect to the home screen** when a game is missing or has been deleted. ### What changed - **`DELETE /api/games/:id`** — new route; returns `404 {error:'game not found'}` when absent, otherwise `{deleted:true}` and pushes an SSE `error` event to any open tab of that game. - **`Db.delete(id)`** — prepared `DELETE FROM games WHERE id=?`, reports whether a row was removed. - **Home screen** — each saved-game card gains a small trash button that opens a **confirm dialog** (Cancel / Delete); deleting removes it from the list. - **Missing/deleted games no longer get stuck** — `useSse` now surfaces the server's `error` event, and the app returns to home on `deleted`/`not found`. So a live tab whose game is deleted (by you or another tab) goes home, and a deep link to a deleted/never-existing game lands on the home screen instead of a broken game view. - **`DeleteGameResponse`** added to `shared/protocol.ts`; **`api.deleteGame()`** added to the client helper. - **Tests** — new `Db.delete` unit test (45 total) + 2 e2e tests: (1) delete from the home screen with confirmation (cancel keeps it, confirm removes it and a follow-up `GET` 404s); (2) deleting an open game returns the active tab home via the SSE error, and a fresh deep link to the deleted id lands on home. ### Verification `typecheck` ✓ · `lint` ✓ · `unit 45/45` ✓ · `build` ✓ (client bundle `index-CXkLWnfV.js`). e2e runs in CI. Full notes in `CHANGELOG.md` (v0.8.0).
kamilkrzywda added 1 commit 2026-10-11 22:33:12 +02:00
feat: remove a saved game & redirect on missing/deleted game (#20)
CI / build + unit + e2e (pull_request) Successful in 1m14s
17d6cecab9
- DELETE /api/games/:id route + Db.delete() (404 when absent)
- PresetPicker: per-saved-game trash button + confirm dialog (Cancel/Delete)
- App: runDeleteGame; useSse onError -> goHome on 'deleted'/'not found'
  (a deleted/missing game now returns the live tab and any deep link home)
- DeleteGameResponse in shared/protocol.ts; api.deleteGame()
- unit test (Db.delete) + 2 e2e tests (home-screen delete; in-flight delete
  returns the active tab home and a fresh deep link lands on home)
- version 0.7.0 -> 0.8.0 + changelog

Fixes #20
kamilkrzywda scheduled this pull request to auto merge when all checks succeed 2026-10-11 22:35:57 +02:00
kamilkrzywda merged commit 858b901b8d into master 2026-10-11 22:35:58 +02:00
kamilkrzywda deleted branch feat/delete-saved-games 2026-10-11 22:35:58 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/History#21