You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add the installable PWA shell, manifest, icons, and safe service worker #1721
The mobile experience must be installable before it can receive iOS/iPadOS Home Screen Web Push and icon badges. The service worker should provide a focused install shell without caching authenticated API responses or stale task data.
Use a hand-written service worker rather than a broad cache-first plugin preset. ProPR contains sensitive, rapidly changing operational data, so only versioned static assets and the navigation shell should be cached. Runtime API responses remain network-only. Notification action buttons are limited to View and Dismiss because destructive workflow actions require in-app confirmation and browser support for notification actions varies.
File: propr-ui/public/manifest.webmanifest (new file)
Why this file: The manifest supplies install metadata, standalone display behavior, icons, and shortcuts used by mobile launchers.
File: propr-ui/public/icons/propr-pwa-source.svg (new file)
Why this file: Keep a reviewable vector source in the repository so committed PNG icons can be reproduced instead of becoming unexplained binary artifacts.
<svgxmlns='http://www.w3.org/2000/svg'viewBox='0 0 512 512'>
<!-- The generous background safe area protects the mark from maskable-icon crops. -->
<rectwidth='512'height='512'rx='112'fill='#1d8a8a'/>
<pathfill='#ffffff'd='M138 116h130c76 0 122 40 122 108 0 70-48 112-128 112h-48v60h-76V116zm76 64v92h45c36 0 55-16 55-47 0-30-19-45-55-45h-45z'/>
</svg>
Binary assets to add
Why these files: iOS uses the Apple touch icon rather than relying solely on the manifest. Generate these from the SVG above using the repository's approved palette and commit the output so production builds need no image-generation dependency.
propr-ui/public/icons/propr-192.png 192x192 PNG
propr-ui/public/icons/propr-512.png 512x512 PNG
propr-ui/public/icons/propr-maskable-512.png 512x512 PNG with the mark inside the 80% safe zone
propr-ui/public/icons/apple-touch-icon.png 180x180 opaque PNG
File: propr-ui/index.html
Why this file: Safari reads several installation hints directly from HTML, and the manifest must be discoverable before React boots.
--- a/propr-ui/index.html+++ b/propr-ui/index.html@@ -3,6 +3,12 @@
<head>
+ <!-- Keep install metadata in static HTML so mobile browsers can discover it+ even when authentication or the API is temporarily unavailable. -->+ <link rel='manifest' href='/manifest.webmanifest'>+ <link rel='apple-touch-icon' href='/icons/apple-touch-icon.png'>+ <meta name='theme-color' content='#1d8a8a'>+ <meta name='apple-mobile-web-app-capable' content='yes'>+ <meta name='apple-mobile-web-app-status-bar-style' content='default'>+ <meta name='apple-mobile-web-app-title' content='ProPR'>
File: propr-ui/public/sw.js (new file)
Why this file: The service worker owns shell caching, push display, notification click routing, and background badge changes.
constCACHE_NAME='propr-shell-v1';constSHELL_ASSETS=['/','/manifest.webmanifest','/icons/propr-192.png','/icons/propr-512.png'];self.addEventListener('install',event=>{// Cache only public shell files; authenticated API content must never be// persisted in a shared browser cache by this worker.event.waitUntil(caches.open(CACHE_NAME).then(cache=>cache.addAll(SHELL_ASSETS)));});self.addEventListener('activate',event=>{event.waitUntil(Promise.all([caches.keys().then(keys=>Promise.all(keys.filter(key=>key!==CACHE_NAME).map(key=>caches.delete(key)))),self.clients.claim(),]));});constisSensitivePath=url=>url.pathname.startsWith('/api/')||url.pathname.startsWith('/socket.io/')||url.pathname.startsWith('/login')||url.pathname.includes('/auth/')||url.pathname==='/config.js';self.addEventListener('fetch',event=>{constrequest=event.request;consturl=newURL(request.url);if(request.method!=='GET'||url.origin!==self.location.origin||isSensitivePath(url))return;if(request.mode==='navigate'){event.respondWith(fetch(request).catch(()=>caches.match('/')));return;}event.respondWith(caches.match(request).then(cached=>cached||fetch(request).then(response=>{// Cache immutable-looking successful static resources only. Avoid caching// opaque responses or dynamic HTML returned under asset-looking URLs.if(response.ok&&['script','style','image','font'].includes(request.destination)){constcopy=response.clone();voidcaches.open(CACHE_NAME).then(cache=>cache.put(request,copy));}returnresponse;})));});constsafeAppPath=value=>{try{consturl=newURL(value||'/inbox',self.location.origin);returnurl.origin===self.location.origin ? `${url.pathname}${url.search}${url.hash}` : '/inbox';}catch{return'/inbox';}};constsafePrUrl=value=>{try{consturl=newURL(value);returnurl.protocol==='https:'&&url.hostname==='github.com' ? url.href : null;}catch{returnnull;}};constsetBadge=asynccount=>{if(!self.navigator?.setAppBadge)return;if(Number(count)>0)awaitself.navigator.setAppBadge(Number(count));elseif(self.navigator.clearAppBadge)awaitself.navigator.clearAppBadge();};self.addEventListener('push',event=>{letdata={};try{data=event.data?.json()??{};}catch{data={};}constdeepLink=safeAppPath(data.deepLink);event.waitUntil(Promise.all([self.registration.showNotification(String(data.title||'ProPR update'),{body: String(data.body||'Open ProPR for details.'),icon: '/icons/propr-192.png',badge: '/icons/propr-192.png',tag: data.id ? `propr-${data.id}` : undefined,renotify: false,data: {id: String(data.id||''),
deepLink,prUrl: safePrUrl(data.prUrl),apiBaseUrl: typeofdata.apiBaseUrl==='string' ? data.apiBaseUrl : '',},actions: [{action: 'view',title: 'View'},{action: 'dismiss',title: 'Dismiss'},],}),setBadge(data.unreadCount),]));});asyncfunctionfocusOrOpen(path){constwindows=awaitself.clients.matchAll({type: 'window',includeUncontrolled: true});constexisting=windows.find(client=>newURL(client.url).origin===self.location.origin);if(existing){awaitexisting.navigate(path);returnexisting.focus();}returnself.clients.openWindow(path);}self.addEventListener('notificationclick',event=>{event.notification.close();constdata=event.notification.data||{};if(event.action==='dismiss'){// Local dismissal is immediate. The app reconciles server receipt state on// its next foreground load if a cross-origin tunnel request is unavailable.event.waitUntil(focusOrOpen(`/inbox?intent=dismiss¬ification=${encodeURIComponent(data.id||'')}`));return;}consttarget=event.action==='open_pr'&&data.prUrl ? data.prUrl : safeAppPath(data.deepLink);event.waitUntil(focusOrOpen(target));});self.addEventListener('message',event=>{if(event.data?.type==='SKIP_WAITING')self.skipWaiting();if(event.data?.type==='SET_BADGE')event.waitUntil(setBadge(event.data.count));});
File: propr-ui/src/pwa/registerServiceWorker.ts (new file)
Why this file: Registration is isolated from React rendering and fails quietly on unsupported browsers or local test environments.
exportasyncfunctionregisterServiceWorker(): Promise<ServiceWorkerRegistration|null>{if(!('serviceWorker'innavigator)||import.meta.env.MODE==='test')returnnull;try{// Register after the page is usable so service-worker startup does not delay// authentication or the first dashboard render.returnawaitnavigator.serviceWorker.register('/sw.js',{scope: '/'});}catch(error){console.warn('[propr] Service worker registration failed',error);returnnull;}}
File: propr-ui/src/main.tsx
Why this file: The application entry point registers the worker once after page load.
--- a/propr-ui/src/main.tsx+++ b/propr-ui/src/main.tsx@@ -1,5 +1,6 @@+import { registerServiceWorker } from './pwa/registerServiceWorker';@@ -20,3 +21,8 @@+window.addEventListener('load', () => {+ // Registration is intentionally non-blocking; PWA support must not prevent+ // the normal web dashboard from starting.+ void registerServiceWorker();+});
Activity
propr-dev commentedon Aug 2, 2026
Suggested Implementation:
Implementation Approach
Use a hand-written service worker rather than a broad cache-first plugin preset. ProPR contains sensitive, rapidly changing operational data, so only versioned static assets and the navigation shell should be cached. Runtime API responses remain network-only. Notification action buttons are limited to View and Dismiss because destructive workflow actions require in-app confirmation and browser support for notification actions varies.
File:
propr-ui/public/manifest.webmanifest(new file)Why this file: The manifest supplies install metadata, standalone display behavior, icons, and shortcuts used by mobile launchers.
{ "id": "/", "name": "ProPR", "short_name": "ProPR", "description": "Review plans, monitor tasks, and act on pull requests from ProPR.", "start_url": "/inbox?source=pwa", "scope": "/", "display": "standalone", "background_color": "#ffffff", "theme_color": "#1d8a8a", "orientation": "any", "icons": [ { "src": "/icons/propr-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "/icons/propr-512.png", "sizes": "512x512", "type": "image/png" }, { "src": "/icons/propr-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" } ], "shortcuts": [ { "name": "Inbox", "url": "/inbox?source=shortcut", "icons": [{ "src": "/icons/propr-192.png", "sizes": "192x192" }] }, { "name": "New Plan", "url": "/studio/new?source=shortcut", "icons": [{ "src": "/icons/propr-192.png", "sizes": "192x192" }] } ] }File:
propr-ui/public/icons/propr-pwa-source.svg(new file)Why this file: Keep a reviewable vector source in the repository so committed PNG icons can be reproduced instead of becoming unexplained binary artifacts.
Binary assets to add
Why these files: iOS uses the Apple touch icon rather than relying solely on the manifest. Generate these from the SVG above using the repository's approved palette and commit the output so production builds need no image-generation dependency.
File:
propr-ui/index.htmlWhy this file: Safari reads several installation hints directly from HTML, and the manifest must be discoverable before React boots.
File:
propr-ui/public/sw.js(new file)Why this file: The service worker owns shell caching, push display, notification click routing, and background badge changes.
File:
propr-ui/src/pwa/registerServiceWorker.ts(new file)Why this file: Registration is isolated from React rendering and fails quietly on unsupported browsers or local test environments.
File:
propr-ui/src/main.tsxWhy this file: The application entry point registers the worker once after page load.
propr-dev commentedon Aug 24, 2026
🤖 AI processing has started for this issue using codex agent with gpt-5.6-sol model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
codexgpt-5.6-sol1721/gpt-5.6-sol-add-the-installable-pwa-s-20260824-1058-f1o1716-epic-failed-to-3m8issue-1721-20260824-1058-gpt-5.6-sol-f1o🔍 Track Task Execution
fix(ai): Resolve issue #1721 - Add the installable PWA shell, manifes…
fix(ai): Resolve issue #1721 - Add the installable PWA shell, manifes…
[Epic] PWA & Web push (#1731)