soffice: Report keyboard-triggered paragraph style change#17153
Merged
seanbudd merged 6 commits intoSep 17, 2024
Merged
Conversation
### Link to issue number: Partially implements feature requests from nvaccess#6915 ### Summary of the issue: Commit 20bdb39 ("soffice: Report keyboard-triggered font size change (nvaccess#17147)") implemented announcement of the new value of the font size combobox in Writer's formatting toolbar when it is changed via keyboard shortcut. Issue nvaccess#6915 requests announcement of further attributes, including the announcement of the current paragraph style when applying "Heading 1",..., "Heading 5" styles via the Ctrl+1,..., Ctrl+5 keyboard shortcuts. ### Description of user facing changes When applying the "Body Text" or a heading paragraph style using the corresponding keyboard shortcut in LibreOffice Writer 25.2 or newer, NVDA announces the new paragraph style. ### Description of development approach Extend the solution from the above-mentioned commit 20bdb39. Other than the simpler case of the font size combo box, changing the paragraph style can imply more related formatting changes (e.g. font size, bold,...). To avoid triggering the announcement of these implicit formatting changes, but rather announce the new paragraph style to confirm that the user-triggered action had the expected result, introduce a way to reliably identify the paragraph style combobox in the formatting toolbar: 1) Add an "id" object attribute to the IAccessible2 object attribute specification: > This identifier remains the same across different sessions of > the same application, regardless of the UI language. IAccessible2 commit: LinuxA11y/IAccessible2@2b8c2c7 2) In LibreOffice, set the "id" attribute to the ID already used in the UI file format (GtkBuilder XML files): https://git.libreoffice.org/core/commit/21b29f25660db973fa1480de77e6a69d76a5de53 3) In NVDA, extend the logic for announcing gesture-triggered formatting changes to allow specifying a specific ID of the UI element(s) of interest. If one is set, don't announce changes in other UI elements for that gesture. Set the ID to the one that the paragraph style combobox in Writer's formatting toolbar has ("applystyle"). Let NVDA handle the Ctrl+0, Ctrl+1, Ctrl+2, Ctrl+3, Ctrl+4 and Ctrl+5 gestures to announce the new paragraph style ("Body Text" for Ctrl+0, corresponding heading for Ctrl+1 through Ctrl+5). ### Testing strategy: 1. start NVDA 2. start current development version of LibreOffice Writer (with English UI and keyboard layout) 3. Press Ctrl+1 to apply paragraph Style "Heading 1" 4. Verify that NVDA announces the new paragraph style by name, i.e. says "Heading 1" 5. Repeat steps 3 and 4 with Ctrl+2, Ctrl+3, Ctrl+4, Ctrl+5 to verify that the other heading levels are also announced correctly. 6. Press Ctrl+0 to apply paragraph style "Body Text" and verify that NVDA announces the new paragraph style by name, i.e. says "Body Text" 8. Retest that the other supported keyboard gestures as implemented in commits 46a3436 and 20bdb39 are still announced as expected. ### Known issues with pull request: None, but note that a current LibreOffice development version (to become LibreOffice 25.2) is required for the feature 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.
a6a9659 to
9a9b6c4
Compare
SaschaCowley
requested changes
Sep 16, 2024
SaschaCowley
left a comment
Member
There was a problem hiding this comment.
Thanks for this, @michaelweghorn. Everything looks sound to me, I just have a request for a few type hints.
seanbudd
reviewed
Sep 16, 2024
Co-authored-by: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com>
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
seanbudd
approved these changes
Sep 17, 2024
SaschaCowley
approved these changes
Sep 17, 2024
5 tasks
seanbudd
pushed a commit
that referenced
this pull request
Mar 27, 2025
Fix-up of #17153. Summary of the issue: When modifying heading style with ctrl+1/2/3/4/5 or turning back to body text with ctrl+0, other formatting changes might be reported in languages where "ctrl" is translated differently, e.g. "Strg" in German. Description of user facing changes Only style and no other associated formatting changes should be reported when modifying heading styles with ctrl+1/2/3/4/5 or turning back to body text with ctrl+0. Description of development approach Do not use the displayName property to define which type of gesture we are dealing with, Use modifierNames and mainKeyName properties instead since they are not translated.
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:
Partially implements feature requests from #6915
Summary of the issue:
Commit 20bdb39
("soffice: Report keyboard-triggered font size change (#17147)") implemented announcement of the new value of the font size combobox in Writer's formatting toolbar when it is changed via keyboard shortcut. Issue #6915 requests announcement of further attributes, including the announcement of the current paragraph style when applying "Heading 1",..., "Heading 5" styles via the Ctrl+1,..., Ctrl+5 keyboard shortcuts.
Description of user facing changes
When applying the "Body Text" or a heading paragraph style using the corresponding keyboard shortcut in LibreOffice Writer 25.2 or newer, NVDA announces the new paragraph style.
Description of development approach
Extend the solution from the above-mentioned
commit 20bdb39.
Other than the simpler case of the font size combo box, changing the paragraph style can imply more related formatting changes (e.g. font size, bold,...).
To avoid triggering the announcement of these implicit formatting changes, but rather announce the new paragraph style to confirm that the user-triggered action had the expected result, introduce a way to reliably identify the paragraph style combobox in the formatting toolbar:
IAccessible2 commit: LinuxA11y/IAccessible2@2b8c2c7
In LibreOffice, set the "id" attribute to the ID already used in the UI file format (GtkBuilder XML files): https://git.libreoffice.org/core/commit/21b29f25660db973fa1480de77e6a69d76a5de53
In NVDA, extend the logic for announcing gesture-triggered formatting changes to allow specifying a specific ID of the UI element(s) of interest. If one is set, don't announce changes in other UI elements for that gesture.
Set the ID to the one that the paragraph style combobox in Writer's formatting toolbar has ("applystyle").
Let NVDA handle the Ctrl+0, Ctrl+1, Ctrl+2, Ctrl+3, Ctrl+4 and Ctrl+5 gestures to announce the new paragraph style ("Body Text" for Ctrl+0, corresponding heading for Ctrl+1 through Ctrl+5).
Testing strategy:
Known issues with pull request:
None, but note that a current LibreOffice development version (to become LibreOffice 25.2) is required for the feature to actually work.
Code Review Checklist:
@coderabbitai summary