Add data export/import/clear to prevent localStorage data loss#1
Open
Add data export/import/clear to prevent localStorage data loss#1
Conversation
Co-authored-by: LetsLearntocodeforfun <216424165+LetsLearntocodeforfun@users.noreply.github.com>
Co-authored-by: LetsLearntocodeforfun <216424165+LetsLearntocodeforfun@users.noreply.github.com>
Co-authored-by: LetsLearntocodeforfun <216424165+LetsLearntocodeforfun@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add data management section to settings page
Add data export/import/clear to prevent localStorage data loss
Feb 16, 2026
Owner
LetsLearntocodeforfun
left a comment
There was a problem hiding this comment.
woking on a data export feature to save data locally across devices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Apollo training data lives in
localStoragewith no backup mechanism. Users lose months of progress if localStorage clears (browser reset, device switch, bugs).Changes
Service Layer (
src/services/dataManager.ts)New data management service with:
exportAllData()- Collects allapollo_*prefixed keys + credential keys (strava_*,garmin_*)importAllData()- Validates backup structure before restoreclearAllData()- Removes all Apollo localStorage entriesdownloadJson()- Browser download via Blob + object URLgenerateBackupFilename()- Timestamped filenames (apollo-backup-YYYY-MM-DD-HHMMSS.json) prevent collisionsBackup format includes metadata wrapper:
{ "metadata": { "exportDate": "2026-02-16T09:36:32.169Z", "appName": "Apollo Running", "version": "1.0", "keyCount": 4 }, "data": { "apollo_race_prediction": "{...}", "apollo_coaching_prefs": "{...}", "strava_tokens": "{...}" } }Settings UI (
src/pages/Settings.tsx)Added Data Management section with orange accent border:
All operations reload the page after completion to ensure fresh app state.
Screenshots
Data Management Section
Success Message
Captured Data
Exports all training-related localStorage:
Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Continue Tasks: ✅ 3 no changes — View all