Skip to content

MS Word: The result of Word commands to expand or collapse a heading is now reported#17545

Merged
SaschaCowley merged 15 commits into
nvaccess:masterfrom
CyrilleB79:wordCollapseExpand
Feb 20, 2025
Merged

MS Word: The result of Word commands to expand or collapse a heading is now reported#17545
SaschaCowley merged 15 commits into
nvaccess:masterfrom
CyrilleB79:wordCollapseExpand

Conversation

@CyrilleB79

@CyrilleB79 CyrilleB79 commented Dec 17, 2024

Copy link
Copy Markdown
Contributor

Link to issue number:

None
Related to #17499, but independent of it.

Summary of the issue:

In MS Word, control+alt+plus and control+alt+- allow to expand and collapse the content below a heading. NVDA does not report the result of this action.

Description of user facing changes

NVDA now reports the result of the Word commands to expand and collapse headings.

This command does not exist in Draft mode, so nothing is reported when in this mode.

The command also does not report anything in Outline mode (limitation of this PR).

Description of development approach

Use Word object model (if available) as done for many Word gestures, no matter if UIA is enabled or not

Testing strategy:

Tested with and without UIA.

Known issues with pull request:

This PR does not cover outline mode. The collapse / extend commands still don't report anything in Outline mode; see related issue #17645.

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

@CyrilleB79

Copy link
Copy Markdown
Contributor Author

Test OK in French system/Word, remapping the gesture as needed, i.e. mapping alt+shift+6, which collapse a heading. Note: it has been done so, because the dash is on the same key as the 6.

But strangely, setting my Word (Office) and my keyboard layout to English, I cannot collapse a heading with alt+shift+- as documented here. Could someone with a real English Word/system confirm that this shortcut is the one to collapse a heading?

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 7e57e5193e

@wmhn1872265132

Copy link
Copy Markdown
Contributor

It has been tested in the Chinese version of Word. This function works normally. The Chinese version of Word has the same shortcut keys as the English version.

@wmhn1872265132

Copy link
Copy Markdown
Contributor

After further testing, I found that there seems to be a problem with this function in the Outline view of Word. Regardless of pressing Alt+Shift+Plus sign (+) or Alt+Shift+Minus sign (-), NVDA prompts Expanded, but the operation has been performed correctly.

@SaschaCowley SaschaCowley added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Jan 6, 2025
@CyrilleB79

Copy link
Copy Markdown
Contributor Author

Finally, I have had to exclude such reporting in Outline mode because I have not been able to get the paragraph state in this mode (see also related #17645). Also, I have excluded Draft mode which has no possibility to collapse headings.

@CyrilleB79 CyrilleB79 marked this pull request as ready for review January 26, 2025 21:19
@CyrilleB79 CyrilleB79 requested a review from a team as a code owner January 26, 2025 21:19
Comment thread source/appModules/winword.py Outdated
Comment thread source/appModules/winword.py Outdated
CyrilleB79 and others added 2 commits February 6, 2025 08:02
Co-authored-by: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com>
Comment thread source/appModules/winword.py Outdated
@CyrilleB79 CyrilleB79 marked this pull request as draft February 6, 2025 07:31
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 268541d0ce

@CyrilleB79 CyrilleB79 marked this pull request as ready for review February 9, 2025 21:26
@CyrilleB79

Copy link
Copy Markdown
Contributor Author

@SaschaCowley the PR is ready again.

Comment thread source/NVDAObjects/window/winword.py

@SaschaCowley SaschaCowley 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, @CyrilleB79

@CyrilleB79

Copy link
Copy Markdown
Contributor Author

@SaschaCowley or @seanbudd are you waiting for me to do something here?

If possible, it would be nice to merge this one for 2025.1, even if not mandatory, to be consistent with #17499: both enhance the support of Word's feature to collapse/expand headings.

@SaschaCowley

Copy link
Copy Markdown
Member

@CyrilleB79 no, just waiting on checks to complete before merging. Thanks for your patience.

@SaschaCowley SaschaCowley merged commit a3b4122 into nvaccess:master Feb 20, 2025
@github-actions github-actions Bot added this to the 2025.1 milestone Feb 20, 2025
@CyrilleB79 CyrilleB79 deleted the wordCollapseExpand branch February 20, 2025 22:53
gexgd0419 pushed a commit to gexgd0419/nvda that referenced this pull request Feb 22, 2025
…is now reported (nvaccess#17545)

Related to nvaccess#17499, but independent of it.

Summary of the issue:
In MS Word, control+alt+plus and control+alt+- allow to expand and collapse the content below a heading. NVDA does not report the result of this action.

Description of user facing changes:
NVDA now reports the result of the Word commands to expand and collapse headings.
This command does not exist in Draft mode, so nothing is reported when in this mode.
The command also does not report anything in Outline mode (limitation of this PR).

Description of development approach:
Use Word object model (if available) as done for many Word gestures, no matter if UIA is enabled or not

Testing strategy:
Tested with and without UIA.

Known issues with pull request::
This PR does not cover outline mode. The collapse / extend commands still don't report anything in Outline mode; see related issue nvaccess#17645.
CyrilleB79 pushed a commit to CyrilleB79/nvda that referenced this pull request Mar 17, 2025
seanbudd pushed a commit that referenced this pull request Apr 7, 2025
Follow-up of #17545

Blocked by #17900

Summary of the issue:
#17545 has implemented the announcement resulting of the action to collapse or expand headings in Word with shift+alt+plus/- when using plus/minus on the main keyboard and on the numpad. Thought, using the numpad plus/minus key on the numpad does not report anything if numlock is enabled.

Description of user facing changes
alt+shift+numpadPlus/Minus will now report headings expanding / collapsing, no matter if numlock is on or off.

Description of development approach
Added the two gestures with numlock on in the gestures list of the script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants