Offline mode
PlanningSup is a Progressive Web App (PWA) , which means you can install it on your device and use it offline. This is powered by a Service Worker that caches your calendar data and app assets.
Benefits of offline mode
No internet required View your cached calendar even in areas with poor connectivity
Instant loading The app loads from cache instead of the network
Native app experience Installed PWAs appear in your app drawer and taskbar
Automatic updates New versions install in the background when you’re online
Installing the PWA
On mobile (Android / iOS)
Android (Chrome / Edge)
iOS (Safari)
Tap the install prompt
A banner appears at the bottom: “Add PlanningSup to Home screen”
Confirm installation
Tap “Install” or “Add”
Launch the app
Find the PlanningSup icon in your app drawer
If the banner doesn’t appear, tap the menu (⋮) → “Add to Home screen” or “Install app” .
Tap the Share button
Tap the Share icon (square with arrow) in the bottom toolbar
Select 'Add to Home Screen'
Scroll down and tap “Add to Home Screen”
Confirm the name
Leave the name as “PlanningSup” and tap “Add”
Launch the app
Find the PlanningSup icon on your home screen
iOS Safari does not display an automatic install banner. You must use the Share menu.
On desktop (Windows / macOS / Linux)
Chrome / Edge
Safari (macOS)
Firefox
Click the install icon
Look for the install icon (⊕ or computer) in the address bar
Confirm installation
Click “Install” in the popup
Launch the app
PlanningSup opens in a standalone window without browser chrome
You can also go to Menu → Install PlanningSup or Apps → Install this site as an app .
Add to Dock
Go to File → Add to Dock
Launch the app
Click the PlanningSup icon in your Dock
Firefox does not support PWA installation on desktop. Use Chrome, Edge, or Safari instead, or access PlanningSup as a regular web page.
How offline mode works
PlanningSup uses a Service Worker to cache:
App shell : HTML, CSS, JavaScript, fonts, and images
Calendar data : Events fetched from the API (stored in IndexedDB)
User preferences : Settings, colors, and filters (stored in localStorage)
Service Worker registration
// apps/web/src/composables/usePwa.ts
import { useRegisterSW } from 'virtual:pwa-register/vue'
const { offlineReady , needRefresh , updateServiceWorker } = useRegisterSW ({
immediate: true ,
onRegisteredSW ( swUrl , r ) {
// Check for updates every hour
setInterval ( async () => {
if ( 'onLine' in navigator && ! navigator . onLine ) return
const resp = await fetch ( swUrl , { cache: 'no-store' })
if ( resp ?. status === 200 ) await r . update ()
}, 60 * 60 * 1000 ) // 1 hour
},
})
The Service Worker is configured in apps/web/vite.config.ts using vite-plugin-pwa .
Offline-first data strategy
When you load a planning, PlanningSup follows this strategy:
Check for cached data
If events are in IndexedDB (from a previous fetch), display them immediately
Fetch from network in background
PlanningSup tries to fetch fresh data from the API
Update the UI if newer data is available
If the network fetch succeeds and returns newer events, the calendar updates
Fall back to cache if offline
If the network request fails (e.g., no internet), the cached data remains visible
// apps/web/src/composables/usePlanningData.ts
// Phase 1: Fast database-only fetch (parallel)
if ( shouldHydrateFromDb ) {
const dbResults = await Promise . allSettled (
needsDbHydrationIds . map ( fullId =>
client . api . plannings ({ fullId }). get ({
query: { events: 'true' , onlyDb: 'true' },
}),
),
)
// Update UI immediately with DB data
}
// Phase 2: Network fetch (parallel, update UI as each completes)
for ( const fullId of fullIds ) {
client . api . plannings ({ fullId }). get ({
query: { events: 'true' },
}). then ( res => handleNetworkResult ( fullId , res ))
}
See apps/web/src/composables/usePlanningData.ts:181-357 for the full implementation.
Offline indicator
When you’re offline, PlanningSup displays a toast notification:
Hors connexion — Vous consultez des données mises en cache.
This appears automatically when:
The browser detects no network connection
A network request fails
The indicator disappears when connectivity is restored.
Update notifications
When a new version of PlanningSup is available, you’ll see a toast:
Nouvelle version disponible — Cliquez pour mettre à jour.
Click the toast to reload the app with the latest code.
// apps/web/src/composables/usePwa.ts
watch ( needRefresh , ( value ) => {
if ( value ) console . info ( '[PWA] Nouvelle version disponible (rechargement requis)' )
})
Updates install in the background and don’t interrupt your current session. The new version activates when you reload the page or close the app.
Clearing offline data
If you need to reset your offline cache:
Open browser settings
Go to Settings → Privacy → Site data (or similar)
Find planningsup.app
Search for “planningsup” in the list of sites
Clear site data
Delete cookies, cache, and IndexedDB data
Reload the app
Refresh the page to fetch fresh data
Alternatively, uninstall the PWA and reinstall it to start fresh.
Limitations of offline mode
Offline mode has some limitations:
No real-time updates : Cached events may be outdated if your schedule changes
Limited to cached plannings : Only plannings you’ve viewed while online are cached
Sign-in required for sync : Offline changes to settings do not sync until you’re online again
Checking offline status
PlanningSup uses the navigator.onLine API to detect connectivity:
import { useOnline } from '@vueuse/core'
const isOnline = useOnline ()
watch ( isOnline , ( online ) => {
if ( ! online ) {
// Show offline toast
} else {
// Hide offline toast and refresh data
}
})
The useOnline() composable from VueUse listens to online and offline events on the window object.
Next steps
Sync preferences Learn how to sync settings across devices
Browser extension Install the Chrome extension for quick access