feat: add WCAG AA accessibility app-wide, fix CloudKit container config, remove debug logs

- Add VoiceOver labels, hints, and element grouping across all 60+ views
- Add Reduce Motion support (Theme.Animation.prefersReducedMotion) to all animations
- Replace fixed font sizes with semantic Dynamic Type styles
- Hide decorative elements from VoiceOver with .accessibilityHidden(true)
- Add .minimumHitTarget() modifier ensuring 44pt touch targets
- Add AccessibilityAnnouncer utility for VoiceOver announcements
- Improve color contrast values in Theme.swift for WCAG AA compliance
- Extract CloudKitContainerConfig for explicit container identity
- Remove PostHog debug console log from AnalyticsManager

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-11 09:27:23 -06:00
parent e9c15d70b1
commit d63d311cab
77 changed files with 982 additions and 263 deletions

View File

@@ -77,6 +77,8 @@ struct PollDetailView: View {
}
} label: {
Image(systemName: "ellipsis.circle")
.minimumHitTarget()
.accessibilityLabel("More options")
}
}
}
@@ -172,7 +174,7 @@ struct PollDetailView: View {
.fill(Theme.warmOrange.opacity(0.15))
.frame(width: 56, height: 56)
Image(systemName: "link.circle.fill")
.font(.system(size: 28))
.font(.title2)
.foregroundStyle(Theme.warmOrange)
}
@@ -182,9 +184,11 @@ struct PollDetailView: View {
.foregroundStyle(Theme.textSecondary(colorScheme))
Text(poll.shareCode)
.font(.system(size: 36, weight: .bold, design: .monospaced))
.font(.system(.largeTitle, design: .monospaced).weight(.bold))
.foregroundStyle(Theme.warmOrange)
.tracking(4)
.lineLimit(1)
.minimumScaleFactor(0.7)
}
// Copy button
@@ -221,6 +225,7 @@ struct PollDetailView: View {
Image(systemName: viewModel.hasVoted ? "checkmark.circle.fill" : "hand.raised.fill")
.font(.title3)
.foregroundStyle(viewModel.hasVoted ? Theme.mlsGreen : Theme.warmOrange)
.accessibilityLabel(viewModel.hasVoted ? "You have voted" : "You have not voted")
}
VStack(alignment: .leading, spacing: 2) {
@@ -231,6 +236,7 @@ struct PollDetailView: View {
HStack(spacing: Theme.Spacing.xs) {
Image(systemName: "person.2.fill")
.font(.caption2)
.accessibilityHidden(true)
Text("\(viewModel.votes.count) vote\(viewModel.votes.count == 1 ? "" : "s")")
.font(.subheadline)
}
@@ -263,6 +269,7 @@ struct PollDetailView: View {
HStack(spacing: Theme.Spacing.sm) {
Image(systemName: "chart.bar.fill")
.foregroundStyle(Theme.warmOrange)
.accessibilityHidden(true)
Text("Results")
.font(.headline)
.foregroundStyle(Theme.textPrimary(colorScheme))
@@ -294,6 +301,7 @@ struct PollDetailView: View {
HStack(spacing: Theme.Spacing.sm) {
Image(systemName: "map.fill")
.foregroundStyle(Theme.warmOrange)
.accessibilityHidden(true)
Text("Trip Options")
.font(.headline)
.foregroundStyle(Theme.textPrimary(colorScheme))
@@ -347,6 +355,27 @@ private struct ResultRow: View {
}
}
private var rankAccessibilityLabel: String {
switch rank {
case 1: return "First place"
case 2: return "Second place"
case 3: return "Third place"
default: return "\(rank)\(rankSuffix) place"
}
}
private var rankSuffix: String {
let ones = rank % 10
let tens = rank % 100
if tens >= 11 && tens <= 13 { return "th" }
switch ones {
case 1: return "st"
case 2: return "nd"
case 3: return "rd"
default: return "th"
}
}
private var rankColor: Color {
switch rank {
case 1: return Theme.warmOrange
@@ -366,6 +395,7 @@ private struct ResultRow: View {
Image(systemName: rankIcon)
.font(.subheadline)
.foregroundStyle(rankColor)
.accessibilityLabel(rankAccessibilityLabel)
}
VStack(alignment: .leading, spacing: 4) {
@@ -447,6 +477,7 @@ private struct TripPreviewCard: View {
.font(.caption)
.fontWeight(.semibold)
.foregroundStyle(.tertiary)
.accessibilityHidden(true)
}
.padding()
.background(Theme.cardBackground(colorScheme))