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 "Fix reading the last empty line of a text in apps using Java Access Bridge" #17083

Closed
wants to merge 2 commits into from

Conversation

SaschaCowley
Copy link
Member

@SaschaCowley SaschaCowley commented Aug 30, 2024

Reverts PR

Reverts #16568

Issues fixed

Fixes #17027

Issues reopened

Reopens #9376

Reason for revert

The changes introduced a bug whereby if the final line was not blank, it would be read in place of the second-last line.

Can this PR be reimplemented? If so, what is required for the next attempt

The changes introduced are desirable if the case of erroneously reporting the last line instead of the second-last line can be resolved.

Summary by CodeRabbit

  • New Features
    • Enhanced NVDA screen reader functionality to improve accuracy when reading text in Java applications, ensuring correct information is provided based on cursor position.
  • Bug Fixes
    • Resolved an issue where NVDA would incorrectly read the last line of text when positioned on the second-last line in multiline edit controls.

@SaschaCowley SaschaCowley requested a review from a team as a code owner August 30, 2024 02:36
Copy link
Contributor

coderabbitai bot commented Aug 30, 2024

Walkthrough

The changes involve modifications to the NVDA screen reader's functionality, specifically improving how line offsets are calculated in the Java Access Bridge module. The updates address an issue where NVDA incorrectly read the last line of text when the cursor was positioned on the second-last line in Java applications, enhancing the accuracy of the screen reader's output.

Changes

File Path Change Summary
source/NVDAObjects/JAB/init.py Modified the _getLineOffsets method to simplify logic for calculating line offsets when the end position is -1, removing the newline check.
user_docs/en/changes.md Added a summary of a new feature enhancement that corrects NVDA's reading behavior in Java applications, ensuring accurate line reading.

Assessment against linked issues

Objective Addressed Explanation
NVDA should read the content of the line where the cursor is positioned (i.e., the second last line). (#17027)

Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cee553d and d312a7b.

Files selected for processing (2)
  • source/NVDAObjects/JAB/init.py (1 hunks)
  • user_docs/en/changes.md (1 hunks)
Additional context used
Path-based instructions (2)
source/NVDAObjects/JAB/__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. When providing code suggestions, particularly when requested, ensure GitHub's suggestion format is used, i.e.: suggestion <code changes>


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. When providing code suggestions, particularly when requested, ensure GitHub's suggestion format is used, i.e.: suggestion <code changes>


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 (2)
source/NVDAObjects/JAB/__init__.py (1)

187-188: Verify the correctness of the simplified logic.

The simplified logic might affect the behavior when the character at offset - 1 is a newline. The previous logic handled this case by setting start and end to offset. Ensure that the behavior is as expected in such cases.

Run the following script to verify the behavior:

user_docs/en/changes.md (1)

64-64: LGTM!

The changelog entry is clear, concise, and references an issue number.


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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@SaschaCowley SaschaCowley marked this pull request as draft August 30, 2024 02:37
@SaschaCowley SaschaCowley deleted the i17027 branch August 30, 2024 02:39
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.

NVDA 2024.3 Reads Content of Last Line When Cursor is on Second Last Line in JetBrains IDEs
1 participant