Smoother daily use: remember profile, work offline, fix install #1

Merged
krburchel merged 1 commits from smoother-shopping into main 2026-06-13 14:24:03 +00:00
krburchel commented 2026-06-13 14:23:41 +00:00 (Migrated from github.com)

Knocks out the top 3 smoothness fixes.

1. Remember who's signed in

currentProfile reset to Kevin on every load, so Chey's items were all credited to Kevin. It now persists to localStorage and restores on load (same pattern as shoppingMode).

2. Survive bad store wifi

  • Firestore now initializes with persistentLocalCache (IndexedDB) — reads come from cache instantly, writes queue and sync when signal returns.
  • New sw.js caches the app shell + Firebase SDK modules + fonts so the app opens at all with no connection. Firestore's own request traffic is excluded and left to the SDK's offline layer.

3. Fix home-screen install

  • manifest.json: start_url "/" → "./" (+ scope). On this project Pages site, "/" launched krburchel.github.io/ (404); now it opens /grocery-list/.
  • Added real 192 / 512 maskable icons + a 180px apple-touch-icon and the apple-mobile-web-app-* meta tags, so the iOS home-screen icon is a white-cart-on-green tile instead of a gray screenshot.

Verification

Loaded the built page in headless Chrome over a local server: module boots cleanly (store + category pills render, so the initializeFirestore swap didn't throw). manifest.json is valid JSON, sw.js passes node --check.

🤖 Generated with Claude Code

Knocks out the top 3 smoothness fixes. ## 1. Remember who's signed in `currentProfile` reset to **Kevin** on every load, so Chey's items were all credited to Kevin. It now persists to `localStorage` and restores on load (same pattern as `shoppingMode`). ## 2. Survive bad store wifi - Firestore now initializes with `persistentLocalCache` (IndexedDB) — reads come from cache instantly, writes queue and sync when signal returns. - New `sw.js` caches the app shell + Firebase SDK modules + fonts so the app **opens at all** with no connection. Firestore's own request traffic is excluded and left to the SDK's offline layer. ## 3. Fix home-screen install - `manifest.json`: `start_url` `"/"` → `"./"` (+ `scope`). On this project Pages site, `"/"` launched `krburchel.github.io/` (404); now it opens `/grocery-list/`. - Added real **192 / 512 maskable** icons + a **180px `apple-touch-icon`** and the `apple-mobile-web-app-*` meta tags, so the iOS home-screen icon is a white-cart-on-green tile instead of a gray screenshot. ## Verification Loaded the built page in headless Chrome over a local server: module boots cleanly (store + category pills render, so the `initializeFirestore` swap didn't throw). `manifest.json` is valid JSON, `sw.js` passes `node --check`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.