feat: move offline indicator to header, rename to Offline-Modus, and redesign tasting form

This commit is contained in:
2025-12-21 00:13:33 +01:00
parent 74a10b193c
commit 716afce2ae
7 changed files with 148 additions and 122 deletions

View File

@@ -62,16 +62,17 @@ A critical feature is the ability to link tasting notes to a bottle that hasn't
## 📱 PWA Features
### Service Worker (`public/sw.js`) - "Bunker v7 + SWR"
### Service Worker (`public/sw.js`) - "Offline-Modus v10 + SWR"
The Service Worker implements a robust "Cache-First, Network-Background" strategy:
- **Pre-Caching**: The landing page (`/`) and core static assets are cached individually during installation to prevent total failure on single-file 404s.
- **Pre-Caching**: The landing page (`/`) and core static assets are cached individually (sequentially) during installation to prevent total failure on single-file 404s.
- **Manifest Path**: Corrected to `/manifest.webmanifest` to match Next.js defaults.
- **SWR Navigation & Assets**: Both load instantly from cache. Updates happen in the background via `fetchWithTimeout` and `AbortController`.
- **Universal Root Fallback**: Deep links (like `/bottles/[id]`) fallback to `/` if not cached, allowing Next.js to take over.
- **Network Stability**: Added a 2-second stabilization delay in `UploadQueue.tsx` before background sync starts after a network change.
- **RSC Data Resiliency**: Requests to `/_next/data/` return an empty JSON object if they fail.
- **Stale-While-Revalidate**: Applied to static assets to ensure immediate UI response.
- **Indicator**: Located in the application header for constant status visibility.
- **Offline-Modus**: Formerly called "Bunker", this system ensures all core assets are ready for a zero-connectivity environment.
### Manifest (`src/app/manifest.ts`)
Defines the app's appearance when installed: