Skip to content

Move the library to IndexedDB and share backups on iOS - #2

Merged
mrWD merged 7 commits into
mainfrom
pwa-ios-durability
Aug 12, 2026
Merged

mrWD merged 7 commits into
mainfrom
pwa-ios-durability

Conversation

@mrWD

@mrWD mrWD commented Aug 11, 2026

Copy link
Copy Markdown
Owner

What

Same change as film-table#2, for the same reasons — phase 1 of the road to the app stores.

  • Library moves from localStorage to IndexedDB (src/lib/idb-storage.ts, DB gamestable-kv); the quota guard is gone with the ceiling. There is no separate cache store here — the game snapshot lives in the library.
  • One-way migration: the old localStorage value is copied once and left frozen, so a rollback still finds the library.
  • Hydration became async; main.tsx holds the first render until it settles.
  • Export on iOS opens the share sheet via src/lib/export.ts.
  • Docs updated: CLAUDE.md principle 1, DECISIONS (new entry), ARCHITECTURE storage section.

Verified (dev server, 375px)

  • Seeded legacy localStorage library → migrated to IndexedDB, The Witcher 3 renders after reload from the IndexedDB copy
  • No horizontal overflow at 375px; clean console

Not verified live: search (needs the RAWG key from Vercel env — the search layer is untouched), the actual iOS share sheet (needs a device).

🤖 Generated with Claude Code

Same change as FilmTable's, for the same reasons: the library moves
from localStorage to IndexedDB (lib/idb-storage.ts) — no more ~5 MB
ceiling, and the format a native storage plugin migrates from when
the app is wrapped for the stores. The old localStorage value is
copied once and left frozen, so a rollback still finds the library.
Hydration became async; main.tsx holds the first render until it
settles. Exporting a backup on iOS opens the share sheet instead of
a download nobody finds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
games-table Error Error Aug 11, 2026 5:39pm

The same treatment BooksTable piloted, with its findings already
applied rather than rediscovered: tables-core supplies the storage,
export and platform code; the library lives in a file in private app
storage natively; the status bar icons follow the system rather than
this app's theme; the splash waits for the first render; Android's back
button navigates and minimises instead of exiting; status changes tick,
and reaching played or watched gets the success pattern.

/api/games is reached by absolute URL in the native build. This matters
more here than in FilmTable: every catalogue call goes through the
proxy, so a build without a base would have no search at all, which is
why the production address is a fallback rather than a required
environment variable.

The proxy needed no change. Verified against production: a request
carrying Origin: capacitor://localhost is answered 200, because the
origin parses to the host localhost and the loopback rule already
permits it.

Verified on the Android emulator: builds, launches, and a search for
'portal' returns Portal 2, Portal and Portal Knights with artwork
through the remote proxy. RAWG is answering 522 in production right now
— for the web app as well, so console titles are missing from both
until that is looked at; the Steam fallback is what is being exercised
above.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
public/privacy.html says, accurately, that the library never leaves
the device and that catalogue queries pass through our proxy, which
stores nothing; docs/STORE.md holds the listing texts, the data-safety
answers and the checklist of what only the owner can do.

No notifications here by design: unlike episodes airing or a book left
mid-read, a game has no external event worth interrupting anyone for.
FilmTable and BooksTable got theirs in this same round.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The installed app on a phone showed 'start it locally, or deploy it,
and search will work' — advice written for a developer running the dev
server, offered to someone holding a finished app. The proxy is
deployed and reachable; the outage is upstream.

import.meta.env.DEV is the line between the two situations, so the
developer keeps the actionable hint and every build that ships says
what is actually true: the catalogue is not answering, the library is
untouched, try later. Verified the dev string is absent from the
production bundle.

Found by running the app on a real iPhone. The outage behind it is
RAWG's own: api.rawg.io answers 522 directly, with no proxy and no key
involved, so console games are unfindable everywhere — web included —
until it recovers. That is principle 3 in CLAUDE.md broken by the
upstream, not by this code; the Steam fallback still answers for PC
titles.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
iOS zooms in on any focused field whose font-size is under 16px,
leaving the app magnified and panned sideways. The feedback textarea
was 14px. Found on BooksTable's page-number field while testing on the
simulator; the same rule was in all three apps, so all three are
fixed, with a comment saying why so it does not drift back.

The floor is the fix, not a viewport lock: user-scalable=no would stop
the zoom too, at the cost of pinch zoom for everyone who needs it.

Verified at 375px afterwards: every route still measures
scrollWidth == clientWidth, in both themes, with a clean console.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Reported from a real phone: Explore sat on loading skeletons with no
explanation. It was not hung — the request was still in flight. Timed
against production while RAWG's own API is down: 19.5 seconds, twice
in a row, before the proxy returns its 522.

This app is the one that needed a deadline most and was the only one
without one. FilmTable and BooksTable wrap their supplementary sources
in short timeouts and have a primary source that answers regardless;
here every catalogue call goes through the proxy, so there was nothing
underneath to keep the screen alive.

A timed-out request no longer disables RAWG for the session either.
That flag means 'the proxy is not there' — a slow moment is not the
same claim, and conflating them would turn one bad minute into no
console games until the app restarts.

Verified on the simulator: the honest message now arrives inside ten
seconds, and a healthy search ('hollow knight') still returns its five
Steam results, so the deadline does not clip working requests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
RAWG went down and Explore collapsed to a single apologetic sentence:
both discover sections were RAWG-only. Search had a fallback already,
which made the asymmetry plain — the screen that greets you had none.

Steam's featuredcategories fills those sections now: no key, 0.27s,
cover art included, verified loading in the app. The sections rename
themselves to 'New on Steam' and 'Coming soon on Steam' because a
PC-only list is a narrower answer, not an equal one.

top_sellers is deliberately unused despite matching 'Popular now'
better: measured during a Valve hardware launch it was four copies of
'Steam Machine' and a controller, and type is 0 for both hardware and
games, so nothing in the payload separates them.

This does not bring console games back — Steam has none, which is the
finding the whole architecture rests on. Both alternatives that could
have were measured and rejected: Wikipedia finds Zelda and Mario in
0.4s but had covers for 1 of 8 results, and Wikidata took 19.6s for 3
covers out of 61 games. Cover art is copyrighted, so no keyless source
has it. Closing that properly needs a second keyed catalogue.

The allowlist change lives in api/games.js, so this only takes effect
once the proxy is deployed; until then the app behaves as before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mrWD
mrWD merged commit 19b2c42 into main Aug 12, 2026
2 of 4 checks passed
@mrWD
mrWD deleted the pwa-ios-durability branch August 12, 2026 11:15

This branch had an error being deployed

1 failed deployment
Preview — 9fbcd040 Deployed Aug 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant