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

Report the result of word switch case formatting command #17425

Merged
merged 7 commits into from
Nov 26, 2024

Conversation

CyrilleB79
Copy link
Collaborator

@CyrilleB79 CyrilleB79 commented Nov 22, 2024

Link to issue number:

Fixes #10271 (last part)
Also could be considered a partial fix of #3293.

Summary of the issue:

In Word / Outlook, nothing is reported when using the switch case command (shift+f3 in both, control+shift+a in Outlook only). Since it is a toggle/cycle command, the user needs to have the result to be reported.

Description of user facing changes

Using the switch case formatting command in Word or Outlook now reports its result, i.e. the type of case in which the selection has been formatted.

When possible, the message being reported illustrates its own casing, as in Word menus, e.g. "lower case", "UPPERCASE", "Each Word Capitalized"; this may be useful in braille. Exception, for "Mixed case", I have not done something such as "mIxEd cAsE" because it is not correctly understandable through speech.

Description of development approach

  • Used Word object model as for other Word formatting scripts.
  • Introduced a delay (set empirically), since the property retrieved from the object model transitions through other values (no case or lower case) before reaching its definitive value.
  • Bind gestures according to the ones existing in Word and Outlook.

Note: shift+f3 performs case switch both in Word and Outlook, whereas control+shift+A does it only in Outlook. See "Notes about various capitalization shortcuts" in #17197 for more details.

Testing strategy:

Manual test:
Test shift+f3 and control+shift+A in the following conditions:

  • In Word and in Outlook
  • With or without UIA
  • With various types of selection: no selection, piece of word selected, word selected, few words selected, sentence selected, all selected, only digits or punctuation selected, mix of letters and digits selected (e.g. "a0b1" between other words).

Known issues with pull request:

None

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 CyrilleB79 marked this pull request as ready for review November 22, 2024 22:26
@CyrilleB79 CyrilleB79 requested a review from a team as a code owner November 22, 2024 22:26
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.

Just some suggestions for more consistent formatting of strings

source/NVDAObjects/window/winword.py Outdated Show resolved Hide resolved
source/NVDAObjects/window/winword.py Outdated Show resolved Hide resolved
source/NVDAObjects/window/winword.py Outdated Show resolved Hide resolved
@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Nov 26, 2024
@seanbudd seanbudd merged commit 16cbc6f into nvaccess:master Nov 26, 2024
5 checks passed
@github-actions github-actions bot added this to the 2025.1 milestone Nov 26, 2024
@CyrilleB79 CyrilleB79 deleted the wordSwitchCase branch November 26, 2024 07:39
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.

precise Announcing of the state of formatting settings when a hotkey in word is pressed
2 participants