Skip to content

Add PWA assets, offline page, and service worker with app-launch overlay#2

Open
Bytewave-coder wants to merge 7 commits into
mainfrom
codex/add-pwa-support-and-meta-tags-owqh1u
Open

Add PWA assets, offline page, and service worker with app-launch overlay#2
Bytewave-coder wants to merge 7 commits into
mainfrom
codex/add-pwa-support-and-meta-tags-owqh1u

Conversation

@Bytewave-coder

Copy link
Copy Markdown
Owner

Motivation

  • Improve installability and offline reliability by adding a web app manifest, service worker, and an offline fallback page.
  • Provide brand assets and social preview imagery for sharing and better first impressions.
  • Surface a short launch experience to reassure users while the app initializes.

Description

  • Added three SVG assets: assets/logo.svg, assets/offline-illustration.svg, and assets/og-image.svg for branding, offline UI, and social previews.
  • Enhanced index.html with PWA/meta tags (OG/Twitter), manifest.json and 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 plus beforeinstallprompt handling.
  • Updated manifest.json with description, id, scope, display_override, icons, categories, lang, and a shortcuts entry to enable installability and better platform integration.
  • Added offline.html as a user-friendly offline landing page and overhauled service-worker.js to CACHE_NAME = "naman-ai-cache-v3", include an app shell list, support install/activate lifecycle with cache cleanup, handle message for SKIP_WAITING, use a navigation-aware fetch strategy with offline fallback, and cache successful GET responses.

Testing

  • No automated tests were added or run for this change.

Codex Task

@Bytewave-coder

Copy link
Copy Markdown
Owner Author

Nice

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread index.html
}

window.addEventListener("beforeinstallprompt", (event) => {
event.preventDefault();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread service-worker.js
})
.catch(() => cachedResponse);

return cachedResponse || networkFetch;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant