Skip to content

CursorManager._caretMovementScriptHelper: return early if another script is waiting.#17049

Merged
seanbudd merged 4 commits into
betafrom
i16812
Aug 27, 2024
Merged

CursorManager._caretMovementScriptHelper: return early if another script is waiting.#17049
seanbudd merged 4 commits into
betafrom
i16812

Conversation

@michaelDCurran
Copy link
Copy Markdown
Member

@michaelDCurran michaelDCurran commented Aug 25, 2024

Link to issue number:

Fixes #16812

Summary of the issue:

If holding down an arrow key in NvDA browse mode, such as in Microsoft Word, NVDA can become unresponsive if holding down the key for a long period of time. This is because moving in browse mode can be very costly, and scripts become backed up.

Description of user facing changes

NVDA no longer becomes unresponsive if holding down an arrow key for a long time while in NVDA browse mode, in particular in Microsoft word.

Description of development approach

CursorManager._caretMovementScriptHelper: return early if another script is waiting. There is no point doing something costly when another script is going to happen anyway.

Testing strategy:

with both UIA enabled and disabled for MS Word:

  • Opened a large document in Microsoft Word.
  • Switched to browse mode with NVDA+space.
  • Held down down arrow for at least 5 seconds. Ensured that NvDA had moved down several lines and that it started to report the line straight away, rather than becoming unresponsive.

Known issues with pull request:

None known.

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.

Summary by CodeRabbit

  • New Features
    • Improved keyboard navigation in NVDA to prevent unresponsiveness during extended key presses in browse mode.
    • Added support for braille display routing keys and new cursor selection commands.
  • Bug Fixes
    • Resolved an issue where updating NVDA while pending add-on updates would remove the add-on, ensuring a smoother update process.

…g, just return early without doing anything. Otherwise, scripts could become backed up and NVDA will become unresponsive.
@michaelDCurran michaelDCurran requested a review from a team as a code owner August 25, 2024 21:34
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 25, 2024

Walkthrough

The recent update introduces enhancements to the NVDA screen reader, particularly in handling keyboard navigation in Microsoft Word's browse mode. Key down event handling has been modified to prevent time accumulation when keys are held down, addressing performance issues. The update also improves the usability of braille display routing keys for cursor movement and refines the update process for add-ons.

Changes

File(s) Change Summary
source/cursorManager.py Added import for isScriptWaiting and integrated a check in _caretMovementScriptHelper to optimize caret movement logic.
user_docs/en/changes.md Documented features preventing unresponsiveness during prolonged key presses in browse mode and improved update handling.

Assessment against linked issues

Objective Addressed Explanation
Modify keyboard handler to prevent time accumulation for key down events in MS Word ( #16812)
Ensure immediate speech feedback upon key release without delays ( #16812) The update does not fully resolve speech sequence delays.
Improve NVDA's performance during long key presses ( #16812)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
user_docs/en/changes.md (1)

46-46: Correct the capitalization of "Microsoft Word".

The term "Microsoft word" should be capitalized correctly as "Microsoft Word".

* NVDA no longer becomes unresponsive if holding down an arrow key for a long time while in NVDA browse mode, in particular Microsoft Word. (#16812)

@AppVeyorBot
Copy link
Copy Markdown

See test results for failed build of commit cfaf971a0a

@AppVeyorBot
Copy link
Copy Markdown

See test results for failed build of commit cfaf971a0a

Comment thread user_docs/en/changes.md Outdated
Comment thread source/cursorManager.py
Comment thread user_docs/en/changes.md Outdated
@CyrilleB79
Copy link
Copy Markdown
Contributor

Thanks for this fix. It's very nice. I hope we won't have side effects though (as explained in my review comment).

Co-authored-by: Cyrille Bougot <cyrille.bougot2@laposte.net>
@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Aug 27, 2024
@seanbudd seanbudd added this to the 2024.4 milestone Aug 27, 2024
@seanbudd seanbudd changed the base branch from master to beta August 27, 2024 03:09
@seanbudd seanbudd merged commit 0245b3b into beta Aug 27, 2024
@seanbudd seanbudd deleted the i16812 branch August 27, 2024 03:09
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.

MS Word browse mode: modify the internal keyboard handler so that key down events don't acumulate time since input to the infinite

5 participants