Skip to content

Fixed support for paragraph mouse text unit in Java applications.#18232

Merged
seanbudd merged 5 commits into
nvaccess:masterfrom
hwf1324:JABTextInfoSupportParagraph
Jun 27, 2025
Merged

Fixed support for paragraph mouse text unit in Java applications.#18232
seanbudd merged 5 commits into
nvaccess:masterfrom
hwf1324:JABTextInfoSupportParagraph

Conversation

@hwf1324

@hwf1324 hwf1324 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #18231

Summary of the issue:

Previously, JABTextInfo's _getParagraphOffsets used its own _getLineOffsets to obtain paragraph offsets, which resulted in only the line under the mouse being reported in the paragraph mouse text unit.

Description of user facing changes:

Now report the paragraph under the mouse.

Description of developer facing changes:

JABTextInfo obtains the correct offset for the paragraph.

Description of development approach:

  • The _getStoryText method has been added to JABTextInfo so that OffsetsTextInfo._getLineOffsets can work.
  • JABTextInfo._getParagraphOffsets now uses the superclass _getLineOffsets to calculate offsets based on text content.

Testing strategy:

This PR only affects cases where the mouse text unit is a paragraph.

Run TextComponentDemo.java to test.

Manual testing:

  1. Report the entire paragraph when the mouse is over a multi-line paragraph.
  2. Enter some text on the last line, and report the text just entered when the mouse is on the last line.
  3. When the last line is empty, the mouse reports the contents of the penultimate line and its paragraph on the last line. Similar to Nvda repeats the penultimate line of a text in a java application when the last line is empty #9376, no regression was introduced.

Known issues with pull request:

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

@hwf1324 hwf1324 requested a review from a team as a code owner June 9, 2025 17:54
@hwf1324 hwf1324 requested a review from seanbudd June 9, 2025 17:54
@hwf1324

hwf1324 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor Author

CC: @jcsteh

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Jun 10, 2025
Comment thread source/NVDAObjects/JAB/__init__.py Outdated
Comment thread source/NVDAObjects/JAB/__init__.py
@seanbudd seanbudd marked this pull request as draft June 10, 2025 05:45
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
@hwf1324 hwf1324 marked this pull request as ready for review June 11, 2025 06:40
@seanbudd

Copy link
Copy Markdown
Member

@mwhapples - do you have any thoughts on this PR given your experience with Java?

@seanbudd seanbudd added merge-early Merge Early in a developer cycle and removed blocked/needs-testing labels Jun 17, 2025
@seanbudd seanbudd added this to the 2025.3 milestone Jun 23, 2025
# Conflicts:
#	user_docs/en/changes.md
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 2b3e13e7ef

@seanbudd seanbudd merged commit 4a313d0 into nvaccess:master Jun 27, 2025
17 of 18 checks passed
@hwf1324 hwf1324 deleted the JABTextInfoSupportParagraph branch June 27, 2025 06:35
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. merge-early Merge Early in a developer cycle release/blocking-beta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JABTextInfo: When the mouse unit is set to paragraph, only the line under the mouse is reported.

4 participants