Skip to content

feat(app): add mobile PWA support#37739

Open
Harsha754-ml wants to merge 2 commits into
anomalyco:devfrom
Harsha754-ml:mobile-pwa
Open

feat(app): add mobile PWA support#37739
Harsha754-ml wants to merge 2 commits into
anomalyco:devfrom
Harsha754-ml:mobile-pwa

Conversation

@Harsha754-ml

@Harsha754-ml Harsha754-ml commented Jul 19, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds Progressive Web App (PWA) support to the web application, enabling mobile installation and offline capabilities.

The web app already had responsive design for mobile viewports and a minimal web manifest. This PR completes the PWA setup by adding a service worker with Workbox, an enhanced manifest, offline fallback, and an install prompt banner.

Key changes:

  • vite-plugin-pwa generates a service worker that precaches app shell assets and uses runtime caching (stale-while-revalidate for API calls, cache-first for Google Fonts)
  • Enhanced manifest adds description, categories, orientation, and icons with purpose: "any maskable" so the app shows correctly in install prompts
  • New offline.html page shown when the server is unreachable
  • New PwaInstallBanner component detects the browser's beforeinstallprompt event and shows an "Install" / "Not now" banner at the bottom-right on web platforms

How did you verify your code works?

  • bunx vite build succeeds and produces sw.js, workbox-*.js, manifest.webmanifest, and offline.html in the dist directory
  • Lint (bun run lint) passes with no new warnings
  • No changes to runtime behavior; all PWA features are additive

Screenshots / recordings

N/A — no visual changes to the existing UI; the install banner only appears when the browser supports PWA installation.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

- Added vite-plugin-pwa with Workbox service worker
- Enhanced web manifest with description, categories, orientation, maskable icons
- Created offline fallback page
- Added install prompt banner component
- Configured caching strategies (stale-while-revalidate for API, cache-first for fonts)
Copilot AI review requested due to automatic review settings July 19, 2026 09:36
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jul 19, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Progressive Web App (PWA) support to packages/app by integrating vite-plugin-pwa (Workbox service worker), an offline fallback page, and a client-side “Add to Home Screen” install prompt banner to improve mobile installability and offline behavior.

Changes:

  • Configure vite-plugin-pwa + Workbox runtime caching and navigation fallback.
  • Add an offline fallback page (/offline.html) for offline navigation.
  • Add and render a PwaInstallBanner component in the app UI.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/app/vite.config.ts Adds VitePWA/Workbox configuration, manifest metadata, offline navigation fallback, and runtime caching rules.
packages/app/src/components/pwa-install-banner.tsx New Solid component that listens for install events and renders an install/dismiss banner.
packages/app/src/app.tsx Integrates the PWA install banner into the app shell.
packages/app/public/offline.html Adds a static offline fallback page used by Workbox navigation fallback.
packages/app/package.json Adds vite-plugin-pwa dependency.
bun.lock Lockfile updates for the new PWA/Workbox dependency graph.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/app/src/components/pwa-install-banner.tsx Outdated
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
Comment on lines +24 to +26
registerType: "autoUpdate",
includeAssets: ["favicon.svg", "favicon.ico", "apple-touch-icon-v3.png"],
manifest: {
Comment on lines +27 to +32
name: "OpenCode",
short_name: "OpenCode",
description: "AI-powered development tool",
theme_color: "#080808",
background_color: "#080808",
display: "standalone",
runtimeCaching: [
{
urlPattern: /^https:\/\/.*\.opencode\.ai\/.*/i,
handler: "NetworkFirst",
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants