[PR #11122] [MERGED] [A11y] Treat last character as 'end of buffer' #28424

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11122
Author: @carlos-zamora
Created: 9/2/2021
Status: ✅ Merged
Merged: 9/16/2021
Merged by: @undefined

Base: main ← Head: dev/cazamor/a11y-7000/document-end


📝 Commits (6)

📊 Changes

10 files changed (+2064 additions, -710 deletions)

View changed files

📝 .github/actions/spelling/allow/allow.txt (+3 -0)
📝 src/buffer/out/textBuffer.cpp (+104 -58)
📝 src/buffer/out/textBuffer.hpp (+8 -8)
📝 src/interactivity/win32/ut_interactivity_win32/GeneratedUiaTextRangeMovementTests.g.cpp (+1334 -294)
📝 src/interactivity/win32/ut_interactivity_win32/UiaTextRangeTests.cpp (+178 -85)
📝 src/types/UiaTextRangeBase.cpp (+120 -60)
📝 src/types/UiaTextRangeBase.hpp (+2 -1)
📝 tools/TestTableWriter/GenerateTests.ps1 (+30 -9)
📝 tools/TestTableWriter/README.md (+18 -13)
📝 tools/TestTableWriter/UiaTests.csv (+267 -182)

📄 Description

Summary of the Pull Request

Updates our UiaTextRange to no longer treat the end of the buffer as the "document end". Instead, we consider the "document end" to be the line beneath the cursor or last legible character (whichever is further down). In the event where the last legible character is on the last line of the buffer, we use the "end exclusive" position (left-most point on a line one past the end of the buffer).

When movement of any kind occurs, we clamp each endpoint to the document end. Since the document end is an actual spot in the buffer (most of the time), this should improve stability because we shouldn't be pointing out-of-bounds anymore.

The biggest benefit is that this significantly improves the performance of word navigation because screen readers no longer have to take into account the whitespace following the end of the prompt.

Word navigation tests were added to the TestTableWriter (see #10886). 24 of the 85 tests were failing, however, they don't seem to interact with the document end, so I've marked them as skip and will fix them in a follow-up. This PR is large enough as-is, so I'm hoping I can take time in the follow-up to clean some things on the side (aka preventBoundary and allowBottomExclusive being used interchangeably).

References

#7000 - Epic
Closes #6986
Closes #10925

Validation Steps Performed

  • Tests pass
  • @codeofdusk has been personally testing this build (and others)

🔄 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/11122 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 9/2/2021 **Status:** ✅ Merged **Merged:** 9/16/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/cazamor/a11y-7000/document-end` --- ### 📝 Commits (6) - [`b6e2da4`](https://github.com/microsoft/terminal/commit/b6e2da420f009aba390ab4f4abe09e20c13c4f83) [A11y] Treat last character as 'end of buffer' - [`dae317b`](https://github.com/microsoft/terminal/commit/dae317b8ccd65aae49b8d20d31b4a287bd40361a) fix tests - [`aa4f7d5`](https://github.com/microsoft/terminal/commit/aa4f7d5ebfe96438b23d618a2084cce3b4bf674a) fix some variable/function names - [`8c40303`](https://github.com/microsoft/terminal/commit/8c4030384d8de0a6cca8d2f6eee2a6f4ffa79f34) static analysis - [`17c414d`](https://github.com/microsoft/terminal/commit/17c414d2efa48537eb1a02d782bc7aebeab5e4c9) fix failing GetWordEnd test - [`531c6de`](https://github.com/microsoft/terminal/commit/531c6de7902936b2e047dedd5dc311dc0fc08a4b) address miniksa feedback ### 📊 Changes **10 files changed** (+2064 additions, -710 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/allow/allow.txt` (+3 -0) 📝 `src/buffer/out/textBuffer.cpp` (+104 -58) 📝 `src/buffer/out/textBuffer.hpp` (+8 -8) 📝 `src/interactivity/win32/ut_interactivity_win32/GeneratedUiaTextRangeMovementTests.g.cpp` (+1334 -294) 📝 `src/interactivity/win32/ut_interactivity_win32/UiaTextRangeTests.cpp` (+178 -85) 📝 `src/types/UiaTextRangeBase.cpp` (+120 -60) 📝 `src/types/UiaTextRangeBase.hpp` (+2 -1) 📝 `tools/TestTableWriter/GenerateTests.ps1` (+30 -9) 📝 `tools/TestTableWriter/README.md` (+18 -13) 📝 `tools/TestTableWriter/UiaTests.csv` (+267 -182) </details> ### 📄 Description ## Summary of the Pull Request Updates our `UiaTextRange` to no longer treat the end of the buffer as the "document end". Instead, we consider the "document end" to be the line beneath the cursor or last legible character (whichever is further down). In the event where the last legible character is on the last line of the buffer, we use the "end exclusive" position (left-most point on a line one past the end of the buffer). When movement of any kind occurs, we clamp each endpoint to the document end. Since the document end is an actual spot in the buffer (most of the time), this should improve stability because we shouldn't be pointing out-of-bounds anymore. The biggest benefit is that this significantly improves the performance of word navigation because screen readers no longer have to take into account the whitespace following the end of the prompt. Word navigation tests were added to the `TestTableWriter` (see #10886). 24 of the 85 tests were failing, however, they don't seem to interact with the document end, so I've marked them as skip and will fix them in a follow-up. This PR is large enough as-is, so I'm hoping I can take time in the follow-up to clean some things on the side (aka `preventBoundary` and `allowBottomExclusive` being used interchangeably). ## References #7000 - Epic Closes #6986 Closes #10925 ## Validation Steps Performed - [X] Tests pass - [X] @codeofdusk has been personally testing this build (and others) --- <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:28:27 +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#28424