feat(offline): offline lobby — list + create + play local vs_ai games [C6] #198
Reference in New Issue
Block a user
Delete Branch "feature/offline-lobby"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of the PWA offline mode (Phase C, C6). The visible payoff: in offline mode the lobby lists, creates and plays device-local
vs_aigames.What
LocalSource.list()reconstructs a lobbyGameViewper stored local game (by replay), exposed through the lazygamesourceproxy — unit-tested with an in-memory store.load()) branches onofflineMode: it lists local games, skips every gateway call (no online games/invitations/incoming), and disables the Stats tab.vs_aigame viaLocalSource.create, using the profile's advertised dict version (dict_versions, from #196) + a local seed; the with friends flow and the random opponent option are hidden, and the variant picker / Start are enabled offline (they were gated onconnection.online).id.ts:newLocalGameId+randomSeed(tested).Docs: ARCHITECTURE + FUNCTIONAL (+
_ru) offline-mode section.Tests
UI:
check(0 errors), unit (476 —LocalSource.list×3, id helpers ×3), online mock e2e (196 — no regression to online play),build+ bundle gate (112.4 / 113).⚠️ The offline flow itself is contour-verified, not e2e-tested: the mock e2e cannot enter offline mode (the toggle is gated to an installed PWA + confirmed email). Please try it on the contour — Settings → Play mode → Offline → New Game → play a local game.
Deferred to fast-follows
navigatecalls, so I'll wire them separately).Two offline bugs found on the contour: - The word-check screen (CheckScreen) called gateway.gameState/checkWord directly, so in an offline (local) game it hit the network and errored ("something went wrong"). Route both through gameSource(id) — the local source answers from the device dawg. The complaint control (online-only, no offline backend) is hidden for a local game. - The lobby did not react to the offline-mode toggle (which lives in Settings, so the lobby can stay mounted): an online game lingered until the next reload. Reload on an offlineMode flip so entering offline immediately shows only device-local games. Cold offline launch hanging on the splash (boot still fetches the profile over the network) is the separate C2 offline-boot follow-up (needs a persisted profile + a boot short-circuit).