[PR #4495] [MERGED] UIA: Fix GetVisibleRanges() and add Tracing #25786

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4495
Author: @carlos-zamora
Created: 2/6/2020
Status: Merged
Merged: 2/20/2020
Merged by: @undefined

Base: masterHead: dev/cazamor/uia-tracing


📝 Commits (10+)

📊 Changes

11 files changed (+780 additions, -1237 deletions)

View changed files

📝 src/host/renderData.cpp (+1 -1)
📝 src/host/tracing.cpp (+0 -716)
📝 src/host/tracing.hpp (+0 -39)
📝 src/types/ScreenInfoUiaProviderBase.cpp (+38 -87)
📝 src/types/ScreenInfoUiaProviderBase.h (+0 -45)
📝 src/types/UiaTextRangeBase.cpp (+112 -241)
📝 src/types/UiaTextRangeBase.hpp (+8 -107)
src/types/UiaTracing.cpp (+516 -0)
src/types/UiaTracing.h (+96 -0)
📝 src/types/lib/types.vcxproj (+2 -0)
📝 src/types/lib/types.vcxproj.filters (+7 -1)

📄 Description

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

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4495 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 2/6/2020 **Status:** ✅ Merged **Merged:** 2/20/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/cazamor/uia-tracing` --- ### 📝 Commits (10+) - [`e21d74c`](https://github.com/microsoft/terminal/commit/e21d74c51e5a35b05a33651d5ec2ad5d7d7dd115) add tracing for UIA (UTR and SIUP) - [`c4a2ac0`](https://github.com/microsoft/terminal/commit/c4a2ac03322a2b57bd047734d523b371949c5697) abs fix - [`8a79984`](https://github.com/microsoft/terminal/commit/8a7998433987950940338d3507f7e6ec2e18663e) static analysis fix - [`e0d0f82`](https://github.com/microsoft/terminal/commit/e0d0f82d419d6c336b4a38052daff110d1a8a68d) static analysis fix - [`44a0ff1`](https://github.com/microsoft/terminal/commit/44a0ff1744429a9247679744f2bddf40243f6728) PR comments - [`af514b6`](https://github.com/microsoft/terminal/commit/af514b6aa9d44246d0341c0812bbec13adcde512) code format - [`be125b4`](https://github.com/microsoft/terminal/commit/be125b4e5465c0a5c11628f9330059fd00bf6561) Make GetVisibleRanges() return one range (and add tracing for it). (#4526) - [`e184299`](https://github.com/microsoft/terminal/commit/e1842994811b785f80691314838218ec61297366) PR nit - [`a8f7d1c`](https://github.com/microsoft/terminal/commit/a8f7d1c659dcea8730199aa5054fd3cfdf8fadc2) Code format - [`fbca909`](https://github.com/microsoft/terminal/commit/fbca9093bc9f7fb2ae095676ae9a7d46a01024d1) merge master ### 📊 Changes **11 files changed** (+780 additions, -1237 deletions) <details> <summary>View changed files</summary> 📝 `src/host/renderData.cpp` (+1 -1) 📝 `src/host/tracing.cpp` (+0 -716) 📝 `src/host/tracing.hpp` (+0 -39) 📝 `src/types/ScreenInfoUiaProviderBase.cpp` (+38 -87) 📝 `src/types/ScreenInfoUiaProviderBase.h` (+0 -45) 📝 `src/types/UiaTextRangeBase.cpp` (+112 -241) 📝 `src/types/UiaTextRangeBase.hpp` (+8 -107) ➕ `src/types/UiaTracing.cpp` (+516 -0) ➕ `src/types/UiaTracing.h` (+96 -0) 📝 `src/types/lib/types.vcxproj` (+2 -0) 📝 `src/types/lib/types.vcxproj.filters` (+7 -1) </details> ### 📄 Description ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:11:46 +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#25786