Make the frontend an installable PWA

Add a web app manifest and an install-only service worker (no offline
caching: live state always comes from the server and hashed asset names
change every build), registered from the WASM bundle. The worker must
live at the site root for its scope to cover the app, and Granian only
serves /static and /assets, so tavolo/static.py answers
/manifest.webmanifest and /sw.js from STATIC_DIR with the content types
browsers require; index.html gains the manifest link, icons, theme-color
and Apple standalone meta tags.

Icons are committed under web/assets/icons/ with vector sources and a
make-icons.sh regeneration script, mirroring the card art workflow.
This commit is contained in:
2026-10-14 22:14:43 +00:00
parent 532cb16f94
commit 8c6ad10bf6
17 changed files with 271 additions and 19 deletions
+2
View File
@@ -4,6 +4,7 @@ mod auth;
mod components;
mod model;
mod pages;
mod pwa;
mod ws;
use sycamore::prelude::*;
@@ -91,5 +92,6 @@ fn main() {
)
}
});
pwa::register();
restore_page_after_login();
}