Skip to content

Make the transcript editor usable with screen readers - #111

Merged
wassgha merged 1 commit into
mainfrom
minnetonka
Oct 5, 2026
Merged

wassgha merged 1 commit into
mainfrom
minnetonka

Conversation

@wassgha

@wassgha wassgha commented Oct 5, 2026

Copy link
Copy Markdown
Owner

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

  • The textarea comes right after the transcript header in Tab order. It holds the words that will be exported, one line per speaker turn (Alice: Hello there…). Up/Down moves between speakers and word navigation moves between words. Focusing it reads a label and a usage hint.
  • Moving the caret seeks the playhead to the word under it. When the textarea gets focus, the caret starts on the word that is currently playing.
  • Shift-selecting text selects those words in the editor. The visual transcript highlights them.
  • Backspace / Delete cut words. With a selection, every word it touches is cut. With no selection, they cut the word before or after the caret. The cut is announced through a live region (Cut: test).
  • Enter opens the existing Correct popup. Focus returns to the textarea when it closes.
  • Space plays or pauses. ⌘/Ctrl+Z (⇧ to redo) uses the editor's undo history and is announced.
  • Typing is blocked, so the text always matches the edit. Every way of editing (keys, Cut, the Edit menu) is intercepted in beforeinput.
  • Sighted keyboard users get an outline around the transcript panel while the textarea has focus.

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 by tests/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.
  • New strings in all 9 locales. The non-English translations should get a quick review.

Limitations

  • Cut words aren't in the textarea, so in text mode they can only be brought back with Undo.
  • Split, speaker reassignment and the 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
  • Drove the textarea with the keyboard in headless Chrome: word and line navigation, selection syncing to word highlights, cutting with and without a selection, blocked typing, undo, Enter → Correct → focus back, Space playing the media.
  • Not yet tried with a real screen reader. It would be good to have the issue's author try a build with NVDA.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
app.rescript Ready Ready Preview Oct 5, 2026 12:57am UTC

@wassgha
wassgha merged commit 4ffcdd4 into main Oct 5, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — 05f48494 Deployed Oct 5, 2026 by vercel[bot]
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.

Feedback: Making the transcript editor accessible for the visually impaired community (NVDA/Screen Readers)

1 participant