Speak title, channel, and duration as the video row VoiceOver label

The row's accessibilityLabel was the debug string video.row.<id>, so
VoiceOver read a raw YouTube ID for every row. Build the label from the
DeArrow-aware display title, author name, and duration instead; the
accessibilityIdentifier stays unchanged for UI tests.
This commit is contained in:
Arkadiusz Fal
2026-09-17 19:18:41 +02:00
parent fe0a5e725c
commit 3e623cba2f

View File

@@ -70,6 +70,15 @@ struct VideoRowView: View {
}
#endif
private var accessibilityLabelText: String {
var parts = [video.displayTitle(using: appEnvironment?.deArrowBrandingProvider), video.author.name]
let duration = video.formattedDuration
if !duration.isEmpty {
parts.append(duration)
}
return parts.joined(separator: ", ")
}
var body: some View {
HStack(alignment: .top, spacing: 12) {
// Index number (for playlists)
@@ -94,7 +103,7 @@ struct VideoRowView: View {
}
.contentShape(Rectangle())
.accessibilityIdentifier("video.row.\(video.id.videoID)")
.accessibilityLabel("video.row.\(video.id.videoID)")
.accessibilityLabel(accessibilityLabelText)
}
@ViewBuilder