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

Revert disabling handling of caret notifications for UIA #16817

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

LeonarddeR
Copy link
Collaborator

@LeonarddeR LeonarddeR commented Jul 4, 2024

Link to issue number:

Partially reverts #14888, #15838

Summary of the issue:

In #14888, XamlEditableText was added to ensure that UIA events wouldn't be used to determine caret changes, as the hypothesis was that they were fired too early. In #15838, I expanded this workaround for WPF (Visual Studio) text controls.
It turns out @jcsteh found the actual cause of these issues and fixed them in #16711, allowing us to rely on events again.

Description of user facing changes

None, though caret movement would possibly be detected a little bit faster in XAML and WPF controls.

Description of development approach

Mostly reverts.

Testing strategy:

  • Tested that caret movement works reliably in WhatsApp Desktop (UWP)
  • Tested that caret movement works reliably in the search field in the Windows 11 start menu
  • Tested that caret movement works reliably in Visual Studio text controls

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

  • Bug Fixes

    • Fixed issue with NVDA's caret movement in XAML and WPF text controls by reverting to UIA events.
  • Deprecations

    • Deprecated NVDAObjects.UIA.InaccurateTextChangeEventEmittingEditableText with no replacement.

@LeonarddeR LeonarddeR marked this pull request as ready for review July 4, 2024 10:27
@LeonarddeR LeonarddeR requested a review from a team as a code owner July 4, 2024 10:27
@LeonarddeR LeonarddeR requested a review from gerald-hartig July 4, 2024 10:27
Copy link
Contributor

coderabbitai bot commented Jul 4, 2024

Walkthrough

The recent update in the NVDA project primarily involves modifying how it interacts with XAML and WPF text controls. This includes changing class inheritance related to handling text change events, revamping import statements, and addressing a bug fix concerning caret movement by reverting to UIA events. Additionally, there is a deprecation notice for InaccurateTextChangeEventEmittingEditableText.

Changes

File Path Change Summary
source/NVDAObjects/UIA/__init__.py - Added import NVDAState
- Removed import inputCore
- Modified class definitions for XamlEditableText and WpfTextView
- Updated conditional deprecation note for InaccurateTextChangeEventEmittingEditableText
user_docs/en/changes.md Updated documentation to include a bug fix for NVDA's caret movement in text controls and a deprecation notice for InaccurateTextChangeEventEmittingEditableText

Sequence Diagram(s)

Silently ignoring sequence diagram generation as the changes are too varied and straightforward.


Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4c50375 and b494491.

Files selected for processing (2)
  • source/NVDAObjects/UIA/init.py (3 hunks)
  • user_docs/en/changes.md (2 hunks)
Additional context used
Path-based instructions (2)
source/NVDAObjects/UIA/__init__.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

user_docs/en/changes.md (3)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.md: Focus on grammar, spelling, and punctuation. Also consider readability and clarity of contents. Ensure that changes follow the style of one sentence per line, suggest changes if this is not met.


Pattern user_docs/en/changes.md: Ensure each change log entry references an issue or pull request number. Change log entries can also include a reference to a GitHub author. Examples of valid change log entries: * Item with sub-items (#123, @username): * sub-item * bar (#342) * Item with. Multiple lines. (#143)

Additional comments not posted (6)
source/NVDAObjects/UIA/__init__.py (4)

24-24: Import change approved.

The import statement for NVDAState was added, which is likely necessary for the new state management functionality.


2485-2488: Class deprecation approved.

The class InaccurateTextChangeEventEmittingEditableText is deprecated without a replacement, which aligns with the objective of reverting the changes made in previous pull requests.


2491-2491: Inheritance change approved.

The class XamlEditableText now directly inherits from EditableTextBase and UIA, which is appropriate following the deprecation of InaccurateTextChangeEventEmittingEditableText.


2676-2676: Inheritance change approved.

The class WpfTextView now directly inherits from EditableTextBase and UIA, which is appropriate following the deprecation of InaccurateTextChangeEventEmittingEditableText.

user_docs/en/changes.md (2)

11-11: LGTM!

The bug fix note correctly references the PR and author, adhering to the style guidelines.


21-21: LGTM!

The deprecation notice correctly references the PR and author, adhering to the style guidelines.


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 Configration 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.

@seanbudd seanbudd merged commit eeca3b8 into nvaccess:master Jul 11, 2024
1 check passed
seanbudd pushed a commit that referenced this pull request Jul 18, 2024
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.
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.

2 participants