Some accessibility issues
Hi there! Thank you for your hard work on this open source app. I want to gently bring up a few accessibility-related issues I encountered.
Taking the example of the first screenshot(Settings - Editor), 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.
A potential approach would be using Compose's semantic APIs to group the components together, as demonstrated in Compose's official accessibility documentation. Specifically, it might be a good idea to use the .clearAndSetSemantics method to apply Switch semantics to the entire ListItem inside EditorPane, as shown in the example code below. This is just a suggestion based on what I’ve observed, and I hope it may be helpful.
ListItem(
modifier = Modifier
.clearAndSetSemantics {
role = Role.Switch
contentDescription = "xxx"
onClick(label = "xxx") { true }
}
...
trailingContent = { 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 open autosave", which can make the switch's function more intuitive and clear to users.
Switch(
modifiler = Modifier.semantics {
onClick(label = "open autosave") { }
}
)
Please don’t feel any pressure. I’m grateful for all the effort you’ve already invested in this project! This is simply a suggestion based on my observations, and I’d be happy to provide more context or adjust my perspective if needed.