feat(ui): redesign voice cockpit with clinical companion drawer, Svelte 5 migration, and Gemini 3.8 voice
- Re-architect VoiceSession into full-bleed studio cockpit with overlay slide-over companion drawer - Eliminate width squishing defect on LiveInsightPanel and add native dark/light theme support - Integrate authentic Google Gemini 3.8 Flash TTS with Fenrir persona and fallback audio pipeline - Implement comprehensive Playwright E2E visual regression suite across Desktop, iPad, and iPhone (21 tests, 45 snapshots) - Migrate core application to Svelte 5 runes (, , ) with reactive stores - Maintain .NET 8 Azure Functions serverless endpoints and clean build hygiene
This commit is contained in:
1 parent
c82b112624
commit
1feea40684
148 files changed
+11230
-1706
No files matched your search
@@ -3,29 +3,72 @@ declare const self: ServiceWorkerGlobalScope;
|
||||
|
||||
import { clientsClaim } from 'workbox-core';
|
||||
import { cleanupOutdatedCaches, precacheAndRoute } from 'workbox-precaching';
|
||||
import { registerRoute } from 'workbox-routing';
|
||||
import { StaleWhileRevalidate, CacheFirst, NetworkFirst } from 'workbox-strategies';
|
||||
import { ExpirationPlugin } from 'workbox-expiration';
|
||||
import { CacheableResponsePlugin } from 'workbox-cacheable-response';
|
||||
|
||||
// Bump this version to force SW update - changes to this constant change the SW file hash
|
||||
const CACHE_VERSION = '2026-03-06-v1';
|
||||
|
||||
// @ts-ignore - __WB_MANIFEST is injected at build time by vite-plugin-pwa
|
||||
// Precache all assets generated by Vite build
|
||||
precacheAndRoute(self.__WB_MANIFEST);
|
||||
|
||||
cleanupOutdatedCaches();
|
||||
|
||||
// Cache Google Fonts stylesheets
|
||||
registerRoute(
|
||||
({ url }) => url.origin === 'https://fonts.googleapis.com',
|
||||
new StaleWhileRevalidate({
|
||||
cacheName: 'google-fonts-stylesheets',
|
||||
})
|
||||
);
|
||||
|
||||
// Cache Google Fonts webfont files with 1-year expiration
|
||||
registerRoute(
|
||||
({ url }) => url.origin === 'https://fonts.gstatic.com',
|
||||
new CacheFirst({
|
||||
cacheName: 'google-fonts-webfonts',
|
||||
plugins: [
|
||||
new CacheableResponsePlugin({
|
||||
statuses: [0, 200],
|
||||
}),
|
||||
new ExpirationPlugin({
|
||||
maxAgeSeconds: 60 * 60 * 24 * 365,
|
||||
maxEntries: 30,
|
||||
}),
|
||||
],
|
||||
})
|
||||
);
|
||||
|
||||
// Cache static images and icons
|
||||
registerRoute(
|
||||
({ request }) => request.destination === 'image',
|
||||
new CacheFirst({
|
||||
cacheName: 'images-cache',
|
||||
plugins: [
|
||||
new CacheableResponsePlugin({
|
||||
statuses: [0, 200],
|
||||
}),
|
||||
new ExpirationPlugin({
|
||||
maxEntries: 60,
|
||||
maxAgeSeconds: 30 * 24 * 60 * 60, // 30 Days
|
||||
}),
|
||||
],
|
||||
})
|
||||
);
|
||||
|
||||
// Force immediate activation of new SW
|
||||
self.addEventListener('install', () => {
|
||||
console.log('[SW] Installing, skipping waiting...');
|
||||
self.skipWaiting();
|
||||
console.log('[SW] Installing Cognitive Clarity PWA Service Worker...');
|
||||
self.skipWaiting();
|
||||
});
|
||||
|
||||
self.addEventListener('activate', () => {
|
||||
console.log('[SW] Activating, claiming clients...');
|
||||
clientsClaim();
|
||||
console.log('[SW] Activating Cognitive Clarity PWA Service Worker...');
|
||||
clientsClaim();
|
||||
});
|
||||
|
||||
// Handle SKIP_WAITING message from client
|
||||
// Handle explicit SKIP_WAITING message from client UI
|
||||
self.addEventListener('message', (event) => {
|
||||
if (event.data?.type === 'SKIP_WAITING') {
|
||||
self.skipWaiting();
|
||||
}
|
||||
if (event.data?.type === 'SKIP_WAITING') {
|
||||
self.skipWaiting();
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user