[PR #1691] Accessibility: Set-up UIA Tree #24651

Open
opened 2026-01-31 09:04:35 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/1691

State: closed
Merged: Yes


Summary of the Pull Request

I touched A LOT of files. The main reason for this is that the WindowUiaProvider was moved to Microsoft::Console::Types so that it can be accessed by both projects. This meant we had to make a lot of propagating changes. But more info on that later.

The Basics of Accessibility

  • What is a User Interaction Automation (UIA) Tree?
  • Other projects (i.e.: Narrator) can take advantage of this UIA tree and are used to present information within it.
  • Some things like XAML already have a UIA Tree. So some UIA tree navigation and features are already there. It's just a matter of getting them hooked up and looking right.

Accessibility in our Project
There's a few important classes...
regarding Accessibility...

  • WindowUiaProvider: This sets up the UIA tree for a window. So this is the top-level for the UIA tree.
  • ScreenInfoUiaProvider: This sets up the UIA tree for a terminal buffer.
  • UiaTextRange: This is essential to interacting with the UIA tree for the terminal buffer. Actually gets portions of the buffer and presents them.

regarding the Windows Terminal window...

  • BaseWindow: The foundation to a window. Deals with HWNDs and that kind of stuff.
  • IslandWindow: This extends BaseWindow and is actually what holds our Windows Terminal
  • NonClientIslandWindow: An extension of the IslandWindow

regarding ConHost...

  • IConsoleWindow: This is an interface for the console window.
  • Window: This is the actual window for ConHost. Extends IConsoleWindow

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

  • IConsoleWindow changes:
    • move into Microsoft::Console::Types (a shared space)
    • Have IslandWindow extend it
  • WindowUiaProvider changes:
    • move into Microsoft::Console::Types (a shared space)
  • Hook up WindowUiaProvider to IslandWindow (yay! we now have a tree)

Validation Steps Performed

I used "inspect.exe" to verify that the tree is hooked up. Verified this on ConHost and Windows Terminal.

Comments after merging in PR #1915

Please refer to #1915 for a large chunk of the work done here. There are also a few known issues/TODOs that carry over:

**Original Pull Request:** https://github.com/microsoft/terminal/pull/1691 **State:** closed **Merged:** Yes --- <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request I touched A LOT of files. The main reason for this is that the `WindowUiaProvider` was moved to `Microsoft::Console::Types` so that it can be accessed by both projects. This meant we had to make a lot of propagating changes. But more info on that later. **The Basics of Accessibility** - [What is a User Interaction Automation (UIA) Tree?](https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-tree-overview) - Other projects (i.e.: Narrator) can take advantage of this UIA tree and are used to present information within it. - Some things like XAML already have a UIA Tree. So some UIA tree navigation and features are already there. It's just a matter of getting them hooked up and looking right. **Accessibility in our Project** There's a few important classes... regarding Accessibility... - **WindowUiaProvider**: This sets up the UIA tree for a window. So this is the top-level for the UIA tree. - **ScreenInfoUiaProvider**: This sets up the UIA tree for a terminal buffer. - **UiaTextRange**: This is essential to interacting with the UIA tree for the terminal buffer. Actually gets portions of the buffer and presents them. regarding the Windows Terminal window... - **BaseWindow**: The foundation to a window. Deals with HWNDs and that kind of stuff. - **IslandWindow**: This extends `BaseWindow` and is actually what holds our Windows Terminal - **NonClientIslandWindow**: An extension of the `IslandWindow` regarding ConHost... - **IConsoleWindow**: This is an interface for the console window. - **Window**: This is the actual window for ConHost. Extends `IConsoleWindow` <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [X] Closes #634 * [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments - `IConsoleWindow` changes: - move into `Microsoft::Console::Types` (a shared space) - Have `IslandWindow` extend it - `WindowUiaProvider` changes: - move into `Microsoft::Console::Types` (a shared space) - Hook up `WindowUiaProvider` to IslandWindow (yay! we now have a tree) <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed I used "inspect.exe" to verify that the tree is hooked up. Verified this on ConHost and Windows Terminal. ## Comments after merging in PR #1915 Please refer to #1915 for a large chunk of the work done here. There are also a few known issues/TODOs that carry over: - [ ] ConHost: the UIA Rects for the caption buttons are missing. Still investigating this issue. - [ ] Issue #1914 - Tracing needs to be reattached - [ ] Issue #1352 - Windows Terminal: the ScreenInfoUiaProvider needs to be attached to the TermControl. - [ ] #1993 - [ ] #1992
claunia added the pull-request label 2026-01-31 09:04:35 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#24651