Check the CloudKit schema when packaging and show broken iCloud sync

This commit is contained in:
Ian Gulliver
2026-10-20 08:55:37 -07:00
parent e7724977c8
commit 8f3226350e
14 changed files with 502 additions and 288 deletions
+22
View File
@@ -49,6 +49,8 @@ struct SettingsView: View {
try await store.api.client.updateReviewModels(body: .json(.init(reviewModel: me.reviewModel, secondReviewModel: m))).ok.body.json
}
}
heading("iCloud sync")
SyncState()
heading("This Mac's permissions")
Text("The macOS privacy grants byre's app needs for agents to see and control this Mac. Checking asks macOS for any that are missing.")
.foregroundStyle(Palette.muted)
@@ -97,6 +99,26 @@ private struct ServerColorPicker: View {
}
}
private struct SyncState: View {
var body: some View {
TimelineView(.periodic(from: .now, by: 30)) { _ in
if let sync = Servers.shared.sync {
if sync.ok {
Text("This Mac shares its servers, window colours, drafts and task visits through iCloud. Last synced \(ago(sync.at)).")
.fixedSize(horizontal: false, vertical: true)
} else {
Text("iCloud sync is failing on this Mac, so changes made here aren't reaching your other Macs. Failed \(ago(sync.at)): \(sync.error ?? "")")
.foregroundStyle(Palette.danger)
.textSelection(.enabled)
.fixedSize(horizontal: false, vertical: true)
}
} else {
Text("No iCloud sync has finished since byre started.").foregroundStyle(Palette.muted)
}
}
}
}
private struct DeviceNotifications: View {
@ViewState private var status: UNAuthorizationStatus?
@ViewState private var asking = false