-
-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Describe the bug
Hi! Thank you for your hard work on this open source app. I noticed a few accessibility improvements that could be made.
Taking the example of the interface shown in the figure below, the red boxes indicate the order in which components are focused sequentially by screen readers when visually impaired users navigate through the UI. When they focus on the Switch, they will only hear its current on/off state but cannot understand what specific feature this Switch is enabling/disabling. This requires them to perform additional left/right swipes to obtain contextual information about the Switch. This may creates unnecessary cognitive load.
App version and source
I downloaded Petals v3.36.1 from F-Droid.
To Reproduce
As described in the Describe the bug section.
Expected behavior
A potential approach would be using Compose's semantic APIs to group the components together, as demonstrated in Compose's official accessibility documentation. Specifically, adding Modifier.semantics(mergeDescendants = true) to the Row in the SwitchListItem function may be helpful. This is just a suggestion based on what I’ve observed, and I hope it may be helpful.
Row(
modifier = Modifier.semantics (mergeDescendants = true),
){
ListItem()
Switch()
}
Alternatively, adding an onClickLabel to the Switch might also be a good practice. An example of how this can be implemented is provided in the code snippet below. For instance, when considering a Switch, a screen reader might announce "Double tap to activate" before a label is added. After adding an appropriate label, it would instead say "Double tap to Enable milliseconds on Hit Timer page", which can make the switch's function more intuitive and clear to users.
modifiler = Modifier.semantics {
onClick(label = "Enable milliseconds on Hit Timer page") { }
}
Screenshots
Additional context
Please don’t feel any pressure — I completely understand if other things come first. I really appreciate all the work and effort you’ve already put in!
