From 129d7fe6f4a86693c57056e3fa6d49f0cd2a5839 Mon Sep 17 00:00:00 2001 From: Dorian Date: Wed, 18 Feb 2026 13:48:45 +0000 Subject: [PATCH] Enhance PWA support with new install prompt and configuration updates - Added PWAInstallPrompt component to facilitate app installation beyond the "Add to Home Screen" option. - Updated vite.config.ts to include display_override and id properties for improved PWA manifest. - Modified nginx configuration to ensure proper serving of the manifest with application/manifest+json type for better installability on Android. --- neode-ui/src/App.vue | 4 + neode-ui/src/components/PWAInstallPrompt.vue | 91 ++++++++++++++++++++ neode-ui/vite.config.ts | 2 + scripts/nginx-pwa-snippet.conf | 7 +- 4 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 neode-ui/src/components/PWAInstallPrompt.vue diff --git a/neode-ui/src/App.vue b/neode-ui/src/App.vue index 56bf8eb0..0c56aae4 100644 --- a/neode-ui/src/App.vue +++ b/neode-ui/src/App.vue @@ -30,6 +30,9 @@ + + + @@ -61,6 +64,7 @@ import { ref, onMounted, onBeforeUnmount, watch } from 'vue' import { useRouter, useRoute } from 'vue-router' import SplashScreen from './components/SplashScreen.vue' import PWAUpdatePrompt from './components/PWAUpdatePrompt.vue' +import PWAInstallPrompt from './components/PWAInstallPrompt.vue' import SpotlightSearch from './components/SpotlightSearch.vue' import CLIPopup from './components/CLIPopup.vue' import AppLauncherOverlay from './components/AppLauncherOverlay.vue' diff --git a/neode-ui/src/components/PWAInstallPrompt.vue b/neode-ui/src/components/PWAInstallPrompt.vue new file mode 100644 index 00000000..34d30f84 --- /dev/null +++ b/neode-ui/src/components/PWAInstallPrompt.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/neode-ui/vite.config.ts b/neode-ui/vite.config.ts index a34f640d..08b893f7 100644 --- a/neode-ui/vite.config.ts +++ b/neode-ui/vite.config.ts @@ -17,9 +17,11 @@ export default defineConfig({ theme_color: '#000000', background_color: '#000000', display: 'standalone', + display_override: ['standalone', 'minimal-ui'], orientation: 'any', scope: '/', start_url: '/', + id: '/', categories: ['productivity', 'utilities'], prefer_related_applications: false, icons: [ diff --git a/scripts/nginx-pwa-snippet.conf b/scripts/nginx-pwa-snippet.conf index 3cb29d47..66b81f1d 100644 --- a/scripts/nginx-pwa-snippet.conf +++ b/scripts/nginx-pwa-snippet.conf @@ -1,8 +1,7 @@ -# PWA installability - required for Add to Home Screen on Android -# Include this inside the HTTPS server block for archipelago -# Manifest must have Content-Type: application/manifest+json +# PWA installability - required for Install (not just Add to Home Screen) on Android +# Manifest MUST be served with application/manifest+json - Chrome rejects otherwise location = /manifest.webmanifest { - add_header Content-Type application/manifest+json; + default_type application/manifest+json; add_header Cache-Control "public, max-age=0, must-revalidate"; } # Service worker - no cache so updates apply