fitness: add offline support with session queue and shell caching

Cache fitness page shells and data routes in the service worker so
pages load offline. Queue finished workouts in IndexedDB when the
POST fails and auto-flush them on reconnect. Show an offline banner
on the completion screen so the user knows their workout will sync.
This commit is contained in:
2026-03-23 22:15:40 +01:00
parent 90d38d806d
commit 19ac60c6f2
5 changed files with 125 additions and 6 deletions
+2
View File
@@ -128,6 +128,7 @@ const translations: Translations = {
// Active workout / completion
workout_complete: { en: 'Workout Complete', de: 'Training abgeschlossen' },
workout_saved_offline: { en: 'Saved offline — will sync when back online.', de: 'Offline gespeichert — wird bei Verbindung synchronisiert.' },
duration: { en: 'Duration', de: 'Dauer' },
tonnage: { en: 'Tonnage', de: 'Tonnage' },
distance: { en: 'Distance', de: 'Distanz' },
@@ -139,6 +140,7 @@ const translations: Translations = {
template_diff_desc: { en: 'Your weights or reps differ from the template:', de: 'Gewichte oder Wiederholungen weichen von der Vorlage ab:' },
updating: { en: 'Updating...', de: 'Aktualisieren...' },
view_workout: { en: 'VIEW WORKOUT', de: 'TRAINING ANSEHEN' },
done: { en: 'DONE', de: 'FERTIG' },
workout_name_placeholder: { en: 'Workout name', de: 'Trainingsname' },
cancel_workout: { en: 'CANCEL WORKOUT', de: 'TRAINING ABBRECHEN' },
finish: { en: 'FINISH', de: 'BEENDEN' },