Skip to content

Fix VO label for sleep timer#1493

Merged
GianniCarlo merged 2 commits intodevelopfrom
fix/vo-sleep-timer
Mar 24, 2026
Merged

Fix VO label for sleep timer#1493
GianniCarlo merged 2 commits intodevelopfrom
fix/vo-sleep-timer

Conversation

@GianniCarlo
Copy link
Collaborator

Bugfix

  • After activating the sleep timer, VoiceOver users couldn't tell if the sleep timer was actually turned on

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the Player’s sleep timer accessibility so VoiceOver users can hear whether the sleep timer is active and what it’s set to.

Changes:

  • Plumbs a new sleepAccessibilityLabel from PlayerViewModel into MediaActionRow.
  • Updates MediaActionRow’s accessibility label logic to use the sleep timer’s state-aware text when applicable.
  • Extends PlayerViewModel’s SleepTimerState subscription to publish both a visual timer label (sleepText) and a VO-specific label (sleepAccessibilityLabel).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
BookPlayer/Player/Views/PlayerView.swift Passes the new sleep timer accessibility label into the action row.
BookPlayer/Player/Views/MediaActionRow.swift Adjusts accessibility label selection for the timer action to reflect state.
BookPlayer/Player/ViewModels/PlayerViewModel.swift Publishes a dedicated VO label for sleep timer state changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

case .speed:
return "\(speedText) \("speed_title".localized)"
case .timer:
return sleepAccessibilityLabel ?? ma.accessibilityLabel
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For .timer, accessibilityText returns only sleepAccessibilityLabel (e.g., “Sleeping in 5 minutes”). That can be ambiguous in a row of multiple actions because the control’s name (“Sleep Timer”) is no longer announced. Consider keeping the label as ma.accessibilityLabel and exposing the dynamic state via .accessibilityValue, or concatenating the base label + state so VoiceOver always identifies the control.

Suggested change
return sleepAccessibilityLabel ?? ma.accessibilityLabel
if let sleepAccessibilityLabel {
return "\(ma.accessibilityLabel), \(sleepAccessibilityLabel)"
} else {
return ma.accessibilityLabel
}

Copilot uses AI. Check for mistakes.
@GianniCarlo GianniCarlo merged commit 28cc04a into develop Mar 24, 2026
1 of 2 checks passed
@GianniCarlo GianniCarlo deleted the fix/vo-sleep-timer branch March 24, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants