# pwa_features.py class PWAIntegration: """ Progressive Web App features for mobile enhancement """ @staticmethod def generate_manifest(): return { "name": "AI Research Assistant", "short_name": "ResearchAI", "description": "Academic AI assistant with transparent reasoning", "start_url": "/", "display": "standalone", "background_color": "#ffffff", "theme_color": "#3498db", "icons": [ { "src": "/icon-192x192.png", "sizes": "192x192", "type": "image/png" }, { "src": "/icon-512x512.png", "sizes": "512x512", "type": "image/png" } ], "categories": ["education", "productivity"], "lang": "en-US" } @staticmethod def get_service_worker_script(): return """ const CACHE_NAME = 'research-ai-v1'; const urlsToCache = [ '/', '/static/css/main.css', '/static/js/main.js' ]; self.addEventListener('install', (event) => { event.waitUntil( caches.open(CACHE_NAME) .then((cache) => cache.addAll(urlsToCache)) ); }); self.addEventListener('fetch', (event) => { event.respondWith( caches.match(event.request) .then((response) => response || fetch(event.request)) ); }); """ @staticmethod def get_pwa_html_integration(): """ Return HTML meta tags and link tags for PWA """ return """ """ @staticmethod def get_offline_fallback(): """ Return offline fallback HTML """ return """
You're currently offline. Please check your connection and try again.