wrolpi/app/public
Roland 20d2bb8717
Add PWA: installable app, offline calculators, read-only Inventory
Make the React app an installable PWA whose app shell, calculators
(incl. the One Time Pad), and Inventory work offline. Driving use case:
reference an inventory (e.g. Fasteners) from an iPhone with no connection.

Phase 1 — service worker (Workbox InjectManifest, production build only):
- service-worker.js: precache the shell (calculators work offline),
  NavigationRoute for deep links, NetworkFirst cache of GET /api/inventory
  and /api/inventory/catalog (wrolpi-inventory), NetworkOnly /api/status.
- serviceWorkerRegistration.js + registration in index.js.
- Add workbox-* runtime deps (pinned 6.5.4 to match CRA's bundled plugin).

Phase 2 — offline hardening + read-only Inventory:
- api.js maps offline fetch failures (TypeError / timeout / !navigator.onLine)
  to ApiDownError so the existing nav apiDown indicator lights up.
- toast.js wrapper swallows error toasts while offline; repoint the toast
  import in the 13 files that raise them (App.js container left as-is).
- PwaContext (usePwa() -> {offline, isStandalone}), provider mounted in
  App.js inside StatusProvider. Default offline:false so components render
  without the provider in tests.
- Inventory is read-only offline: InventoryRoute disables the edit buttons
  and shows a banner; InventoryTable hides the new-item row, checkboxes and
  delete, and disables click-to-edit. Values stay visible for reference.

Phase 3 — iOS Add-to-Home-Screen meta tags in public/index.html.

Verified end-to-end against the real API: SW caches the inventory, then with
the origin stopped the cached inventory still renders read-only (reactively
and on cold reload). All 676 Jest tests pass (incl. new InventoryTable
offline tests).

Media "Save for offline" + a Downloads list are intentionally deferred.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 15:21:25 -06:00
..
epub Adding simple search to epub viewer. 2026-04-13 17:23:20 -06:00
android-chrome-192x192.png Zim/Kiwix (Wikipedia) feature 2023-07-10 21:30:40 -06:00
android-chrome-512x512.png Zim/Kiwix (Wikipedia) feature 2023-07-10 21:30:40 -06:00
apple-touch-icon.png Zim/Kiwix (Wikipedia) feature 2023-07-10 21:30:40 -06:00
favicon-16x16.png Zim/Kiwix (Wikipedia) feature 2023-07-10 21:30:40 -06:00
favicon-32x32.png Zim/Kiwix (Wikipedia) feature 2023-07-10 21:30:40 -06:00
favicon-blue.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon-brown.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon-green.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon-grey.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon-olive.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon-orange.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon-pink.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon-purple.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon-red.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon-teal.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon-violet.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon-yellow.svg Changing favicon color when navbar color changes. 2026-02-04 12:28:55 -07:00
favicon.ico Zim/Kiwix (Wikipedia) feature 2023-07-10 21:30:40 -06:00
icon-transparent.png Fixing rebrand binary hook (wrong cwd) and using the new transparent logo. 2026-05-25 20:16:02 -06:00
icon.svg Fixing bug where file search would issue twice on load. 2023-04-09 14:34:33 -06:00
index.html Add PWA: installable app, offline calculators, read-only Inventory 2026-06-22 15:21:25 -06:00
logo192.png Fixing JS warnings. 2022-09-23 11:25:55 -06:00
logo512.png Fixing JS warnings. 2022-09-23 11:25:55 -06:00
manifest.json Zim/Kiwix (Wikipedia) feature 2023-07-10 21:30:40 -06:00
mstile-150x150.png Zim/Kiwix (Wikipedia) feature 2023-07-10 21:30:40 -06:00
one-time-pad-cheat-sheet.pdf A new start 2021-11-01 16:43:09 -06:00
robots.txt A new start 2021-11-01 16:43:09 -06:00