A11y: VoiceOver-Labels auf Study-Screen (erster Pass)

RatingBar (Nochmal/Schwer/Gut/Leicht), CardRenderer (Flip-Zustand via
accessibilityValue), StudySessionView (Karte/Offline-Banner, dekorative
Icons versteckt).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-05-25 14:35:05 +02:00
parent b7001faaf9
commit 4ea030c2e4
3 changed files with 13 additions and 0 deletions

View file

@ -44,6 +44,8 @@ struct CardRenderer: View {
.foregroundStyle(WordeckTheme.mutedForeground)
}
}
.accessibilityElement(children: .combine)
.accessibilityValue(isFlipped ? "Rückseite" : "Vorderseite")
}
@ViewBuilder
@ -58,6 +60,8 @@ struct CardRenderer: View {
.font(.title3)
.foregroundStyle(WordeckTheme.foreground)
}
.accessibilityElement(children: .combine)
.accessibilityValue(isFlipped ? "Rückseite" : "Vorderseite")
}
/// Markdown-Bold (`**...**`) wird auf SwiftUI's AttributedString gemappt.

View file

@ -26,6 +26,7 @@ struct RatingBar: View {
.padding(.vertical, 1)
.background(kbdBackground(for: rating), in: RoundedRectangle(cornerRadius: 4))
.foregroundStyle(kbdForeground(for: rating))
.accessibilityHidden(true)
}
.frame(maxWidth: .infinity)
.padding(.vertical, 14)
@ -37,6 +38,7 @@ struct RatingBar: View {
)
}
.buttonStyle(.plain)
.accessibilityLabel(rating.label)
}
}
.padding(.horizontal, 16)

View file

@ -100,6 +100,8 @@ struct StudySessionView: View {
.padding(.horizontal, 16)
.padding(.top, 4)
.transition(.opacity)
.accessibilityElement(children: .combine)
.accessibilityLabel("Offline du lernst Karten vom letzten Sync")
}
/// Fixe Höhe, damit der Wechsel zwischen "Antwort anzeigen" und
@ -143,6 +145,9 @@ struct StudySessionView: View {
}
.padding(.horizontal, 16)
.padding(.top, 12)
.accessibilityLabel(isFlipped ? "Karte Rückseite" : "Karte Vorderseite")
.accessibilityHint(isFlipped ? "" : "Tippen zum Umdrehen")
.accessibilityAddTraits(.isButton)
}
private func finishedView(session: StudySession) -> some View {
@ -150,6 +155,7 @@ struct StudySessionView: View {
Image(systemName: "checkmark.seal.fill")
.font(.system(size: 64))
.foregroundStyle(WordeckTheme.success)
.accessibilityHidden(true)
Text(session.totalGraded == 0 ? "Keine Karten fällig" : "Fertig!")
.font(.title.bold())
.foregroundStyle(WordeckTheme.foreground)
@ -177,6 +183,7 @@ struct StudySessionView: View {
Image(systemName: "wifi.exclamationmark")
.font(.system(size: 48))
.foregroundStyle(WordeckTheme.error)
.accessibilityHidden(true)
Text("Karten konnten nicht geladen werden")
.font(.headline)
.foregroundStyle(WordeckTheme.foreground)