feat(save): add local auto-backup snapshots, corruption recovery, and restore UI - #330
Open
KillianHzr wants to merge 3 commits into
Open
KillianHzr wants to merge 3 commits into
KillianHzr wants to merge 3 commits into
Conversation
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
This PR introduces an automated local snapshot backup and recovery mechanism for
CompanionStatewithout modifying the core state schema or depending on external cloud providers.Key enhancements:
<stateDir>/snapshots/at an interval of at least 12 hours during regular play and saves. Retains the newest 10 snapshots automatically and prunes older ones.companion-state.jsonis corrupted or fails to decode at startup, the app preserves the corrupted file as.corruptand automatically restores from the latest valid snapshot instead of starting from a blank state.Backup & Transfergroup:Localization.swiftacross all 7 supported languages (ko,en,ja,es,fr,pt,de), without Hangul string literals in UI sources.CompanionStatestored properties remain unmodified, strictly preservingSaveTransferTestsfield classification.Type of change
UI changes
Backup & Transfersection only provided manual "Export save" and "Import save" buttons requiring manual JSON file management via system file dialogs.Backup & Transfersection now includes an "Automatic Backups (Snapshots)" panel with a "Create snapshot" button and a scrollable list of recent restore points showing companion thumbnails, timestamp, Pokédex count, token count, and a 1-click "Restore" button with safety confirmation.Checklist
swift buildandswift testpass locally