Skip to content

Expose the text to VoiceOver - #22

Merged
servercimen merged 1 commit into
feature/line-limit-alignmentfrom
feature/voiceover
Nov 20, 2026
Merged

servercimen merged 1 commit into
feature/line-limit-alignmentfrom
feature/voiceover

Conversation

@servercimen

@servercimen servercimen commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

TranscriptTextView draws its text with Core Text and set no accessibility properties, so VoiceOver found no text in it.

  • The view is an accessibility container with one UIAccessibilityElement for each block, framed to the block.
  • Headings have the header trait, so they are in the rotor's list of headings. List items start with their number, or with "Checked" or "Unchecked". A thematic break says "Separator".
  • Each link in a block is a custom action that opens it through openLink, and the block has the link trait.
  • A line-limited layout gives only the text that is shown.
  • The elements are made when VoiceOver asks and kept until the layout changes, so a streaming view posts no notifications.
  • The spoken words come from the app's Localizable.strings ("Open %@", "Checked", "Unchecked", "Separator").

Closes #1.

Stack

This PR is part of a stack. It is based on #21 (feature/line-limit-alignment), so its diff shows only this change. Merge the stack in order, starting with #17.

Tests

  • The package builds for iOS. The change is iOS-only, and swift test passes with it in the stack.
  • Checked on an iPhone 12 mini, iOS 27.0, with a sample that has a heading, a link, a numbered item, two task items and a rule. It gives seven elements: "A heading" (header), "A paragraph with a link in it." (link, with the action "Open a link"), "1. The first step", "Checked, A task that is done", "Unchecked, A task that is not", "Separator" and "The end.".
  • Each element's frame in the container's space matches its block, for example (0, 45, 343, 21) for the paragraph. accessibilityFrame reads as zero while VoiceOver is off, because the accessibility runtime computes it from that frame.
  • Checked with VoiceOver running on the iPhone 12 mini. VoiceOver read the seven elements in order, with the words above. The focus outline sat on each block, the headings rotor found the heading, and the "Open a link" action opened the link.

🤖 Generated with Claude Code

TranscriptTextView draws its text with Core Text and set no accessibility
properties, so VoiceOver found no text in it.

The view is now an accessibility container with one element for each
block. Headings have the header trait, list items start with their number
or their task state, and each link in a block is a custom action that
opens it through openLink. An element's frame is its block's frame, and a
line-limited layout gives only the text that is shown. The elements are
made when VoiceOver asks for them and kept until the layout changes, so a
streaming view posts no notifications. The spoken words come from the
app's Localizable.strings.

Closes #1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose the text to VoiceOver

1 participant