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

ScreenInfoUiaProvider::GetVisibleRanges() returns an improper result #4507

Closed
carlos-zamora opened this issue Feb 7, 2020 · 1 comment · Fixed by #4495
Closed

ScreenInfoUiaProvider::GetVisibleRanges() returns an improper result #4507

carlos-zamora opened this issue Feb 7, 2020 · 1 comment · Fixed by #4495
Assignees
Labels
Area-Accessibility Issues related to accessibility Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@carlos-zamora
Copy link
Member

Summary

Our TermControlUiaProvider (aka ScreenInfoUiaProvider) returns a list of UiaTextRange for our visible ranges (one per row in the buffer).

The docs for GetVisibleRanges state we should only return one range.

Technical Details

We only have one continuous span of text visible at a time (within a given Terminal Control).

The documentation for GetVisibleRanges states as follows:

If the visible text consists of one contiguous span of text, the pRetVal array should contain a single text range that represents all of the visible text.

ITextProvider::GetVisibleRanges should return a degenerate (empty) text range if no text is visible, if all text is scrolled out of view, or if the text-based control contains no text.

@carlos-zamora carlos-zamora added Product-Conhost For issues in the Console codebase Area-Accessibility Issues related to accessibility Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. labels Feb 7, 2020
@carlos-zamora carlos-zamora self-assigned this Feb 7, 2020
@ghost ghost added the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Feb 7, 2020
@DHowett-MSFT DHowett-MSFT added this to the Terminal v1.0 milestone Feb 10, 2020
@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Feb 10, 2020
@DHowett-MSFT
Copy link
Contributor

We'll scrub this in a discussion with @cinnamon-msft.

@ghost ghost added the In-PR This issue has a related PR label Feb 11, 2020
@ghost ghost removed the In-PR This issue has a related PR label Feb 11, 2020
ghost pushed a commit that referenced this issue Feb 11, 2020
…4526)

## Summary of the Pull Request
`ScreenInfoUiaProvider::GetVisibleRanges()` used to return one range per line of visible text. The documentation for this function says that we should return one per contiguous span of text. Since all of the text in the TermControl will always be contiguous (at least by our standards), we should only ever be returning one range.

## PR Checklist
* [X] Closes #4507 
* [X] CLA signed.

## Validation Steps Performed
Verified using Accessibility Insights.
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. In-PR This issue has a related PR and removed Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. labels Feb 11, 2020
@ghost ghost closed this as completed in #4495 Feb 20, 2020
ghost pushed a commit that referenced this issue Feb 20, 2020
## Summary of the Pull Request
Debugging our custom UIA providers has been a painful experience because outputting content to VS may result in UIA Clients getting impatient and giving up on extracting data.

Adding tracing allows us to debug these providers without getting in the way of reproducing a bug. This will help immensely with developing accessibility features on Windows Terminal and Console.

This pull request additionally contains payload from #4526:
* Make GetVisibleRanges() return one range (and add tracing for it).
`ScreenInfoUiaProvider::GetVisibleRanges()` used to return one range per line of visible text. The documentation for this function says that we should return one per contiguous span of text. Since all of the text in the TermControl will always be contiguous (at least by our standards), we should only ever be returning one range.

## PR Checklist
* [x] Closes #1914. Closes #4507.
* [x] CLA signed

## Detailed Description of the Pull Request / Additional comments
`UiaTracing` is a singleton class that is in charge of registration for trace logging. `TextRange` is used to trace `UiaTextRange`, whereas `TextProvider` is used to trace `ScreenInfoUiaProviderBase`.

`_getValue()` is overloaded to transform complex objects and enums into a string for logging.

`_getTextValue()` had to be added to be able to trace the text a UiaTextRange included. This makes following UiaTextRanges much simpler.

## Validation Steps Performed
Performed a few operations when under NVDA/Narrator and manually checked the results.
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Feb 20, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Accessibility Issues related to accessibility Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants