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

Use UIA caret events in Windows Terminal #16873

Merged
merged 3 commits into from
Jul 18, 2024

Conversation

codeofdusk
Copy link
Contributor

@codeofdusk codeofdusk commented Jul 17, 2024

Link to issue number:

Follow-up of #16711, #16817.

Summary of the issue:

UIA caret events in Windows Terminal were unreliable before #16711. In particular, when rapidly pressing backspace, sometimes the last character of the prompt would be erroneously read.

Description of how this pull request fixes the issue:

Re-enable caret events in Windows Terminal specifically. Note that caret events are still broken in this way in Conhost and are therefore left disabled.

Testing strategy:

Active daily use of an NVDA build containing this change, much of which is in Windows Terminal. Alpha testing.

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

  • Improvements

    • Enhanced caret movement detection for better performance in various scenarios.
    • Improved support using UIA for XAML and WPF text controls.
    • Enhanced browser support using IAccessible2.
  • Bug Fixes

    • Fixed issues with the Seika Notetaker driver handling braille input gestures correctly.
    • Refined behavior of NVDA's on-demand speech mode.

@codeofdusk codeofdusk requested a review from a team as a code owner July 17, 2024 04:47
Copy link
Contributor

coderabbitai bot commented Jul 17, 2024

Walkthrough

This update modifies the NVDA project by updating the include/espeak submodule to a new commit, introducing a method for detecting caret movements via events in the winConsoleUIA.py module, and refining the documentation to reflect these improvements. Additionally, it includes enhanced support for various text controls and better handling of braille input gestures.

Changes

File(s) Change Summary
include/espeak Updated submodule to commit cb62d93fd7b61d8593b9ae432e6e2a78e3711a77 from 54ee11a79c66c8ecb9a48a7084163beff3bd6075.
source/NVDAObjects/UIA/winConsoleUIA.py Added method _get_caretMovementDetectionUsesEvents in _DiffBasedWinTerminalUIA and _NotificationsBasedWinTerminalUIA classes, returning True.
user_docs/en/changes.md Updated documentation to describe changes in caret movement detection, UIA and IAccessible2 support, and braille input gestures handling.

Possibly related issues

  • Update eSpeak for 2024.4 #16775: The update to include/espeak submodule aligns with the objectives mentioned in this issue for updating eSpeak for the 2024.4 release.

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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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
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: 2

user_docs/en/changes.md Show resolved Hide resolved
user_docs/en/changes.md Show resolved Hide resolved
@AppVeyorBot
Copy link

See test results for failed build of commit 9598665ceb

@@ -450,6 +450,10 @@ def event_UIA_notification(self, **kwargs):
"Block notification events when diffing to prevent double reporting."
log.debugWarning(f"Notification event blocked to avoid double-report: {kwargs}")

def _get_caretMovementDetectionUsesEvents(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it really necessary to make this an auto prop?

Suggested change
def _get_caretMovementDetectionUsesEvents(self):
caretMovementDetectionUsesEvents = True

Also, the default is supposed to be True, so I'm confused about why this override is necessary here.

Copy link
Contributor Author

@codeofdusk codeofdusk Jul 17, 2024

Choose a reason for hiding this comment

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

Also, the default is supposed to be True, so I'm confused about why this override is necessary here.

The value is False in this case, because the diffing-based implementation inherits from EnhancedTermTypedCharSupport.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, this is an auto property for consistency with the base class.

source/NVDAObjects/UIA/winConsoleUIA.py Outdated Show resolved Hide resolved
@seanbudd seanbudd merged commit 067c8a9 into nvaccess:master Jul 18, 2024
1 check was pending
codeofdusk added a commit to codeofdusk/nvda that referenced this pull request Aug 23, 2024
seanbudd pushed a commit that referenced this pull request Aug 27, 2024
Reverts #16873.

Summary of the issue:
When backspacing beyond the leftmost character of a line in Windows Terminal, the last character of the prompt is erroneously read in some environments.
Some caret tracking issues (especially when connected to remote systems) are more apparent.
Description of how this pull request fixes the issue:
Revert the new behaviour until it can be fixed upstream or a workaround can be found.

Testing strategy:
Verified restoration of previous behaviour and that caret tracking works as before.
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.

4 participants