Commit Graph

15 Commits

Author SHA1 Message Date
Josh Creek 030571fd14 perf(offline): stop re-downloading artwork and the offline snapshot
- Sprites are cached as they are viewed instead of bulk-downloaded after
  every sign-in, in one shared cache that is never pruned and survives
  sign-out and account changes, since sprites never change.
- A "Save all artwork for offline" link saves every remaining sprite on
  request, shows the remaining size, and is hidden once all are saved.
- Page loads reuse an offline snapshot under 15 minutes old; edits,
  retries and a new sign-in still sync immediately.
- An expired session no longer wipes offline data; only the Sign Out
  button does.
2026-09-14 16:19:22 +01:00
Josh Creek 721c44dcd0 perf(sprites): ship 192px sprites and a manifest of every sprite
Sprites were shipped at 512x512 but render at 44-64px in the box grid.
Resizing to 192px halves each file (median 15.5KB -> 7.6KB); a full dex
of artwork drops from 16.6MB to 7.6MB.

The sprite build now also writes static/sprites-small/manifest.json,
listing every sprite (all forms, shiny and female variants) with its
size, so the offline worker can save the complete set and report what
is missing. A unit test keeps it in step with the files on disk.
2026-09-14 16:19:22 +01:00
Josh Creek c3a3d43883 fix(offline): cache sprite artwork once instead of on every sync
Each sync created a new artwork cache and re-fetched every sprite with no-cors. Opaque responses are padded to several MB each for storage quota, so a Living Dex grew to tens of GB, syncs never finished, and the offline copy could fail to save.

Artwork now lives in one cache per user that is topped up with only missing sprites, fetched with CORS so they count at their real size, with a per-fetch timeout. The offline copy is committed before any artwork, legacy per-sync artwork caches are removed first, and sprites shown online are cached on first load. Also requests persistent storage.
2026-09-14 15:22:05 +01:00
Josh Creek 3ea194f87c fix: harden review findings and Netlify install 2026-09-14 12:56:09 +01:00
Josh Creek 86f1c21e4d fix: remediate branch review findings 2026-09-14 11:47:58 +01:00
Josh Creek c5c63ab8ef feat(#84): Improve performance and efficiency of service worker 2026-01-22 21:21:57 +00:00
Josh Creek eba34158fe data(*): Fix remaining sprites 2026-01-18 13:14:18 +00:00
Josh Creek f62b18b0ee feat(#22): Add sprites 2024-07-16 21:43:41 +01:00
Amber M ff43601b1a Design About Page 2024-05-15 14:49:30 +01:00
Amber M e6b4cc84bc Make profile page 2024-04-28 13:15:48 +01:00
Josh Creek 5285d5d84d chore(*): Add workbox service worker 2024-04-14 16:03:01 +01:00
Josh Creek f6bf7a7a85 feat(#20): Make the site a PWA 2024-04-08 21:47:42 +01:00
Josh Creek 59ff274a44 build(#13): Add DaisyUI 2024-04-07 15:12:59 +01:00
Josh Creek d708de8b2c feat(#11): Add sprites 2024-04-07 10:48:15 +01:00
Josh Creek e3420d6e02 chore(*): Add base sveltekit files 2024-03-09 21:28:07 +00:00