Skip to content

When moving review cursor to the browse mode document set it to the position of the browse mode caret#11376

Merged
feerrenrut merged 5 commits into
nvaccess:masterfrom
lukaszgo1:I9622
Jul 21, 2020
Merged

When moving review cursor to the browse mode document set it to the position of the browse mode caret#11376
feerrenrut merged 5 commits into
nvaccess:masterfrom
lukaszgo1:I9622

Conversation

@lukaszgo1

@lukaszgo1 lukaszgo1 commented Jul 14, 2020

Copy link
Copy Markdown
Contributor

Link to issue number:

Closes #9622

Summary of the issue:

When moving review cursor to focus and focused control is a browse mode document the review cursor position is set at the position of the focus not the browse mode caret. It is problematic because most of the time the focused control is a document window which isn't really interesting. This is also inconsistent with other windows with caret - in these cases review cursor is set to the caret position,

Description of how this pull request fixes the issue:

When the focused control is a browse mode document review cursor is set to the position of the browse mode caret.

Testing performed:

With Focus focusable elements enabled and disabled.

  1. In Acrobat Reader DC moved down in a long PDF file, pressed NVDA+num minus, with Numpad 8 tested that the line under the review cursor corresponds to the position of the browse mode caret which has been checked with NVDA + up arrow.
  2. In Firefox opened https://github.com/nvaccess/nvda, Moved to the first heading, pressed NVDA+Numpad minus, ensured that the current line in browse mode (checked as previously with NVDA + up arrow) and the one under the review cursor (checked with numpad 8) is the same. Also ensured that navigator object is set to the position of the review cursor by pressing NVDA + numpad 5.
  3. In the run dialog tabbed to the ok button, moved review cursor there (NVDA + Numpad minus) ensured that there is no change in behavior outside of browse mode that is the current navigator object is the ok. button and review cursor is set at the position of o in the word ok.

Known issues with pull request:

In #9622 @feerrenrut requested a separate script for moving to the focus which this PR doesn't implement. As I've explained in #9622 such script makes no sense IMO - outside of browse mode it would be redundant, and in browse mode the focused object is either the document window or some object which no longer is interesting to the user.

Change log entry:

Section: Changes:

When moving review cursor to focus in browse mode it is now set at the position of the virtual caret.

…cument

set review cursor to the position of the browse mode caret/
Fixes nvaccess#9622

@feerrenrut feerrenrut 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.

Ok, looks like I was a little confused on the initial issue. Overall this looks fine, but please update the testing steps to include gestures used / observations to make reproducing your testing (and variations of it) faster.

Comment thread source/globalCommands.py Outdated
except (NotImplementedError,RuntimeError):
pos=obj.makeTextInfo(textInfos.POSITION_FIRST)
api.setReviewPosition(pos)
TIAtCaret = self._getTIAtCaret(True)

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.

please start variables with lower case, otherwise they look like classes / types

Suggested change
TIAtCaret = self._getTIAtCaret(True)
tIAtCaret = self._getTIAtCaret(True)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done so. I've decided to start the variable name with upper case T just because PEP 8 recommends to capitalize all letters of the acronyms and ti is obviously short for TextInfo.

@lukaszgo1

Copy link
Copy Markdown
Contributor Author

@feerrenrut I hope the updated testing steps are sufficient.

@feerrenrut feerrenrut 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.

Thanks @lukaszgo1

@feerrenrut feerrenrut merged commit dfbda72 into nvaccess:master Jul 21, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.3 milestone Jul 21, 2020
@lukaszgo1 lukaszgo1 deleted the I9622 branch July 21, 2020 17:15
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.

when activating document review and review cursor isn't following focus review cursor always ends up at the top of the document.

3 participants