Files
free-steam-games-list/docs
poli0981andClaude Opus 5 369cc776d0 feat(web): app shell, data layer and first pages on SvelteKit
The shell runs end to end against real data: consent gate, sidebar, topbar,
command palette, theme switching, i18n, the catalogue load, and a rendering
ECharts chart. Verified in a browser at 1440x900 and at mobile width.

## Data layer, without TanStack Query

lib/resource.svelte.ts is ~90 lines of runes replacing @tanstack/react-query.
What the app used from that library was isLoading/error/data/refetch, a stale
time and one refetchOnWindowFocus. Caching is deliberately NOT reimplemented:
the catalogue's real cache is IndexedDB keyed on index.json.last_updated, the
only invalidation signal this dataset has, and a memory cache on top would be a
second thing to get wrong. The three-step load (read cache, compare
last_updated, else fetch shards and parse in a worker) is carried over exactly.

## i18n gaps closed rather than carried forward

The plan listed eleven categories of hardcoded English inside an otherwise
translated app. Fixed so far:

- The seven KPI labels, which lived as string literals in KpiCards.tsx.
- formatRelativeDate, which returned "today" / "3d ago" / "2w ago" regardless
  of locale. Now Intl.RelativeTimeFormat, which also handles pluralisation -
  the part a template string per language cannot do.
- formatNumber, which hardcoded toLocaleString("en-US"), so a Vietnamese
  reader saw 1,234,567 where their locale groups as 1.234.567.
- The command palette, whose 17 labels were the only untranslated strings in
  the app. It is now built from the nav lists instead of its own array - which
  had already drifted, missing /top-offline, /donate,
  /charts/anti-cheat/list, /charts/delisted and /welcome.

en.json and vi.json go 353 -> 392 keys, edited together by script with the leaf
sets asserted equal, because hand-editing one is how they stop matching.

## Things fixed on the way through

- Ctrl-K now checks e.isComposing. Without it the shortcut fires mid-IME
  composition and steals the keystroke, which made the palette actively
  hostile to Vietnamese input - the locale it exists for.
- The theme "system" option now listens for prefers-color-scheme changes. The
  React Topbar read matchMedia once and never subscribed, so "system" never
  actually reacted.
- The Toaster took the resolved theme instead of a hardcoded "dark", which had
  put a dark toast on a white page in light mode.
- The sidebar version is derived from __APP_VERSION__; it said "Steam · v1.0"
  while package.json was 1.4.5.
- Distinct icons per nav row: Trophy was used for BOTH leaderboards and Shield
  for two anti-cheat entries, which makes an icon useless for finding a row.
- legal.ts said "The 5 binding documents"; the licence split made it six.
- /legal/<slug> links are real links now. Welcome.tsx built that exact href
  and then called preventDefault() to bounce to /about, because nothing was
  there to receive it.

## Two bugs found by looking, not by guessing

**The chart rendered nothing.** ECharts initialised and created its container
but painted no canvas - which looks exactly like the unregistered-theme
failure CLAUDE.md warns about. It was not that: `chart` was a plain `let`, so
the setOption effect ran once while it was still undefined and never re-ran
when init assigned it. Making it $state fixed it, and the comment now names
both failure modes so the next person does not misdiagnose it the same way.

**Cloudflare Hotlink Protection is ON and the packaged apps survive it by
luck.** Every /img/* request from the dev server came back 403, body
`error code: 1011`. Measured against the live zone: no Referer 200, own-origin
Referer 200, but `http://localhost:5173/` 403, `tauri://localhost/` 403 and
`http://tauri.localhost/` 403 - the two origins the desktop and Android builds
actually load images from. They render today only because the Tauri webview
sends no Referer for <img>, which is not a guarantee anyone made: a WebView
update doing the ordinary spec-compliant thing would blank every image in both
apps with no change on our side. Written up as SECURITY_SETUP.md section 10
with the measurements and a recommendation to turn it off - it restricts
nothing that worker/routes/img.ts's anchored PATH_RE and host allowlist do not
already restrict, and Referer is client-set anyway.

## Still to port

The games table, nine of the eleven chart pages, about/settings/health/
activity/donate, /legal/[doc], and the four new surfaces (/stats,
/developers, /publishers, /games/[appid]). The foundation they all sit on -
routing, data, i18n, theming, charts, consent - is proven working.

check / test / build all clean; the 39 Worker tests are untouched by this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 13:17:27 +07:00
..