XWIKI-19723: Navigation panel not accessible using a screen reader #3789
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira URL
https://jira.xwiki.org/browse/XWIKI-19723
Changes
Description
sr-only
description next to every tree AFAIK. This works for the navigation panel.Clarifications
instance_counter
to generate those, but unfortunately it's not possible easily, and afaics any solution would have to be a bit hacky. Setting up our own velocity templating counter does not work since we load thistree.vm
script multiple times. It's technically bad to have multiple items with the same ID, however here it's for literally the same item/content, so it doesn't matter much (only the DOM position changes). Thanks to the resilience of web browsers and NVDA, we can see that everything still works correctly :)Screenshots & Video
Here are some demos I took with Chrome 131, NVDA and some XWiki 17.0.0 snapshot run locally.
Before the changes
https://github.com/user-attachments/assets/8016dc85-289f-417f-95d9-ff9a4d9501c7
We can see that the state of the tree is properly conveyed. However when the user arrives on it, nothing is said about how to operate it.
https://github.com/user-attachments/assets/5afb6262-3a5d-4c8b-820e-5cf0b20b9e09
Now, right when the user tabs to the tree, info about how to handle it is read out. Note that this info is read again when the user clicks on a
X more
link that reloads the whole tree. It could be a small annoyance but the benefits far outweight this drawback.Executed Tests
First, I successfully rebuilt all of the module affected by some changes:
mvn clean install -f xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-macro ;mvn clean install -f xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-war; mvn clean install -f xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-tree/xwiki-platform-index-tree-macro
. I went through theTreeElement
BaseElement for docker tests, and it seems like the changes brought do not impact any xpath or query used in there. I then ran the tests on the wholexwiki-platform-index
module withmvn clean install -f xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-test/xwiki-platform-index-test-docker -Dxwiki.test.ui.wcag=true
. The tests passed properly and no WCAG failure was found. They extensively use theTreeElement
and child classes.Expected merging strategy