Add app icon asset, screenshot exporter, and misc updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-10 09:31:01 -06:00
parent bfef0a4472
commit 65460c63b3
12 changed files with 355 additions and 14 deletions

View File

@@ -27,6 +27,8 @@ struct SettingsContentView: View {
@State private var watchExportPath: URL?
@State private var isExportingInsights = false
@State private var insightsExportPath: URL?
@State private var isGeneratingScreenshots = false
@State private var sharingExportPath: URL?
@State private var isDeletingHealthKitData = false
@State private var healthKitDeleteResult: String?
@StateObject private var healthService = HealthService.shared
@@ -73,6 +75,7 @@ struct SettingsContentView: View {
exportVotingLayoutsButton
exportWatchViewsButton
exportInsightsButton
generateAndExportButton
deleteHealthKitDataButton
clearDataButton
@@ -654,6 +657,67 @@ struct SettingsContentView: View {
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
private var generateAndExportButton: some View {
ZStack {
theme.currentTheme.secondaryBGColor
Button {
isGeneratingScreenshots = true
Task {
DataController.shared.populate2YearsData()
sharingExportPath = await SharingScreenshotExporter.exportAllSharingScreenshots()
isGeneratingScreenshots = false
if let path = sharingExportPath {
print("📸 Sharing screenshots exported to: \(path.path)")
openInFilesApp(path)
}
}
} label: {
HStack(spacing: 12) {
if isGeneratingScreenshots {
ProgressView()
.frame(width: 32)
} else {
Image(systemName: "photo.on.rectangle.angled")
.font(.title2)
.foregroundStyle(
LinearGradient(
colors: [.green, .blue],
startPoint: .leading,
endPoint: .trailing
)
)
.frame(width: 32)
}
VStack(alignment: .leading, spacing: 2) {
Text("Generate & Export Sharing")
.foregroundColor(textColor)
if let path = sharingExportPath {
Text("Saved to Documents/SharingExports")
.font(.caption)
.foregroundColor(.green)
} else {
Text("Fill 2 years data + export PNGs")
.font(.caption)
.foregroundStyle(.secondary)
}
}
Spacer()
Image(systemName: "arrow.down.doc.fill")
.font(.caption)
.foregroundStyle(.tertiary)
}
.padding()
}
.disabled(isGeneratingScreenshots)
}
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
private var deleteHealthKitDataButton: some View {
ZStack {
theme.currentTheme.secondaryBGColor