Replace onboarding flow with silent v1 import and iCloud alert

Delete the multi-page onboarding sheet. On first launch the app now
silently imports any v1 instances from UserDefaults (splitting embedded
basic-auth credentials out of the URL and into the Keychain) and then,
if the device is signed in to iCloud, shows a single alert offering to
enable sync. Accepting shows a blocking progress overlay until the
initial upload completes.
This commit is contained in:
Arkadiusz Fal
2026-04-17 21:05:44 +02:00
parent 55f27e7f54
commit 2761fcbcfb
13 changed files with 200 additions and 1116 deletions

View File

@@ -0,0 +1,49 @@
//
// ICloudSyncProgressView.swift
// Yattee
//
// Blocking progress overlay shown during the first-launch iCloud sync.
//
import SwiftUI
struct ICloudSyncProgressView: View {
@Environment(\.appEnvironment) private var appEnvironment
private var cloudKitSync: CloudKitSyncEngine? { appEnvironment?.cloudKitSync }
var body: some View {
VStack(spacing: 24) {
ProgressView()
.controlSize(.large)
Text(String(localized: "onboarding.cloud.syncing.title"))
.font(.title2)
.fontWeight(.semibold)
Text(progressText)
.font(.subheadline)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
.frame(maxWidth: 400)
}
.padding(40)
.frame(maxWidth: .infinity, maxHeight: .infinity)
#if os(macOS)
.frame(minWidth: 420, minHeight: 260)
#endif
.interactiveDismissDisabled()
}
private var progressText: String {
if let upload = cloudKitSync?.uploadProgress {
return upload.displayText
}
return String(localized: "onboarding.cloud.syncing.preparing")
}
}
#Preview {
ICloudSyncProgressView()
.appEnvironment(.preview)
}