v1.1 polish: accessibility, error logging, localization, and code quality sweep
- Wrap 30+ production print() statements in #if DEBUG guards across 18 files - Add VoiceOver labels, hints, and traits to Watch app, Live Activities, widgets - Add .accessibilityAddTraits(.isButton) to 15+ onTapGesture views - Add text alternatives for color-only indicators (progress dots, mood circles) - Localize raw string literals in NoteEditorView, EntryDetailView, widgets - Replace 25+ silent try? with do/catch + AppLogger error logging - Replace hardcoded font sizes with semantic Dynamic Type fonts - Fix FIXME in IconPickerView (log icon change errors) - Extract magic animation delays to named constants across 8 files - Add widget empty state "Log your first mood!" messaging - Hide decorative images from VoiceOver, add labels to ColorPickers - Remove stale TODO in Color+Codable (alpha change deferred for migration) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,9 +24,12 @@ struct MoodStreakLiveActivity: Widget {
|
||||
HStack(spacing: 8) {
|
||||
Image(systemName: "flame.fill")
|
||||
.foregroundColor(.orange)
|
||||
.accessibilityHidden(true)
|
||||
Text("\(context.state.currentStreak)")
|
||||
.font(.title2.bold())
|
||||
}
|
||||
.accessibilityElement(children: .combine)
|
||||
.accessibilityLabel(String(localized: "\(context.state.currentStreak) day streak"))
|
||||
}
|
||||
|
||||
DynamicIslandExpandedRegion(.trailing) {
|
||||
@@ -34,6 +37,7 @@ struct MoodStreakLiveActivity: Widget {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.green)
|
||||
.font(.title2)
|
||||
.accessibilityLabel(String(localized: "Mood logged today"))
|
||||
} else {
|
||||
Text("Log now")
|
||||
.font(.caption)
|
||||
@@ -56,20 +60,25 @@ struct MoodStreakLiveActivity: Widget {
|
||||
Circle()
|
||||
.fill(Color(hex: context.state.lastMoodColor))
|
||||
.frame(width: 20, height: 20)
|
||||
.accessibilityHidden(true)
|
||||
Text("Today: \(context.state.lastMoodLogged)")
|
||||
.font(.subheadline)
|
||||
}
|
||||
.accessibilityElement(children: .combine)
|
||||
}
|
||||
}
|
||||
} compactLeading: {
|
||||
Image(systemName: "flame.fill")
|
||||
.foregroundColor(.orange)
|
||||
.accessibilityLabel(String(localized: "Streak"))
|
||||
} compactTrailing: {
|
||||
Text("\(context.state.currentStreak)")
|
||||
.font(.caption.bold())
|
||||
.accessibilityLabel(String(localized: "\(context.state.currentStreak) days"))
|
||||
} minimal: {
|
||||
Image(systemName: "flame.fill")
|
||||
.foregroundColor(.orange)
|
||||
.accessibilityLabel(String(localized: "Mood streak"))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,12 +96,15 @@ struct MoodStreakLockScreenView: View {
|
||||
Image(systemName: "flame.fill")
|
||||
.font(.title)
|
||||
.foregroundColor(.orange)
|
||||
.accessibilityHidden(true)
|
||||
Text("\(context.state.currentStreak)")
|
||||
.font(.title.bold())
|
||||
Text("day streak")
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
.accessibilityElement(children: .combine)
|
||||
.accessibilityLabel(String(localized: "\(context.state.currentStreak) day streak"))
|
||||
|
||||
Divider()
|
||||
.frame(height: 50)
|
||||
@@ -104,6 +116,7 @@ struct MoodStreakLockScreenView: View {
|
||||
Circle()
|
||||
.fill(Color(hex: context.state.lastMoodColor))
|
||||
.frame(width: 24, height: 24)
|
||||
.accessibilityHidden(true)
|
||||
VStack(alignment: .leading) {
|
||||
Text("Today's mood")
|
||||
.font(.caption)
|
||||
@@ -112,6 +125,7 @@ struct MoodStreakLockScreenView: View {
|
||||
.font(.headline)
|
||||
}
|
||||
}
|
||||
.accessibilityElement(children: .combine)
|
||||
} else {
|
||||
VStack(alignment: .leading) {
|
||||
Text(context.state.currentStreak > 0 ? "Don't break your streak!" : "Start your streak!")
|
||||
|
||||
Reference in New Issue
Block a user