Accessibility: word navigation and search in the UIA text provider#543
Merged
Conversation
Screen readers can now move by word and search the terminal. Adds a real Word text unit (word plus trailing whitespace, bounded by the next word start) and FindText over the current range, both as pure logic in Ghostty.Core with unit tests. The range provider maps the Word unit through and delegates the search. No native changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on the merged UIA text provider with the navigation half of the text
pattern, so screen readers can move and search word by word.
Adds a real Word text unit: a word is the run starting at a non-whitespace
character whose previous character is whitespace, and a word unit covers the
word plus its trailing whitespace up to the next word start. Whitespace includes
newlines, so words never cross a line. ExpandToEnclosingUnit and
MoveEndpointByUnit both handle the Word unit now, with the same clamping and
signed move count as the existing Character and Line units.
Adds FindText: search the current range for a string, forward or backward, case
sensitive or not, returning the matching range or null.
The word boundary logic and the search are pure types in Ghostty.Core with unit
tests. The range provider maps the Word unit through and delegates the search.
No native changes.
Color text attributes are intentionally not included. UIA would map a range to
per cell colors, but read_cells only covers the viewport while the document is
the full screen including scrollback, so scrollback text has no cell data and
the viewport offset mapping is unreliable. macOS exposes no colors either. Left
as an optional follow up.
Verified locally:
through the automation tree confirmed ExpandToEnclosingUnit(Word) returns a
single word and FindText finds a known word.
Left for manual testing: a real pass with NVDA and JAWS.