feat: Multiple Features, Accessibility, Security, and UX Improvements #59

Merged
naomi merged 27 commits from feat/polish into main 2026-02-20 01:51:25 -08:00
Showing only changes of commit e1fbbd4d7c - Show all commits
+5 -5
View File
@@ -11,11 +11,6 @@ const IMAGE_CACHE = `${CACHE_VERSION}-images`;
// Static assets to cache on install // Static assets to cache on install
const STATIC_ASSETS = [ const STATIC_ASSETS = [
'/',
'/index.html',
'/main.js',
'/runtime.js',
'/styles.css',
'/offline.html' '/offline.html'
]; ];
@@ -27,6 +22,8 @@ self.addEventListener('install', (event) => {
console.log('[Service Worker] Caching static assets'); console.log('[Service Worker] Caching static assets');
return cache.addAll(STATIC_ASSETS).catch((err) => { return cache.addAll(STATIC_ASSETS).catch((err) => {
console.error('[Service Worker] Failed to cache static assets:', err); console.error('[Service Worker] Failed to cache static assets:', err);
// Don't fail installation if caching fails
return Promise.resolve();
}); });
}).then(() => { }).then(() => {
return self.skipWaiting(); return self.skipWaiting();
@@ -137,10 +134,13 @@ self.addEventListener('fetch', (event) => {
event.respondWith( event.respondWith(
fetch(request) fetch(request)
.then((response) => { .then((response) => {
// Only cache successful responses
if (response.ok) {
const responseClone = response.clone(); const responseClone = response.clone();
caches.open(DYNAMIC_CACHE).then((cache) => { caches.open(DYNAMIC_CACHE).then((cache) => {
cache.put(request, responseClone); cache.put(request, responseClone);
}); });
}
return response; return response;
}) })
.catch(() => { .catch(() => {