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

In Kindle app trying to move to next paragraph via textInfo works incorrectly #16570

Open
mltony opened this issue May 17, 2024 · 4 comments
Open
Labels
audience/nvda-dev PR or issue is relevant to NVDA / Add-on developers blocked/needs-technical-investigation Issue is blocked. A technical investigation is required to progress the issue. p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.

Comments

@mltony
Copy link
Contributor

mltony commented May 17, 2024

Steps to reproduce:

  1. Open Kindle app. Open a book that contains some graphics in the beginning. A good example is The Tiger in the Smoke - currently it needs to be purchased for $1.99.
  2. Put the cursor at the very beginning and in NVDA python console:
    def startOffset(info):
        preTextInfo = info.copy()
        preTextInfo.expand(textInfos.UNIT_STORY)
        infoCollapsed = info.copy()
        infoCollapsed.collapse()
        preTextInfo.setEndPoint(infoCollapsed, "endToEnd")
        preText = preTextInfo.text
        return len(preText)
    
    >>> t=focus.treeInterceptor.makeTextInfo('caret')
    >>> startOffset(t)
    0
    >>> t.text
    ''
    >>> t.expand('paragraph')
    >>> t.collapse(True)
    >>> startOffset(t)
    1
    >>> t.expand('paragraph')
    >>> t.collapse(True)
    >>> startOffset(t)
    0
    >>> t.expand('paragraph')
    >>> t.collapse(True)
    >>> startOffset(t)
    0
    

Actual behavior:

TextInfo stays repeatedly at the very beginning of the document (startOffset(info) == 0) instead of moving one paragraph forward each time.

Expected behavior:

TextInfo should move forward.

NVDA logs, crash dumps and other attachments:

>>> type(t)
<class 'abc.ReviewCursorManager_RootProxyTextInfo'>

System configuration

NVDA installed/portable/running from source:

Running from source

NVDA version:

master

Windows version:

Windows 11

Name and version of other software in use when reproducing the issue:

Kindle appModule.productVersion: '2.3.5.70840'

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

No

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

N/A

@mltony
Copy link
Contributor Author

mltony commented May 18, 2024

More problems with Kindle textInfo: even textInfo.compareEndPoints() appears to return wrong result:

>>> t=focus.treeInterceptor.makeTextInfo('caret')
>>> t.expand('paragraph')
>>> focus.treeInterceptor._moveToNextParagraph(t, 'next')
True
>>> startOffset(t)
1
>>> tt = t.copy()
>>> tt.collapse(True)
>>> tt.expand('paragraph')
>>> startOffset(tt)
0
>>> tt.compareEndPoints(t, 'startToStart')
1

Basically it says that start point of tt goes after start point of t, but when I query offsets via provided startOffset() function I get the opposite ordering of textInfos.

@mltony
Copy link
Contributor Author

mltony commented May 18, 2024

Also textInfo.move() is broken as well:

>>> t=focus.treeInterceptor.makeTextInfo('caret')
>>> t.move('paragraph', 1)
0
>>> t.move('paragraph', 10)
10
>>> startOffset(t)
0

@seanbudd seanbudd added p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. blocked/needs-technical-investigation Issue is blocked. A technical investigation is required to progress the issue. labels May 20, 2024
@seanbudd
Copy link
Member

Does this issue effect the user in any way, or is this just an issue in the python console?
Can you add steps to reproduce on how this would affect a user?

@mltony
Copy link
Contributor Author

mltony commented May 21, 2024

This affects fancy quickNav commands - style navigation, vertical navigation, text navigation. I already disabled them in Kindle precisely due to this issue. So currently I don't know another way to repro this for the end user.

@seanbudd seanbudd added the audience/nvda-dev PR or issue is relevant to NVDA / Add-on developers label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audience/nvda-dev PR or issue is relevant to NVDA / Add-on developers blocked/needs-technical-investigation Issue is blocked. A technical investigation is required to progress the issue. p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

No branches or pull requests

2 participants