Skip to content

No longer allow moving to offset past end for NVDAObjectTextInfo#19531

Merged
SaschaCowley merged 3 commits into
nvaccess:betafrom
LeonarddeR:allowMovePastEnd
Jan 30, 2026
Merged

No longer allow moving to offset past end for NVDAObjectTextInfo#19531
SaschaCowley merged 3 commits into
nvaccess:betafrom
LeonarddeR:allowMovePastEnd

Conversation

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Link to issue number:

fixes #18912

Summary of the issue:

#18744 fixed up issues with uniscribe. Since that change, NVDAObjectTextInfo properly allows moving offset past end, however NVDAObjectTextInfo is not supposed to do so as it has no insertion point anyway.

Description of user facing changes:

NVDA no longer reports blank at the end of NVDA Objext text info text review, such as for list items.

Description of developer facing changes:

Since allowMoveToUnitOffsetPastEnd is now implemented on NVDAObjectTextInfo, I had to swap two classes in the inheritance hiërarchie for a unit tests class.

Description of development approach:

Handle NVDAObjectTextInfo as a text info without insertion point, similar to virtual buffers. In other words, don't allow moving offset past end, as there's no point to do so.

Testing strategy:

Tested str from #18912

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #18912 where NVDA incorrectly reports "blank" at the end of list items when using text review navigation by word. The root cause was that after PR #18744 fixed uniscribe issues, NVDAObjectTextInfo started allowing movement to offsets past the end of text. However, since NVDAObjectTextInfo has no insertion point (unlike editable text), this behavior was incorrect.

Changes:

  • Added allowMoveToUnitOffsetPastEnd method to NVDAObjectTextInfo that returns False, preventing movement past the end since there's no insertion point
  • Updated test class inheritance order to ensure CompoundTextLeafTextInfo's implementation takes precedence over NVDAObjectTextInfo's

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
source/NVDAObjects/init.py Adds allowMoveToUnitOffsetPastEnd method returning False to prevent moving past end for text info without insertion point
tests/unit/test_compoundDocuments.py Swaps inheritance order so CompoundTextLeafTextInfo's allowMoveToUnitOffsetPastEnd takes precedence over BasicTextInfo's inherited implementation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



class BasicCompoundTextLeafTextInfo(BasicTextInfo, compoundDocuments.CompoundTextLeafTextInfo): ...
class BasicCompoundTextLeafTextInfo(compoundDocuments.CompoundTextLeafTextInfo, BasicTextInfo): ...

Copilot AI Jan 29, 2026

Copy link

Choose a reason for hiding this comment

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

This class does not call OffsetsTextInfo.init during initialization. (The class lacks an init method to ensure every base class init is called.)

Copilot uses AI. Check for mistakes.


class BasicCompoundTextLeafTextInfo(BasicTextInfo, compoundDocuments.CompoundTextLeafTextInfo): ...
class BasicCompoundTextLeafTextInfo(compoundDocuments.CompoundTextLeafTextInfo, BasicTextInfo): ...

Copilot AI Jan 29, 2026

Copy link

Choose a reason for hiding this comment

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

This class does not call TrackedObject.del during finalization. (The class lacks an del method to ensure every base class del is called.)

Copilot uses AI. Check for mistakes.
@SaschaCowley SaschaCowley added this to the 2026.1 milestone Jan 29, 2026

@SaschaCowley SaschaCowley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks, @LeonarddeR

Comment thread source/NVDAObjects/__init__.py Outdated
@SaschaCowley SaschaCowley enabled auto-merge (squash) January 29, 2026 23:48
@SaschaCowley SaschaCowley merged commit 916395a into nvaccess:beta Jan 30, 2026
73 of 75 checks passed
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.

3 participants