feat(offline): wire the local game source into the game screen (Phase B3.2) #194

Merged
developer merged 1 commits from feature/offline-game-seam-wire into development 2026-07-06 07:31:06 +00:00
Owner

Phase B3.2 of PWA offline mode, on top of #193. The game screen now drives a local vs_ai game through the offline engine, dispatched by game id — completing the playable local game. Online play is unchanged.

  • gamesource.ts: gameSource(id) returns the local source for a local: id, else the gateway (same game-loop interface). The offline engine stays OUT of the app entry bundle — dynamically imported on first use (a separate ~8KB gzip chunk), so online-only users never pay for it (app entry 111.2/112 KB, still within budget).
  • localgame/id.ts: the tiny id helper (no engine imports) the dispatcher branches on.
  • Game.svelte: the game-loop calls (state/history/submit/pass/exchange/resign/hint/evaluate/draft) go through gameSource(id) instead of the gateway directly; a local game's robot-reply events route through the same app event hub the network stream feeds, so the screen reacts to opponent_moved / game_over identically.

Behaviour-preserving for network games (gameSource returns the gateway for them). Local verify green: check + test:unit + build + bundle-size gate + e2e (196 passed). (A local-game e2e needs offline creation + a mock dawg — that lands with Phase C, the offline UX.)

Phase B3.2 of PWA offline mode, on top of #193. The game screen now drives a local vs_ai game through the offline engine, dispatched by game id — completing the playable local game. Online play is unchanged. - `gamesource.ts`: `gameSource(id)` returns the local source for a `local:` id, else the gateway (same game-loop interface). The offline engine stays OUT of the app entry bundle — dynamically imported on first use (a separate ~8KB gzip chunk), so online-only users never pay for it (app entry 111.2/112 KB, still within budget). - `localgame/id.ts`: the tiny id helper (no engine imports) the dispatcher branches on. - `Game.svelte`: the game-loop calls (state/history/submit/pass/exchange/resign/hint/evaluate/draft) go through `gameSource(id)` instead of the gateway directly; a local game's robot-reply events route through the same app event hub the network stream feeds, so the screen reacts to opponent_moved / game_over identically. Behaviour-preserving for network games (`gameSource` returns the gateway for them). Local verify green: check + test:unit + build + bundle-size gate + e2e (196 passed). (A local-game e2e needs offline creation + a mock dawg — that lands with Phase C, the offline UX.)
developer added 1 commit 2026-07-06 07:25:13 +00:00
feat(offline): wire the local game source into the game screen (Phase B3.2)
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m9s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m40s
1654131904
The game screen now drives a local vs_ai game through the offline engine, dispatched by
game id — completing the playable local game (on top of the source, #193). Online play
is unchanged.

- gamesource.ts: gameSource(id) returns the local source for a `local:` id, else the
  gateway (the same game-loop interface). The offline engine stays OUT of the app entry
  bundle — it is dynamically imported on first use (a separate chunk), so online-only
  users never pay for it (the app entry stays within its size budget).
- localgame/id.ts: the tiny id helper (no engine imports) the dispatcher branches on.
- Game.svelte: the game-loop calls (state/history/submit/pass/exchange/resign/hint/
  evaluate/draft) go through gameSource(id) instead of the gateway directly; a local
  game's robot-reply events route through the same app event hub the network stream
  feeds, so the screen reacts to opponent_moved / game_over identically.

Behaviour-preserving for network games (gameSource returns the gateway for them). Local
verify green: check + test:unit + build + bundle-size gate + e2e (196 passed).
owner approved these changes 2026-07-06 07:30:30 +00:00
developer merged commit d80d28a402 into development 2026-07-06 07:31:06 +00:00
developer deleted branch feature/offline-game-seam-wire 2026-07-06 07:31:06 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#194