1.0.0 for iOS is ready to ship

This commit is contained in:
2025-09-14 23:07:32 -06:00
parent 61384623bd
commit ff9f0d6cc6
33 changed files with 2646 additions and 251 deletions

View File

@@ -1,9 +1,3 @@
//
// SettingsView.swift
// OpenClimb
//
// Created by OpenClimb on 2025-01-17.
//
import SwiftUI
import UniformTypeIdentifiers
@@ -23,6 +17,8 @@ struct SettingsView: View {
activeSheet: $activeSheet
)
ImageStorageSection()
AppInfoSection()
}
.navigationTitle("Settings")
@@ -130,6 +126,96 @@ struct DataManagementSection: View {
}
}
struct ImageStorageSection: View {
@EnvironmentObject var dataManager: ClimbingDataManager
@State private var showingStorageInfo = false
@State private var storageInfo = ""
@State private var showingRecoveryAlert = false
@State private var showingEmergencyAlert = false
var body: some View {
Section("Image Storage") {
// Storage Status
Button(action: {
storageInfo = dataManager.getImageRecoveryStatus()
showingStorageInfo = true
}) {
HStack {
Image(systemName: "info.circle")
.foregroundColor(.blue)
Text("Check Storage Health")
Spacer()
}
}
.foregroundColor(.primary)
// Manual Maintenance
Button(action: {
dataManager.manualImageMaintenance()
}) {
HStack {
Image(systemName: "wrench.and.screwdriver")
.foregroundColor(.orange)
Text("Run Maintenance")
Spacer()
}
}
.foregroundColor(.primary)
// Force Recovery
Button(action: {
showingRecoveryAlert = true
}) {
HStack {
Image(systemName: "arrow.clockwise")
.foregroundColor(.orange)
Text("Force Image Recovery")
Spacer()
}
}
.foregroundColor(.primary)
// Emergency Restore
Button(action: {
showingEmergencyAlert = true
}) {
HStack {
Image(systemName: "exclamationmark.triangle")
.foregroundColor(.red)
Text("Emergency Restore")
Spacer()
}
}
.foregroundColor(.red)
}
.alert("Storage Information", isPresented: $showingStorageInfo) {
Button("OK") {}
} message: {
Text(storageInfo)
}
.alert("Force Image Recovery", isPresented: $showingRecoveryAlert) {
Button("Cancel", role: .cancel) {}
Button("Force Recovery", role: .destructive) {
dataManager.forceImageRecovery()
}
} message: {
Text(
"This will attempt to recover missing images from backups and legacy locations. Use this if images are missing after app updates or debug sessions."
)
}
.alert("Emergency Restore", isPresented: $showingEmergencyAlert) {
Button("Cancel", role: .cancel) {}
Button("Emergency Restore", role: .destructive) {
dataManager.emergencyImageRestore()
}
} message: {
Text(
"This will restore all images from the backup directory, potentially overwriting current images. Only use this if normal recovery fails."
)
}
}
}
struct AppInfoSection: View {
private var appVersion: String {
Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"