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.
Link to issue number:
fixes #18539
Also fixes issues related to users being unable to read the current line/word/character in chrome/firefox/edge, when using focus mode, but I don't know the number of those.
Summary of the issue:
Description of user facing changes:
The user will get access to a new review mode called text review. Text review will be automaticly activated when the navigator object contains text that is navigable and is likely to be of most interest to the user, e.g in edit controls. If the object contains navigable text that could be useful, but the name/value is more useful, e.g on none editable objects in chrome/firefox, object review is used by default, but text review can be switched to manualy. If the object contains no navigable text, text review isn't available. Object review will now always review the name/value/description of the navigator object. When braille is tethered to review, and the review mode is anything other then object review, it will always show the content that the review cursor can read
Description of developer facing changes:
Since a new review mode is added, if the setReviewMode function is used directly with numbers, it could set NVDA to the wrong review mode.
Description of development approach:
the getObjectPosition function has been modified so that if the objects textInfo is a subclass of NVDAObjectTextInfo, it will return that, else it will return the NVDAObjectTextInfo directly.
a new function, called getTextPosition, has been added to get the text review position for the navigator object. If the object has a text info that isn't a subclass of NVDAObjectTextInfo, it will be returned, and text review will be activated automaticly. Else it will look for a new property on the NVDAObject called TextReviewTextInfo. If this is implemented, text review will be available, but it will not be activated automaticly. If it isn't implemented, text review will not be available.
When braille isn't tethered to focus, the NVDAObjectHasUsefulText, will not be used to determine if the content the review cursor can read should be shown on the braille display. Instead, if the review mode isn't object, it will be shown.
The _get_TextInfo method on IAccessible.IAccessible has been removed, so NVDA will use NVDAObjectTextInfo by default in web browsers.
Testing strategy:
Tested in edit fields, and in focus mode in chrome.
Known issues with pull request:
Code Review Checklist:
@coderabbitai summary