UIA API versioning #11303

Closed
opened 2026-01-31 02:43:53 +00:00 by claunia · 4 comments
Owner

Originally created by @codeofdusk on GitHub (Nov 6, 2020).

Originally assigned to: @carlos-zamora on GitHub.

Description of the new feature/enhancement

Since its initial implementation, UIA in conhost has had various levels of completeness and bugginess. To account for this, NVDA must slightly change its behaviour for the various versions. Selected examples:

  • Before #4018, a number of workarounds were necessary as the ends of ranges were not always exclusive. After this PR, those workarounds were not needed, but behaviour needed to change as not all lines ended in a newline character.
  • Before #4495, GetVisibleRanges was unreliable.
  • After #6986, NVDA might no longer need to use GetVisibleRanges in some cases to bound the console, as the thousands of empty lines will be removed from UIA.

Historically, NVDA has checked the Windows build number to determine which workarounds were needed. However, since newer OpenConsole can be run on older Windows, this is no longer sufficient. NVDA should be able to check which version of conhost is in use, perhaps by an API version (incremented for breaking UIA changes) in the automation ID for the text area.

Proposed technical implementation details (optional)

  • The automation ID is set in ScreenInfoUiaProviderBase::GetPropertyValue().
  • Note: You might consider localizing the name set in this function. NVDA specifically ignores the console's name (as it isn't localized and unnecessary for us), but other screen readers (such as Narrator) might not.
Originally created by @codeofdusk on GitHub (Nov 6, 2020). Originally assigned to: @carlos-zamora on GitHub. <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Since its initial implementation, UIA in conhost has had various levels of completeness and bugginess. To account for this, NVDA must slightly change its behaviour for the various versions. Selected examples: * Before #4018, a number of workarounds were necessary as the ends of ranges were not always exclusive. After this PR, those workarounds were not needed, but behaviour needed to change as not all lines ended in a newline character. * Before #4495, `GetVisibleRanges` was unreliable. * After #6986, NVDA might no longer need to use `GetVisibleRanges` in some cases to bound the console, as the thousands of empty lines will be removed from UIA. Historically, NVDA has checked the Windows build number to determine which workarounds were needed. However, since newer OpenConsole can be run on older Windows, this is no longer sufficient. NVDA should be able to check which version of conhost is in use, perhaps by an API version (incremented for breaking UIA changes) in the automation ID for the text area. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) * The automation ID is set in `ScreenInfoUiaProviderBase::GetPropertyValue()`. * Note: You might consider localizing the name set in this function. NVDA specifically ignores the console's name (as it isn't localized and unnecessary for us), but other screen readers (such as Narrator) might not. <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-FixResolution-Won't-Fix labels 2026-01-31 02:43:53 +00:00
Author
Owner

@DHowett commented on GitHub (Nov 6, 2020):

Is this a common way to version UIA support in an application? I'd rather not do something strange that nobody else does here...

@DHowett commented on GitHub (Nov 6, 2020): Is this a common way to version UIA support in an application? I'd rather not do something _strange_ that nobody else does here...
Author
Owner

@DHowett commented on GitHub (Nov 6, 2020):

We also do not officially recommend running OpenConsole anywhere but "on your dev machine, for a short period of time". It's not supported and likely won't be until a while after #7414 lands in the OS.

@DHowett commented on GitHub (Nov 6, 2020): We also do not officially recommend running OpenConsole anywhere but "on your dev machine, for a short period of time". It's not supported and likely won't be until a while after #7414 lands in the OS.
Author
Owner

@codeofdusk commented on GitHub (Nov 6, 2020):

The docs say:

An AutomationId is not necessarily guaranteed to be stable across different releases or builds of an application.

If not the AutomationId, how then can we detect different builds of the console?

For whatever it's worth, @carlos-zamora and I discussed this (offline) and he supported the idea...

@codeofdusk commented on GitHub (Nov 6, 2020): [The docs](https://docs.microsoft.com/en-us/dotnet/api/system.windows.automation.automationelement.automationidproperty?view=netcore-3.1) say: > An AutomationId is not necessarily guaranteed to be stable across different releases or builds of an application. If not the `AutomationId`, how then can we detect different builds of the console? For whatever it's worth, @carlos-zamora and I discussed this (offline) and he supported the idea...
Author
Owner

@DHowett commented on GitHub (Nov 20, 2020):

I wrote up a few of my thoughts on the versioning issue here: https://github.com/nvaccess/nvda/pull/11796#issuecomment-730830987

In short, Joseph suggests that we shouldn't use the automation ID for a version, and I explain a little bit about our philosophy on conhost/openconsole versioning.

I'm gonna reject this one for now, but as always I am willing to hear more info on it 😄

@DHowett commented on GitHub (Nov 20, 2020): I wrote up a few of my thoughts on the versioning issue here: https://github.com/nvaccess/nvda/pull/11796#issuecomment-730830987 In short, Joseph suggests that we shouldn't use the automation ID for a version, and I explain a little bit about our philosophy on conhost/openconsole versioning. I'm gonna reject this one for now, but as always I am willing to hear more info on it :smile:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11303