Commit Graph

18 Commits

Author SHA1 Message Date
Josh Creek b2b750115f perf(sprites): serve grid-sized thumbnails from an immutable URL space
Every grid cell downloaded the full detail sprite. Generate a smaller
/sprites-grid/v1/ set at build time and let the grid ask for those first,
falling back through the existing detail URLs when a thumbnail is missing so
detail resolution is unchanged. The new prefix is versioned, so it can be cached
forever, and the service worker recognises it alongside the other sprite roots.

The placeholder is now an empty box rather than a spinner: a thousand spinners
cost layout work and announced nothing useful.
2026-09-15 17:46:49 +01:00
Josh Creek ff29095c47 perf: fix slow page loads and gate performance in CI
- Ship one hashed Tailwind stylesheet instead of two (one render-blocking)
- Compress responses in-app (brotli/gzip, streaming-safe) and precompress
  the node build so local and CI measurements match production
- Validate the Supabase session once per request
- Render the homepage immediately and stream public stats
- Stream a Pokedex's entries with the page instead of fetching after
  hydration, running the rows and count queries in parallel
- Shrink the avatar and offline placeholder images, fix layout shift,
  contrast, link names and missing meta descriptions
- Add Lighthouse CI (mobile + desktop) with score and metric budgets,
  bundle-size budgets in the build tests, and signed-in speed scenarios
2026-09-14 20:53:53 +01:00
Josh Creek 9ddca18f54 revert(sprites): keep the original 512px sprites
The resize to 192px isn't worthwhile now that sprites are only downloaded
when viewed or saved on request, and then kept forever. Restore the
original files and the script's no-resize default, drop the detail view
size cap, and regenerate the sprite manifest with the original sizes.
2026-09-14 16:53:31 +01:00
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