Fix build errors, resolve all warnings, and improve code quality
Widget Extension Fixes: - Create standalone WidgetDataProvider for widget data isolation - Add WIDGET_EXTENSION compiler flag for conditional compilation - Fix DataController references in widget-shared files - Sync widget version numbers with main app (23, 1.0.2) - Add WidgetBackground color to asset catalog Warning Resolutions: - Fix UIScreen.main deprecation in BGView and SharingListView - Fix Text '+' concatenation deprecation in PurchaseButtonView and SettingsTabView - Fix exhaustive switch in BiometricAuthManager (add .none case) - Fix var to let in ExportService (3 instances) - Fix unused result warning in NoteEditorView - Fix ForEach duplicate ID warnings in MonthView and YearView Code Quality Improvements: - Wrap bypassSubscription in #if DEBUG for security - Rename StupidAssCustomWidgetObservableObject to CustomWidgetStateViewModel - Add @MainActor to IconViewModel - Replace fatalError with graceful fallback in SharedModelContainer - Add [weak self] to closures in DayViewViewModel - Add OSLog-based AppLogger for production logging - Add ImageCache with NSCache for memory efficiency - Add AccessibilityHelpers with Reduce Motion support - Create DataControllerProtocol for dependency injection - Update .gitignore with secrets exclusions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,7 @@ struct YearView: View {
|
||||
@EnvironmentObject var iapManager: IAPManager
|
||||
@StateObject public var viewModel: YearViewModel
|
||||
@StateObject private var filteredDays = DaysFilterClass.shared
|
||||
@StateObject private var shareImage = StupidAssShareObservableObject()
|
||||
@StateObject private var shareImage = ShareImageStateViewModel()
|
||||
@State private var trialWarningHidden = false
|
||||
@State private var showSubscriptionStore = false
|
||||
|
||||
@@ -49,8 +49,8 @@ struct YearView: View {
|
||||
theme: theme,
|
||||
filteredDays: filteredDays.currentFilters,
|
||||
onShare: { image in
|
||||
shareImage.fuckingWrappedShrable = image
|
||||
shareImage.showFuckingSheet = true
|
||||
shareImage.selectedShareImage = image
|
||||
shareImage.showSheet = true
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -100,8 +100,8 @@ struct YearView: View {
|
||||
.sheet(isPresented: $showSubscriptionStore) {
|
||||
FeelsSubscriptionStoreView()
|
||||
}
|
||||
.sheet(isPresented: $shareImage.showFuckingSheet) {
|
||||
if let uiImage = shareImage.fuckingWrappedShrable {
|
||||
.sheet(isPresented: $shareImage.showSheet) {
|
||||
if let uiImage = shareImage.selectedShareImage {
|
||||
ImageOnlyShareSheet(photo: uiImage)
|
||||
}
|
||||
}
|
||||
@@ -340,8 +340,8 @@ struct YearCard: View {
|
||||
|
||||
// Month Labels
|
||||
HStack(spacing: 2) {
|
||||
ForEach(months, id: \.self) { month in
|
||||
Text(month)
|
||||
ForEach(months.indices, id: \.self) { index in
|
||||
Text(months[index])
|
||||
.font(.system(size: 9, weight: .medium))
|
||||
.foregroundColor(textColor.opacity(0.5))
|
||||
.frame(maxWidth: .infinity)
|
||||
@@ -419,6 +419,19 @@ struct YearHeatmapCell: View {
|
||||
RoundedRectangle(cornerRadius: 2)
|
||||
.fill(cellColor)
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.accessibilityLabel(accessibilityDescription)
|
||||
}
|
||||
|
||||
private var accessibilityDescription: String {
|
||||
if !isFiltered {
|
||||
return "Filtered out"
|
||||
} else if color == Mood.placeholder.color {
|
||||
return "Empty"
|
||||
} else if color == Mood.missing.color {
|
||||
return "No mood logged"
|
||||
} else {
|
||||
return "Mood entry"
|
||||
}
|
||||
}
|
||||
|
||||
private var cellColor: Color {
|
||||
|
||||
Reference in New Issue
Block a user