Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soffice: Make status bar announcement work for dialogs, LO >= 24.2 #15592

Conversation

michaelweghorn
Copy link
Contributor

Link to issue number:

Fixes #15591

Summary of the issue:

Commit 62536a9
("soffice: Implement methods for status bar announcement (#14933)") added support for status bar announcement in LibreOffice by searching for it in the a11y tree. For performance reasons, only objects of specific roles are considered when traversing the tree. The DIALOG and OPTIONPANE roles, needed to find the status bar in Writer's "Edit Contour" dialog were not taken into account yet, so the status bar was not found and could therefore not be announced when pressing NVDA+End.

In addition, the status bar object in dialogs like that one did not have the proper role in LibreOffice yet.

Description of user facing changes

Status bar announcement for LibreOffice using the NVDA+End keyboard shortcut now also works for dialogs and with the upcoming LibreOffice version 24.2.

Description of development approach

LibreOffice is adapted to expose the proper role for the status bar in dialogs like the one mentioned above:
https://gerrit.libreoffice.org/c/core/+/157659

The DIALOG and OPTIONPANE roles are now also considered by NVDA when traversing the a11y tree to find the status bar.

In addition, the FRAME role is also taken into account, which is needed to support finding the status bar in the default application window with LibreOffice >= 24.2, see commit message of this LibreOffice change for more details: https://gerrit.libreoffice.org/c/core/+/157658

Add a check whether the statusbar children have the 'IAccessibleTextObject' member before accessing it.

Testing strategy:

  1. Start LibreOffice Writer (current development version including
    https://gerrit.libreoffice.org/c/core/+/157659 )
  2. insert a Formula: "Insert" -> "OLE Object" -> "Formula Object", type any formula, e.g. "1+1=2" 3) click outside of the formula then click the formula object again to focus it 4) in Writer's menu, select "Format" -> "Wrap" -> "Edit Contour" 5) Once the dialog shows up, press NVDA+End to announce the status bar

Known issues with pull request:

Requires https://gerrit.libreoffice.org/c/core/+/157659 on LibreOffice side in addition for the announcement to actually work.

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.

 ### Link to issue number:

Fixes nvaccess#15591

 ### Summary of the issue:

Commit 62536a9
("soffice: Implement methods for status bar announcement (nvaccess#14933)")
added support for status bar announcement in LibreOffice by
searching for it in the a11y tree. For performance reasons,
only objects of specific roles are considered when traversing
the tree. The DIALOG and OPTIONPANE roles, needed to find the status
bar in Writer's "Edit Contour" dialog were not taken into
account yet, so the status bar was not found and could
therefore not be announced when pressing NVDA+End.

In addition, the status bar object in dialogs like that one
did not have the proper role in LibreOffice yet.

 ### Description of user facing changes

Status bar announcement for LibreOffice using the NVDA+End keyboard
shortcut now also works for dialogs and with the upcoming LibreOffice
version 24.2.

 ### Description of development approach

LibreOffice is adapted to expose the proper role for the status
bar in dialogs like the one mentioned above:
https://gerrit.libreoffice.org/c/core/+/157659

The DIALOG and OPTIONPANE roles are now also considered
by NVDA when traversing the a11y tree to find the status bar.

In addition, the FRAME role is also taken into account,
which is needed to support finding the status bar in
the default application window with LibreOffice >= 24.2,
see commit message of this LibreOffice change for more details:
https://gerrit.libreoffice.org/c/core/+/157658

Add a check whether the statusbar children have the
'IAccessibleTextObject' member before accessing it.

 ### Testing strategy:

1) Start LibreOffice Writer (current development version including
   https://gerrit.libreoffice.org/c/core/+/157659 )
2) insert a Formula: "Insert" -> "OLE Object" -> "Formula Object", type any formula, e.g. "1+1=2"
3) click outside of the formula then click the formula object again to focus it
4) in Writer's menu, select "Format" -> "Wrap" -> "Edit Contour"
5) Once the dialog shows up, press NVDA+End to announce the status bar

 ### Known issues with pull request:

Requires https://gerrit.libreoffice.org/c/core/+/157659
on LibreOffice side in addition for the announcement to
actually work.

 ### 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.
@AppVeyorBot
Copy link

See test results for failed build of commit 903354ca06

@michaelweghorn michaelweghorn marked this pull request as ready for review October 6, 2023 18:04
@michaelweghorn michaelweghorn requested a review from a team as a code owner October 6, 2023 18:04
tdf-gerrit pushed a commit to LibreOffice/core that referenced this pull request Oct 6, 2023
The description of the UNO API role (s.
`offapi/com/sun/star/accessibility/AccessibleRole.idl`)
and the IAccessible2 role  `IA2_ROLE_FRAME`
(s. `winaccessibility/source/UAccCOMIDL/ia2_api_all.idl`)
match. (The first sentence is even identical.). Therefore, map
them accordingly instead of mapping to `ROLE_SYSTEM_DIALOG`,
which is not really the same.

It's not clear why this "perfect match" was commented
ever since

    commit a18bdb3
    Author: Steve Yin
    Date:   Thu Nov 14 08:18:05 2013 +0000

        Integrate branch of IAccessible2

I noticed this because announcement of the status bar in
Writer by NVDA as implemented in NVDA commit [1]
didn't work any more after

  commit 2cd1408
  Author: Michael Weghorn
  Date:   Thu Aug 17 13:15:46 2023 +0100

      tdf#156561 a11y: Create VCLXTopWindow peer for border win frame

as the DIALOG role was used instead of the WINDOW role
after this, and NVDA doesn't consider that yet when
looking for the status bar.

It also doesn't take `IA2_ROLE_FRAME` into account yet,
but this NVDA PR makes NVDA to consider both,
`ROLE_SYSTEM_DIALOG` and `IA2_ROLE_FRAME` as well: [2]

Just mapping to `ROLE_SYSTEM_WINDOW` instead would
still be a better match than the previous
`ROLE_SYSTEM_DIALOG` and would make that
NVDA scenario work again without further
changes to NVDA, but would rather be a workaround
than the proper solution.

[1] nvaccess/nvda@62536a9
[2] nvaccess/nvda#15592

Change-Id: Ide39222d2525cb64106c878e8b0a11174bcb16ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157658
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
tdf-gerrit pushed a commit to LibreOffice/core that referenced this pull request Oct 6, 2023
Set `css::accessibility::AccessibleRole::STATUS_BAR`
as role for the `VclHBox`/`VclVBox` instances created
for `GtkStatusBar` nodes in .ui files, so that they
are properly exposed to the accessibility layer.

This is e.g. required to make NVDA's feature to announce
the status bar content (when pressing NVDA+End) work.

An additional change on NVDA side is needed to make the
announcement work. Pending PR:
nvaccess/nvda#15592

Change-Id: Iac587be96ec941afd7625ee363949f5da0cbc873
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157659
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Copy link
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

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

user_docs/en/changes.t2t Outdated Show resolved Hide resolved
@seanbudd seanbudd merged commit 5dc9c54 into nvaccess:master Oct 9, 2023
1 check was pending
@nvaccessAuto nvaccessAuto added this to the 2024.1 milestone Oct 9, 2023
@michaelweghorn michaelweghorn deleted the michaelweghorn/dialog_statusbar_announcement branch October 10, 2023 06:17
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.

LibreOffice: Cannot announce status bar in dialogs (e.g. Writer's "Edit Contour" dialog)
4 participants