Skip to content

Add PWA support (offline usage & smart caching) #24

@takker99

Description

@takker99

Priority: P3
Category: Platform / Distribution

Background:
Offline capability would allow field technicians to load the tool once and continue using it without network (assuming browser retains serial permission). A Progressive Web App (PWA) also enables install-like experience.

Goal:
Introduce PWA features: web app manifest, service worker for asset + strategy-based caching, offline fallback page, and versioned cache invalidation.

Scope:

  • manifest.json (name, icons, theme/color, display standalone)
  • Service Worker (Workbox or minimal custom) to precache core assets (HTML, CSS, JS, icons) and runtime cache for fonts
  • Versioned cache purge on deployment
  • Update build to emit manifest & register SW conditionally (production only)

Out of Scope:

  • Background sync of live Modbus data (not feasible offline)

Acceptance Criteria:

  • Lighthouse PWA audits pass (installable, offline capable)
  • First load online, second load offline still renders UI (sans actual serial until port reconnect)
  • Cache bust occurs after new build (old caches removed)
  • README updated with PWA usage note

Tasks:

  1. Add manifest.json + icons (placeholder SVG/PNG)
  2. Implement service worker using Hono (precache + runtime cache strategy)
  3. Register SW in main entry (guarded by 'serviceWorker' in navigator and production)
  4. Add build copy step for manifest/icons
  5. Lighthouse run & attach results (comment)
  6. Docs update

Definition of Done:
Offline reload works (controlled SW), install prompt appears on Chromium, tests/build green.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions