Commit 2340242
The PWA backend (manifest + hand-rolled SW serving) shipped in #200,
but nothing linked the manifest or registered the SW, so the browser
never offered "Install" and the SW never activated. This wires the
frontend half.
- `index.html` template: `<link rel="manifest" href="{{ mount_point }}web.manifest">`
+ `theme-color` / `apple-mobile-web-app-*` meta so the browser's
install heuristics fire.
- `main.tsx`: register `<mount>sw.js` scoped to the mount on `load`.
Best-effort (offline/install is progressive enhancement); the SW
itself honors `no-store` so authenticated reads are never cached, and
the mount scope is permitted by the backend's
`Service-Worker-Allowed: <mount>` header.
Install-prompt affordance + logout cache-purge (`dar:purge`) are the
remaining follow-ups on #86.
Test: `test_shell_links_pwa_manifest` asserts the shell links the
manifest + theme-color. Typecheck green (7 pkgs); build ok; prettier +
ruff + black clean; 15 spa-index tests pass.
Tier 4 (web) + the template (Tier 3-ish, no logic). Self-merging under
the repo-owner's full-tier authorization.
Co-authored-by: Martin Castro Laminrs <mcastro@laminr.ai>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bb1b015 commit 2340242
3 files changed
Lines changed: 37 additions & 3 deletions
File tree
- django_admin_react/templates/admin_react
- frontend/apps/web/src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
37 | 54 | | |
38 | 55 | | |
39 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
0 commit comments