soffice: Use SymphonyText only for objects with specific roles#17221
Merged
seanbudd merged 1 commit intoSep 30, 2024
Merged
Conversation
### Link to issue number: Fixes nvaccess#17218 ### Summary of the issue: When a checkbox in LibreOffice receives focus, the current state (checked/unchecked) of the checkbox was not reported in braille, while it was in speech. This is due to the NVDA's braille logic using a concept of multiple "focus regions"/potential strings to display, and reporting only the one that's considered the most relevant on the braille display. If an object is considered to have "useful text", that text is given a higher priority than the default logic for checkboxes (see `braille.getFocusRegions`). While the latter does include the checkbox state, the former doesn't. An object is (among others) considered to have useful text if it is an `EditableText` instance (see `NVDAObjectHasUsefulText`). So far, the `SymphonyText` overlay class was used for objects implementing the `IAccessibleText` interface in the LibreOffice app module, regardless of their role, which meant that the overlay class would also be used for checkboxes. As `SymphonyText` subclasses `EditableText`, the text/label of the checkbox was reported on the braille display, which doesn't include the checkbox state. ### Description of user facing changes In LibreOffice, the current checkbox state (checked/unchecked) is now also reported in braille, not just speech. ### Description of development approach Limit the use of the `SymphonyText` overlay class to objects with corresponding roles: `EDITABLETEXT` and `HEADING` For objects with a `PARAGRAPH` role, `SymphonyParagraph` already gets used. This prevents overriding the default logic for reporting objects, including that for checkboxes. While at it, also add `BLOCKQUOTE` to the set of roles for which to use `SymphonyParagraph`, as the block quote role is used for paragraphs in Writer using the "Block Quotation" paragraph style since LibreOffice commit https://git.libreoffice.org/core/commit/b7d2a9c824aca1a4dfd1b857a3620e73ade6bc0d . ### Testing strategy: Follow the steps described in issue nvaccess#17218 and verify that the status of the checkboxes is reported in braille now (can be seen with NVDA's integrated Braille Viewer). ### Known issues with pull request: None. Note: Should this change have any unwanted side-effects, it might be necessary to extend the now explicit set of roles used to determine whether or not to use the SymphonyText overlay class. ### Code Review Checklist: - [x] Documentation: - Change log entry - User Documentation - Developer / Technical Documentation - Context sensitive help for GUI changes - [x] Testing: - Unit tests - System (end to end) tests - Manual testing - [x] UX of all users considered: - Speech - Braille - Low Vision - Different web browsers - Localization in other languages / culture than English - [x] API is compatible with existing add-ons. - [x] Security precautions taken. <!-- Please keep the following --> @coderabbitai summary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #17218
Summary of the issue:
When a checkbox in LibreOffice receives focus, the current state (checked/unchecked) of the checkbox was not reported in braille, while it was in speech.
This is due to the NVDA's braille logic using a concept of multiple "focus regions"/potential strings to display, and reporting only the one that's considered the most relevant on the braille display.
If an object is considered to have "useful text", that text is given a higher priority than the default logic for checkboxes (see
braille.getFocusRegions).While the latter does include the checkbox state, the former doesn't. An object is (among others) considered to have useful text if it is an
EditableTextinstance (seeNVDAObjectHasUsefulText).So far, the
SymphonyTextoverlay class was used for objects implementing theIAccessibleTextinterface in the LibreOffice app module, regardless of their role, which meant that the overlay class would also be used for checkboxes. AsSymphonyTextsubclassesEditableText,the text/label of the checkbox was reported on the braille display, which doesn't include the checkbox state.
Description of user facing changes
In LibreOffice, the current checkbox state (checked/unchecked) is now also reported in braille, not just speech.
Description of development approach
Limit the use of the
SymphonyTextoverlay class to objects with corresponding roles:EDITABLETEXTandHEADINGFor objects with a
PARAGRAPHrole,SymphonyParagraphalready gets used.This prevents overriding the default logic for reporting objects, including that for checkboxes.
While at it, also add
BLOCKQUOTEto the set ofroles for which to use
SymphonyParagraph, as the block quote role is used for paragraphs in Writer using the"Block Quotation" paragraph style since LibreOffice commit
https://git.libreoffice.org/core/commit/b7d2a9c824aca1a4dfd1b857a3620e73ade6bc0d .
Testing strategy:
Follow the steps described in issue #17218
and verify that the status of the checkboxes
is reported in braille now (can be seen with
NVDA's integrated Braille Viewer).
Known issues with pull request:
None.
Note: Should this change have any unwanted side-effects, it might be necessary to extend the now explicit set of roles used to determine whether or not to use the SymphonyText overlay class.
Code Review Checklist:
@coderabbitai summary