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

Add new scripts to move review cursor by page #14021

Merged
merged 6 commits into from
Aug 17, 2022

Conversation

codeofdusk
Copy link
Contributor

@codeofdusk codeofdusk commented Aug 16, 2022

Link to issue number:

Closes #13157 (given microsoft/terminal#13756). Alternative solution to #13671.

Summary of the issue:

There is no way to move the review cursor by page. This is especially useful in terminals as a "page" can be defined as a screenful of text, solving #13157 without violating any other assumptions in NVDA and still permitting easy jump to the absolute top/bottom of the terminal buffer using the currently existing scripts.

Description of how this pull request fixes the issue:

Added new scripts (bound to NVDA+pageUp/NVDA+pageDown on desktop and NVDA+Shift+pageUp/NVDA+Shift+pageDown on laptop) to move to previous/next page respectively.

Testing strategy:

  • Tested in UIA word where the page unit is sanely defined. Scripts work as expected.
  • Tested in non-UIA word where the page unit is undefined. NVDA reports that movement by page is not supported.
  • Tested in Notepad where the page unit is undefined but defers to document. NVDA reports "top"/"bottom" and reads the entire document as expected.

Known issues with pull request:

As different textInfos define UNIT_PAGE differently, behaviour will vary across applications.

Change log entries:

Feel free to clarify/reword where you see fit.

=== New Features ===

  • Introduced new commands to move the review cursor by page where supported by the application. These are especially useful for moving across screens of text, such as paginated output, in Windows Terminal.
    • Move to previous page: NVDA+pageUp (desktop), NVDA+Shift+pageUp (laptop)
    • Move to next page: NVDA+pageDown (desktop), NVDA+Shift+pageDown (laptop)

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@codeofdusk
Copy link
Contributor Author

CC @seanbudd, @LeonarddeR, @michaelDCurran.

Copy link
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

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

I think this approach is a safe and generally useful feature.
The way it handles the different cases seems appropriate.

user_docs/en/userGuide.t2t Outdated Show resolved Hide resolved
source/globalCommands.py Outdated Show resolved Hide resolved
source/globalCommands.py Outdated Show resolved Hide resolved
@seanbudd seanbudd added the merge-early Merge Early in a developer cycle label Aug 16, 2022
@codeofdusk codeofdusk marked this pull request as ready for review August 16, 2022 23:12
@codeofdusk codeofdusk requested review from a team as code owners August 16, 2022 23:12
codeofdusk and others added 3 commits August 16, 2022 16:13
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Copy link
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

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

Great work @codeofdusk!

Copy link
Member

@Qchristensen Qchristensen left a comment

Choose a reason for hiding this comment

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

User Guide reads well, great work.

@burmancomp
Copy link
Contributor

I tried these commands in Thunderbird 102.1.2 message list. NVDA + Shift + PageUp gave result "movement by page not supported" which is expected behavior I suppose. But command NVDA + Shift + PageDown resulted the following in log:

IO - inputCore.InputManager.executeGesture (10:28:16.276) - winInputHook (7160):
Input: kb(laptop):shift+NVDA+pageDown
ERROR - scriptHandler.executeScript (10:28:16.329) - MainThread (14408):
error executing script: <bound method GlobalCommands.script_review_nextPage of <globalCommands.GlobalCommands object at 0x0BF290F0>> with gesture 'vaihto+NVDA+sivu alas'
Traceback (most recent call last):
File "scriptHandler.py", line 216, in executeScript
script(gesture)
File "globalCommands.py", line 1479, in script_review_nextPage
newPage.expand(textInfos.UNIT_PAGE)
File "textInfos\offsets.py", line 527, in expand
self._startOffset,self._endOffset=self._getUnitOffsets(unit,self._startOffset)
File "textInfos\offsets.py", line 505, in _getUnitOffsets
raise ValueError("unknown unit: %s"%unit)
ValueError: unknown unit: page

@LeonarddeR
Copy link
Collaborator

I can not reproduce this in the thunderbird messages list. I'm currently investigating what's necessary for broader rollout of page movement.

@codeofdusk

This comment was marked as outdated.

seanbudd pushed a commit that referenced this pull request Aug 18, 2022
…ipts (#14029)

Follow up of #14021

Summary of the issue:
In the Thunderbird message list on some systems, move by page appears to work, but expansion doesn't.

Description of how this pull request fixes the issue:
Widen scope of try/except to catch this case.
@codeofdusk
Copy link
Contributor Author

@burmancomp Now that #14029 has been merged, could you please test the latest master snapshot and verify that NVDA now reports "movement by page not supported" for both previous and next?

seanbudd added a commit that referenced this pull request Jul 21, 2023
Closes #15127
Fix up of #14021

Summary of the issue:
#14021 accidentally overwrote the touch gesture to move to the previous line in text review mode.
These overwritten gestures were not documented in the user guide, and appear to be unintentional.

Description of user facing changes
Remove overwritten "flickUp" gestures.

Description of development approach
Remove overwritten "flickUp" gestures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-early Merge Early in a developer cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

windows terminal: NVDA reads invisible lines when using pagers such as less and more
6 participants