feat(ui): offline-first foundations — bundled dicts + local-guest identity

The additive groundwork for the native offline-first experience (ANDROID_PLAN.md §D).
Inert until the native cold-boot lands: on the web these paths never fire, so web / VK /
Telegram behaviour is unchanged.

- ui/scripts/bundle-dicts.mjs copies the scrabble-dictionary release DAWGs into
  dist/dict/<variant>@<version>.dawg for the native pipeline (run after `pnpm build`,
  before `cap sync`).
- The dict loader gains a bundled tier between the IndexedDB and network tiers, attempted
  only on a native channel (a packaged app serves ./dict/<key>.dawg from its assets).
  Native-gated rather than the plan's "404 on the web" because the relative path would
  otherwise hit the gateway's own session-gated /dict/ route.
- __DICT_VERSION__ Vite define (from VITE_DICT_VERSION, default "dev") + its ambient
  declaration; the offline vs_ai / hotseat creates in NewGame fall back to it when a
  device-local guest has no profile-advertised version.
- New lib/localguest.ts: a persisted device-local guest id (no DB row); the offline vs_ai
  human seat uses it (and the localized common.guest name) when there is no server session.

svelte-check clean, vitest green, native + web builds clean. The cold-boot rewrite,
reconciliation, the Profile soft-sign-in gating and the offline-first e2e follow.
This commit is contained in:
Ilia Denisov
2026-07-12 16:41:19 +02:00
parent a57fd355ba
commit bcd5a1d02d
8 changed files with 131 additions and 9 deletions
+4
View File
@@ -19,3 +19,7 @@ interface ImportMeta {
/** App version string, injected by Vite's define from `git describe` at build time. */
declare const __APP_VERSION__: string;
/** Bundled-dictionary version, injected by Vite's define from VITE_DICT_VERSION (default "dev"). The
* native offline path requests this (variant, version) so it matches the packaged ./dict files. */
declare const __DICT_VERSION__: string;