Release 1.14.14 adds word-level text highlighting and scroll-follow during TTS playback on newsroom article pages. When you tap Listen, the current word is highlighted and the view scrolls to keep it in view. Uses the Web Speech API boundary event, React Context for state sharing, and a listen-mode renderer with word spans. Fallback when boundary is unsupported (e.g. Firefox); playback and progress bar continue to work.
जोड़ा गया
- Listen mode highlight and scroll: Word-level text highlighting and scroll-follow during TTS playback on newsroom article pages
- ListenModeContext: Shared state for currentCharRange, isPlaying, and boundarySupported between ArticleListenBar and article body
- ArticleBodyWithListen: Client component that swaps to plain-text-with-word-spans view when playing; highlights current word; scrolls highlighted span into view with throttle and prefers-reduced-motion support
- getArticleCharRanges: Character range mapping in lib/newsroom.ts for listen-mode highlighting; mirrors getArticlePlainText
- PB-54: Backlog item and unit tests for getArticleCharRanges, ArticleBodyWithListen, and ArticleListenBar boundary handler
बदला गया
- ArticleListenBar: Integrates with ListenModeContext; attaches boundary handler to SpeechSynthesisUtterance; syncs currentCharRange and isPlaying; 2.5s timeout to detect unsupported boundary
- Newsroom article page: Uses NewsroomPostClientWrapper with ListenModeProvider and ArticleBodyWithListen for post layout