Integrate IndieBackup for snapshot backup and restore

Adds a local ZIP backup/restore of the iCloud document tree via the
IndieBackup package, surfaced in Settings with retention controls. A
restore suspends the sync observer, mirrors the files, then rebuilds the
SwiftData cache; opening a shared .workoutsbackup file restores it. The
engine exposes the container Documents root and a restore lifecycle
(isRestoring guards a concurrent connect), and the backup file type is
registered for open-in-place.

Claude-Session: https://claude.ai/code/session_01HJDQQDA9QdP8zByg43H5v3
This commit is contained in:
2026-07-08 08:03:30 -04:00
parent df3eac9d5f
commit 653cc65e0e
7 changed files with 190 additions and 1 deletions
@@ -8,6 +8,7 @@
import SwiftUI
import SwiftData
import IndieAbout
import IndieBackup
struct SettingsView: View {
@Environment(SyncEngine.self) private var sync
@@ -132,6 +133,9 @@ struct SettingsView: View {
Text("iCloud Sync")
}
// MARK: - Backups Section
BackupsSectionView(controller: services.backupController)
// MARK: - Developer Section (debug builds only)
#if DEBUG
Section {