Repository navigation
Make the transcript editor usable with screen readers - #111
Merged
Merged
Conversation
The transcript renders one span per word, which NVDA and other screen readers can't read or edit as text. A visually hidden textarea now mirrors the kept words (one line per speaker turn) and translates caret moves, selections, and deletions back into editor actions: caret moves seek, selections select words, Backspace / Delete cut, Enter opens Correct, Space plays / pauses, and undo / redo use the editor history. Programmatic edits are announced via a live region. Closes #104 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Closes #104.
The transcript is rendered as one span per word, so NVDA and other screen readers can't read it as text, report where the caret is, or edit it. This PR adds the "bridge" approach suggested in the issue: a visually hidden native textarea that stays in sync with the transcript. Edits made in it are turned into normal editor actions. The visual layout is unchanged.
How it works
Alice: Hello there…). Up/Down moves between speakers and word navigation moves between words. Focusing it reads a label and a usage hint.Cut: test).beforeinput.Changes
components/TranscriptTextLayer.tsx(new): the textarea, keyboard handling and live-region announcements.lib/transcriptText.ts(new): builds the text and maps caret positions to words. Covered bytests/transcript-text-test.ts.components/TranscriptPanel.tsx: mounts the layer. Correct now takes word ids and can hand focus back.hooks/useTranscriptSelection.ts: ignores the page's text selection while the textarea has focus, so it doesn't clear the words selected from it.Limitations
S/@shortcuts aren't available from the textarea.Testing
npx tsx tests/transcript-text-test.ts,npm run test:i18n,tsc --noEmit,npm run lint🤖 Generated with Claude Code