Skip to content

soffice: Use SymphonyText only for objects with specific roles#17221

Merged
seanbudd merged 1 commit into
nvaccess:masterfrom
michaelweghorn:michaelweghorn/soffice_braille_checkbox_state
Sep 30, 2024
Merged

soffice: Use SymphonyText only for objects with specific roles#17221
seanbudd merged 1 commit into
nvaccess:masterfrom
michaelweghorn:michaelweghorn/soffice_braille_checkbox_state

Conversation

@michaelweghorn

Copy link
Copy Markdown
Contributor

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 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 #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:

  • 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.

@coderabbitai summary

 ### 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

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @michaelweghorn !

@seanbudd seanbudd merged commit 45402bc into nvaccess:master Sep 30, 2024
@github-actions github-actions Bot added this to the 2025.1 milestone Sep 30, 2024
@michaelweghorn michaelweghorn deleted the michaelweghorn/soffice_braille_checkbox_state branch September 30, 2024 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nvda doesn't display check box status in braille in libreoffice dialogs

2 participants