Skip to content

Installable PWA with an offline shell - #53

Merged
Androtim merged 3 commits into
mainfrom
feat/pwa
Jul 3, 2026
Merged

Androtim merged 3 commits into
mainfrom
feat/pwa

Conversation

@Androtim

@Androtim Androtim commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Makes Beacon installable (address-bar install → app window, home-screen icon) and able to open offline.

  • Web manifest (manifest.webmanifest): standalone display, theme color, name/description, and an app icon.
  • App icon (app-icon.svg): a simple beacon mark with maskable safe-zone padding. Placeholder-quality on purpose — easy to swap for real art later.
  • Service worker: rather than add a second worker (which would fight the existing streaming worker for the root scope), the existing sw.js gains app-shell caching. Navigations are network-first with a cached-shell offline fallback; content-hashed build assets are cache-first. Critically, /p2p/, /api/, /socket.io/, media, and any Range request are all left untouched, so stream-while-downloading and live data are unaffected.
  • Registers the worker on load (previously it registered lazily on first stream), which is what makes the app installable.

Verified in a real browser: the page is SW-controlled, the manifest parses (standalone, icon, theme color), and there are no console errors. Ran the SW-sensitive specs explicitly (streaming, P2P transfer, video playback) — all pass — plus the full Playwright suite green with no failures.

The icon is deliberately a placeholder; point me at real art (or a direction) and I'll swap it.

🤖 Generated with Claude Code

Androtim and others added 3 commits July 4, 2026 00:39
Adds a web manifest (standalone display, theme color, app icon) and
registers the service worker on load so Beacon is installable and
opens offline. The existing streaming worker gains app-shell caching
rather than adding a second worker that would fight it for the root
scope: navigations are network-first with a cached-shell fallback,
content-hashed assets are cache-first, and /p2p/, /api/, /socket.io/,
media, and range requests are all left untouched so streaming and
live data keep working.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Androtim
Androtim merged commit 92bf371 into main Jul 3, 2026
1 check passed
@Androtim
Androtim deleted the feat/pwa branch July 3, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant