Backup bows out of the phone — the zipped-share future replaces it, later
IndieBackup comes out whole: the package, the Backup directory, the Settings section, the .kanbanbackup document type and its onOpenURL restore path. Settings is now the About section alone. The Files-app keys stay — they serve local-board visibility, not backups. Board sharing as a zipped archive is the planned replacement and is deliberately not started here. Claude-Session: https://claude.ai/code/session_01SR4XGjmBE16ZUYWpfFHXwY
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import SwiftUI
|
||||
import IndieBackup
|
||||
import os
|
||||
|
||||
/// The iPhone app's entry point. Two tabs, per the mobile MVP charter: Boards (the whole
|
||||
/// board → lane → card navigation stack) and Settings (backup/restore).
|
||||
/// board → lane → card navigation stack) and Settings.
|
||||
@main
|
||||
struct MobileApp: App {
|
||||
|
||||
@@ -13,40 +11,10 @@ struct MobileApp: App {
|
||||
/// constructing one.
|
||||
@State private var boardIndex = BoardIndexStore()
|
||||
|
||||
/// Backup/restore (indie-backup skill), built once `boardIndex.home` resolves to a real
|
||||
/// `CloudHome` — see `MobileBackupConfiguration`'s doc comment for why this can't happen at
|
||||
/// `@State` init time. Stays `nil` for the lifetime of a run with no iCloud account;
|
||||
/// `SettingsTabView` renders the quiet disabled state for exactly that case.
|
||||
@State private var backupController: BackupController?
|
||||
|
||||
private static let logger = Logger(subsystem: "dev.rzen.indie.KanbanMobile", category: "backup")
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
RootTabView()
|
||||
.environment(boardIndex)
|
||||
.environment(\.backupController, backupController)
|
||||
.task(id: boardIndex.home) {
|
||||
guard backupController == nil, let home = boardIndex.home else { return }
|
||||
backupController = BackupController(
|
||||
configuration: MobileBackupConfiguration(root: home.documentsURL, index: boardIndex)
|
||||
)
|
||||
}
|
||||
.onOpenURL { url in
|
||||
// A backup file opened from Files, AirDrop, or a share sheet. Silently
|
||||
// ignored before `backupController` exists — there is no resolved cloud home
|
||||
// to restore into either, at that point.
|
||||
guard url.pathExtension == MobileBackupConfiguration.fileExtension,
|
||||
let backupController
|
||||
else { return }
|
||||
Task {
|
||||
do {
|
||||
try await backupController.restoreBackup(from: url)
|
||||
} catch {
|
||||
Self.logger.error("restore from opened file failed: \(error.localizedDescription, privacy: .public)")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user