Files
notes/Notes/Views/Settings/SettingsView.swift
T
rzen cf8616107b Add IndieAbout + IndieBackup, TestFlight release pipeline
IndieAbout: About section in iOS Settings and macOS About window; LICENSE
switched to the portfolio-standard ISC text (reflowed for in-app rendering).

IndieBackup: files-only backup/restore of the iCloud container documents
('.notesbackup' document type on both platforms), SwiftData cache rebuilt
via SyncEngine.rebuildCache() after restore, monitors suspended during the
file swap, onOpenURL import with pre-launch queueing.

Release pipeline: Scripts/release.sh (ios|mac|all) archives and uploads via
xcodebuild + ASC API key; platform-partitioned build numbers (iOS even,
macOS odd) since both targets share one bundle ID and build sequence.
2026-07-14 20:50:06 -04:00

71 lines
2.8 KiB
Swift

import IndieAbout
import IndieBackup
import SwiftUI
struct SettingsView: View {
@Environment(SyncEngine.self) private var syncEngine
@Environment(ContextService.self) private var contextService
@EnvironmentObject private var backupController: BackupController
var body: some View {
NavigationStack {
Form {
Section("iCloud") {
HStack {
Text("Status")
Spacer()
switch syncEngine.iCloudStatus {
case .checking:
Text("Checking…").foregroundStyle(.secondary)
case .available:
Label("Connected", systemImage: "checkmark.icloud")
.foregroundStyle(.green)
case .unavailable:
Label("Unavailable", systemImage: "xmark.icloud")
.foregroundStyle(.red)
}
}
if let error = syncEngine.lastSyncError {
Text(error)
.font(.footnote)
.foregroundStyle(.red)
}
Button("Rebuild Local Cache") {
Task { await syncEngine.rebuildCache() }
}
.disabled(syncEngine.iCloudStatus != .available || syncEngine.isSyncing)
}
Section("Context") {
ContextSummaryRow(
context: contextService.current,
isRefreshing: contextService.isRefreshing
)
if contextService.authorizationDenied {
Text("Location access is off. Notes can still be taken, but they won't resurface by place. Enable location for Notes in Settings.")
.font(.footnote)
.foregroundStyle(.secondary)
}
Button("Refresh Context") {
Task { await contextService.refresh() }
}
.disabled(contextService.isRefreshing)
}
BackupsSectionView(controller: backupController)
Section {
IndieAbout(configuration: .init(
documents: [
.license(filename: "LICENSE", extension: "md"),
.custom(title: "Changelog", filename: "CHANGELOG", extension: "md")
]
))
}
}
.formStyle(.grouped)
.navigationTitle("Settings")
}
}
}