Add PWA assets, offline page, and service worker with app-launch overlay#2
Add PWA assets, offline page, and service worker with app-launch overlay#2Bytewave-coder wants to merge 7 commits into
Conversation
|
Nice |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 859f64ac57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| window.addEventListener("beforeinstallprompt", (event) => { | ||
| event.preventDefault(); |
There was a problem hiding this comment.
Remove unconditional suppression of install prompt
Calling event.preventDefault() on every beforeinstallprompt suppresses the browser’s native install UI, and this change does not add any follow-up prompt() call (the event is only stored on window.deferredInstallPrompt). In practice, users never see an install prompt, which is a functional regression for PWA installability unless a custom install button flow is implemented.
Useful? React with 👍 / 👎.
| }) | ||
| .catch(() => cachedResponse); | ||
|
|
||
| return cachedResponse || networkFetch; |
There was a problem hiding this comment.
Restrict cache-first behavior to static GET assets
This returns cached data before network for every GET request (cachedResponse || networkFetch), so dynamic endpoints are served stale values. The app performs live GET lookups (for example, fetchWikipedia and fetchNews), and with this handler those responses can lag by at least one request and persist stale data when offline. The cache-first branch should be limited to versioned static assets, with network-first/no-cache for live API calls.
Useful? React with 👍 / 👎.
Motivation
Description
assets/logo.svg,assets/offline-illustration.svg, andassets/og-image.svgfor branding, offline UI, and social previews.index.htmlwith PWA/meta tags (OG/Twitter),manifest.jsonand icon links, a preload for the logo, a small app-launch overlay UI (markup + styles + Lottie animation), and scripts to hide the overlay after load and register the service worker plusbeforeinstallprompthandling.manifest.jsonwith description,id,scope,display_override, icons, categories, lang, and ashortcutsentry to enable installability and better platform integration.offline.htmlas a user-friendly offline landing page and overhauledservice-worker.jstoCACHE_NAME = "naman-ai-cache-v3", include an app shell list, supportinstall/activatelifecycle with cache cleanup, handlemessageforSKIP_WAITING, use a navigation-aware fetch strategy with offline fallback, and cache successful GET responses.Testing
Codex Task