musescore / musescore/MuseScore
[Tech Debt] Try universal fake sibling for accessibility announcements
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 15.1k
- Forks
- 3.3k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 91
Description
Screen readers only reliably speak when focus passes from one UI object to another.
That's an issue when we want to announce events that don't involve a change of focus, such as when:
- An object is renamed.
- An input state is changed.
- A background task is completed.
Ideally, we would find a way to overcome the problems with Qt's announcement API, or at least use it in situations where the problems don't apply.
Failing that, we might be able to improve our hacky solution to make it less hacky 😜
For example, given a starting item for which we need to trigger revoicing, it currently searches the accessibility tree until it finds another item (a leaf node) that's not a descendent of the starting item.
If a suitable item is found, we refer to it as the "sibling" of the starting item, although they can be at different levels of the accessibility tree. The idea is to focus the sibling temporarily, then restore focus back to the starting item, thereby forcing the screen reader to say the starting item's (potentially updated) name.
This approach works well, but it might not be necessary to search the entire tree for an existing item. Instead, we could have one (potentially fake/hidden) item that is always used as the sibling for all other items. This item can exist near the top of the tree (near the root) but it cannot have children of its own.
This could work, but it might lead to problems if some screen readers give extra unwanted information (e.g. when the sibling is not in the same list, group, panel, section, or dialog as the original item). The advantage of the current search is that it starts with nearby items and only looks further away when absolutely necessary. On the other hand there's no real guarantee that the search will return any item, whereas a fixed universal sibling would be guaranteed to always exist.
It would require a lot of testing to determine with which screen readers and in what situations a fixed universal sibling can give as good (or better) results than the current search method.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/framework/accessibility/internal/accessibilitycontroller.cpp, especially the Qt announcement API discussion, the current hack, and the sibling search around the linked lines. Compare a universal fake or hidden sibling with the existing nearby-item search and test it across the screen readers and situations mentioned. Done means determining whether the fixed sibling provides equivalent or better announcements without unwanted context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- accessibility
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100