mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 19:05:03 +00:00
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:
49
Yattee/Views/ICloudSyncProgressView.swift
Normal file
49
Yattee/Views/ICloudSyncProgressView.swift
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user