Skip to content

[judy] feat(pwa): installable PWA shell (manifest + service worker)#46

Merged
SymbolStar merged 1 commit into
mainfrom
judy/pwa-shell
Jun 2, 2026
Merged

[judy] feat(pwa): installable PWA shell (manifest + service worker)#46
SymbolStar merged 1 commit into
mainfrom
judy/pwa-shell

Conversation

@SymbolStar

Copy link
Copy Markdown
Owner

Thread: th_19e6e6a8a5a_2979da (将 OpenForge 封装成可独立运行的 app)

What

Phase 1 of the "OpenForge as a Mac app" plan: make the existing web UI installable as a standalone Dock app via Chrome/Edge's "Install app" affordance. No native bundle, no Electron, no code signing — backend keeps running under launchd unchanged.

Changes

  • web/manifest.webmanifest — name/short_name/icons (reuses existing branding/logo-forge-f-{32,48,256}.png), display: standalone + window-controls-overlay fallback, theme #0a0a0a to match the new Slack-ish palette.
  • web/sw.js — minimal service worker. Stale-while-revalidate on a small allow-list of shell assets (style.css, app.js, /branding/, /assets/, manifest). All /api/* requests are network-only (belt + suspenders). CACHE_VERSION constant for easy bumps.
  • server.py — whitelisted routes for /manifest.webmanifest and /sw.js. The SW response also sets Service-Worker-Allowed: / so its scope is unambiguous.
  • web/index.html<link rel=manifest>, theme-color, apple-mobile-web-app-* metas, and a deferred navigator.serviceWorker.register('/sw.js', { scope: '/' }). Registration failure is non-fatal.

Verification

Ran the server on a side port and curled:

$ curl -sD- -o/dev/null /manifest.webmanifest
HTTP/1.0 200 OK
Content-Type: application/manifest+json; charset=utf-8

$ curl -sD- -o/dev/null /sw.js
HTTP/1.0 200 OK
Content-Type: application/javascript; charset=utf-8
Service-Worker-Allowed: /

To install: open http://127.0.0.1:7878/ in Chrome → address bar shows an "Install app" icon → click → standalone window with Forge icon in Dock and Cmd-Tab.

Out of scope (deliberate)

  • Tray / menu-bar icon, global hotkeys, native notifications → would need Tauri wrapper. Phase 2 if standalone window mode turns out not to be enough.
  • PyInstaller-embedded backend → loses launchd auto-restart and forge update. Not worth it while OpenForge is single-user.

cc @scott

Make OpenForge installable as a standalone Mac app via Chrome/Edge
"Install app" — no native bundle, no Electron, no signing. Verified:

  curl /manifest.webmanifest  -> 200 application/manifest+json
  curl /sw.js                 -> 200 + Service-Worker-Allowed: /

Changes:
- web/manifest.webmanifest: name/icons/theme using existing branding/*
- web/sw.js: SWR cache for shell assets, network-only for /api/*
- server.py: whitelist routes for both files (sw.js gets the SW header)
- web/index.html: <link rel=manifest>, theme-color, apple-mobile-web-app-*,
  and a deferred navigator.serviceWorker.register('/sw.js')

Phase 1: shell only. Tray icon / global hotkeys / native notifications
would be a follow-up Tauri wrapper once we know standalone window mode
is enough for daily use.
@github-actions

Copy link
Copy Markdown

🤖 bot-review (comment-only · phase 1)

Diff: 4 files changed, 170 insertions(+) @ f86a9e3

Red-line checks:

  • ✅ A-7.5: no new 'forbidden' code in xiaof

Needs human review — these paths are not eligible for future auto-approve:

  • server.py (HTTP routes / handler — never auto-approve)

Phase 1: this bot leaves comments only. Auto-approve will be enabled per-path after 1–2 weeks of clean runs. Promotion plan: judy PR #42 follow-up.

@SymbolStar SymbolStar merged commit 3fba65e into main Jun 2, 2026
7 checks passed
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