nvda
nvda copied to clipboard
Improve speech output for UIA notifications, honoring all NotificationProcessing_* constants
this is a prototype to see how NVDA's UIA notification support can be improved, both for the bennofit of UIA notifications in general, but also laying groundwork for supporting the proposed ariaNotify specification allowing web authors to instruct screen readers to speak messages without resorting to live regions: https://github.com/WICG/aom/blob/gh-pages/notification-api.md
Link to issue number:
None
Summary of the issue:
Currently, NVDA's speech output for UIA notifications is very basic in that it just cancels speech and then speaks the display string. It does not honor the importants, or whether only the most recent notification should be spoken etc. NVDA should appropriately support all NotificationProcessing_* constants:
- ImportantAll
- ImportantMostRecent
- ImportantCurrentThenMostRecent
- MostRecent
- CurrentThenMostRecent
Description of user facing changes
NVDA now honors the importants of UI Automation notifications sent by applications.
Description of development approach
ui.message: add optional arguments:
- messageID: a unique string identify for this message. This could be used to filter or customize the message, and is used with the following arguments to configure how multiple messages with the same message ID interrupt each other.
- speakOnlyMostRecent: If a message with the same message ID has already been queued, the already queued message/s are dropped and only the most recent one is spoken.
- interuptCurrentIfSameID: if speakOnlyMostRecentIfSameID is also true, but this argument is false, the first existing message in the queue is not dropped, thus a full message is always spoken. E.g. a progress bar quickly going from 0 to 100 in jumps of 1, might say "0, 25, 55, 100" rather than just stuttering until it gets to 100.
UIA NvDAObject's event_UIA_notify: suitably map the UIA notificationProgress argument to appropriate values for speakOnlyMostRecentIfSameID and interuptCurrentIfSameID. Also map them to an appropriate speech priority. E.g.:
- NotificationProcessing_Important*: priority=NOW
- NotificationProcessing_*ThenMostRecent: speakOnlyMostRecentIfSameID=True
- NotificationProcessing_*CurrentThenMostRecent: interuptcurrentIfSameID=False
- NotificationProcessing_*: priority=NEXT
Testing strategy:
Private testing done, but will be outlined when browser prototypes become public.
Known issues with pull request:
this is a prototype draft. It is functional, but the code could be better abstracted.
Code Review Checklist:
- [ ] Documentation:
- Change log entry
- User Documentation
- Developer / Technical Documentation
- Context sensitive help for GUI changes
- [ ] Testing:
- Unit tests
- System (end to end) tests
- Manual testing
- [ ] UX of all users considered:
- Speech
- Braille
- Low Vision
- Different web browsers
- Localization in other languages / culture than English
- [ ] API is compatible with existing add-ons.
- [ ] Security precautions taken.
- Build (for testing PR): https://ci.appveyor.com/api/buildjobs/1h4jm8o6duuqgtyg/artifacts/output/
- CI timing (mins): INIT 0.0, INSTALL_START 1.2, INSTALL_END 0.9, BUILD_START 0.0, FINISH_END 9.7
See test results for failed build of commit cb54f80afb