feat: add export/import for study progress data#17
Open
fasuizu-br wants to merge 1 commit intosilvioprog:mainfrom
Open
feat: add export/import for study progress data#17fasuizu-br wants to merge 1 commit intosilvioprog:mainfrom
fasuizu-br wants to merge 1 commit intosilvioprog:mainfrom
Conversation
7 tasks
Allow users to download their study data as a JSON file and import it back, enabling backup and transfer between devices. Export serializes all studies with version metadata; import validates and replaces current data after user confirmation via dialog.
680557b to
6e6a10f
Compare
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.
Summary
Closes #16
englitune-backup-YYYY-MM-DD.json)Changes
New files
src/lib/studyDataUtils.ts— Pure functions for serialize/deserialize/download/readsrc/lib/studyDataUtils.test.ts— 12 tests (validation, round-trip, error cases)src/components/Insights/DataActions.tsx— Export/Import buttons with confirmation dialogModified files
src/hooks/useStudiesStorage.ts— Addedreplacefunction for importsrc/components/Insights/index.tsx— ThreadonImportfrom storage hooksrc/components/Insights/Tabs/index.tsx— PassonImportpropsrc/components/Insights/Tabs/Panels/index.tsx— PassonImportpropsrc/components/Insights/Tabs/Panels/Statistics.tsx— RenderDataActionsin stats tabTest plan
npm test— 26 tests)npm run build)