[PR #2414] Accessibility: Refactor Providers #24929

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

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

State: closed
Merged: Yes


Summary of the Pull Request

Refactors the accessibility providers (ScreenInfoUiaProvider and UiaTextRange) into a better separated model between ConHost and Windows Terminal.

ScreenInfoUiaProviderBase and UiaTextRangeBase are introduced. ConHost and Windows Terminal implement their own versions of ScreenInfoUiaProvider and UiaTextRange that inherit from their respective base classes.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

  • Types now has ScreenInfoUiaProviderBase and UiaTextRangeBase to allow for shared code
  • UiaTextRange
    • Creates are used to properly create itself
      • this is needed because we need to use some virtual functions AFTER we are created to fully initialize ourselves. A bit annoying.
    • ChangeViewport, TranslatePointToScreen, and TranslatePointFromScreen are unique to CH vs WT (helper functions)
    • Clone and FindText are unique to CH vs WT (public interactions)
  • ScreenInfoUiaProvider
    • CreateUTRs are used to properly create UiaTextRanges
    • Navigate, get_BoundingRectangle, and get_FragmentRoot are unique to CH vs WT

Now that we know if we're calling FindText from WT or CH, we don't need it in IRenderData. So that got moved.

🚨NOTE: There will be some conflicts with #2296. Notably, the issue mentioned above. resolving that merge conflict will be pretty easy though.

Validation Steps Performed

Used inspect on ConHost and WT. Bounding rects still appear as expected in each model

**Original Pull Request:** https://github.com/microsoft/terminal/pull/2414 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Refactors the accessibility providers (`ScreenInfoUiaProvider` and `UiaTextRange`) into a better separated model between ConHost and Windows Terminal. `ScreenInfoUiaProviderBase` and `UiaTextRangeBase` are introduced. ConHost and Windows Terminal implement their own versions of `ScreenInfoUiaProvider` and `UiaTextRange` that inherit from their respective base classes. <!-- 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 #2120 * [x] CLA signed. * [x] ~Tests added/passed~ old tests still valid * [x] ~Requires documentation to be updated~ N/A * [x] I am a core contributor <!-- 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 - `Types` now has `ScreenInfoUiaProviderBase` and `UiaTextRangeBase` to allow for shared code - `UiaTextRange` - `Create`s are used to properly create itself - this is needed because we need to use some virtual functions AFTER we are created to fully initialize ourselves. A bit annoying. - `ChangeViewport`, `TranslatePointToScreen`, and `TranslatePointFromScreen` are unique to CH vs WT (helper functions) - `Clone` and `FindText` are unique to CH vs WT (public interactions) - `ScreenInfoUiaProvider` - `CreateUTR`s are used to properly create `UiaTextRanges` - `Navigate`, `get_BoundingRectangle`, and `get_FragmentRoot` are unique to CH vs WT Now that we know if we're calling `FindText` from WT or CH, we don't need it in IRenderData. So that got moved. 🚨NOTE: There will be some conflicts with #2296. Notably, the issue mentioned above. resolving that merge conflict will be pretty easy though. ## Validation Steps Performed Used inspect on ConHost and WT. Bounding rects still appear as expected in each model
claunia added the pull-request label 2026-01-31 09:06:09 +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#24929