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

UI Automation in Windows Console: use UIATextInfo in FORMATTED consoles #12669

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

codeofdusk
Copy link
Contributor

Link to issue number:

Closes #12130.
Might help #11172.
Supersedes #11495 and #12425.

Summary of the issue:

Before recent upstream work, NVDA needed a custom TextInfo implementation including workarounds for the console. Notably, it was necessary to restrict the text range to visible content, as the console contained thousands of empty lines which both slowed down diffing and disorientated the user. This is no longer necessary as the console's UIA text range now ends at the last actual character (i.e. no more extraneous empty lines).

This bounding to the visible ranges can sometimes lead to choppy speech output, as full screen refreshes (such as in pagers or full-screen editors) cause text discontinuity, resulting in the diff algorithms losing context about which parts of the text are new. It breaks precedent from the rest of NVDA: in Word or web documents, for instance, the review cursor is not bounded to the visible text and the entire document can be freely explored. Despite the documentation of the scrolling commands in the user guide, the need to scroll consoles in particular, in strict contrast to the behaviour in other applications, has caused user confusion (microsoft/terminal#6453 and private correspondance with various users) and the commands don't work consistently in any case. In microsoft/terminal#6453 (comment) it was pointed out that consoles can have text that appears below the visible content, which is currently inaccessible to NVDA due to bounding.

Description of how this pull request fixes the issue:

Switches consoles where apiLevel is FORMATTED to use the default TextInfo implementation (i.e. no customization at the UIA text range level). Also use UIATextInfo in Windows Terminal as it never contained thousands of empty lines, making the overrides unnecessary there.

Testing strategy:

With NVDA developer info (NVDA+f1), verified that:

  • In a FORMATTED console: UIATextInfo is used.
  • In an IMPROVED console: ConsoleUIATextInfo is used.
  • In an END_INCLUSIVE console: ConsoleUIATextInfoWorkaroundEndInclusive is used.
  • In Windows Terminal: UIATextInfo is used.

Also manually verified that new and old UIA console work as expected.

Known issues with pull request:

None.

Change log entries:

None (will become user visible with #10964).

Code Review Checklist:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual tests.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.

@codeofdusk codeofdusk force-pushed the cmduia-UIATextInfo-formatted branch from 4d62b70 to 161fa87 Compare July 22, 2021 02:51
@codeofdusk codeofdusk marked this pull request as ready for review July 22, 2021 03:25
@codeofdusk codeofdusk requested a review from a team as a code owner July 22, 2021 03:25
@codeofdusk codeofdusk requested a review from seanbudd July 22, 2021 03:25
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.

LGTM, excited for the coming changes in #10964

@seanbudd seanbudd merged commit f6984e3 into nvaccess:master Jul 22, 2021
@nvaccessAuto nvaccessAuto added this to the 2021.3 milestone Jul 22, 2021
@codeofdusk codeofdusk deleted the cmduia-UIATextInfo-formatted branch August 2, 2021 16:44
codeofdusk added a commit to codeofdusk/nvda that referenced this pull request May 8, 2022
…MATTED consoles.

The ability for users to explore all console text enabled by nvaccess#12669 has been well appreciated, but it poses problems in paginated output (less, more, etc.) as the review cursor jump to top/bottom commands are relative to the entire buffer, which can grow quite large. To ease review of paginated output, make these commands jump relative to visible (not full) text. Note that it is now impossible to jump quickly to the top/bottom of the entire buffer.
Closes nvaccess#13157.
codeofdusk added a commit to codeofdusk/nvda that referenced this pull request May 8, 2022
…MATTED consoles.

The ability for users to explore all console text enabled by nvaccess#12669 has been well appreciated, but it poses problems in paginated output (less, more, etc.) as the review cursor jump to top/bottom commands are relative to the entire buffer, which can grow quite large. To ease review of paginated output, make these commands jump relative to visible (not full) text. Note that it is now impossible to jump quickly to the top/bottom of the entire buffer.
Closes nvaccess#13157.
codeofdusk added a commit to codeofdusk/nvda that referenced this pull request Jun 22, 2022
…MATTED consoles.

The ability for users to explore all console text enabled by nvaccess#12669 has been well appreciated, but it poses problems in paginated output (less, more, etc.) as the review cursor jump to top/bottom commands are relative to the entire buffer, which can grow quite large. To ease review of paginated output, make these commands jump relative to visible (not full) text. Note that it is now impossible to jump quickly to the top/bottom of the entire buffer.
Closes nvaccess#13157.
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.

Diff-match-patch: choppy reading in pager output
3 participants