Repository navigation
feat(chat): add read-aloud support for assistant messages - #94
Open
manar-alsayedali wants to merge 1 commit into
Open
manar-alsayedali wants to merge 1 commit into
manar-alsayedali wants to merge 1 commit into
Conversation
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.
What this changes
Adds an icon-only Read Aloud control beneath completed assistant messages in the main chat transcript, including first-day answers.
Clicking the speaker reads the message; clicking Stop cancels playback. Starting another message stops the previous one. Playback also stops when switching conversations, removing or replacing the message, or starting a new response. Speech never starts automatically.
The control uses the existing button and icon components, accessible labels, native tooltips, and keyboard support. Playback failures produce a visible, screen-reader-accessible alert. Controls are hidden during streaming and in unsupported browsers.
Implementation uses the browser’s native SpeechSynthesis API and the existing Markdown parser dependencies. Markdown is converted to speech text, omitting fenced code, raw HTML markup, and URL-only links. No dependencies, backend changes, API keys, or paid services are added.
Limitations
Where it runs
Boundary and audit
No agent actions, authorization boundaries, or server audit behavior change. Speech failures are handled locally in the UI; message text is not sent to an application TTS endpoint.
Changelog
No server deployment or configuration changes are required. This adds an optional browser-side message control.
Proof
git diff --checkpassed.Tests cover playback switching, stale callbacks, cleanup, multiple transcript instances, streaming, unsupported browsers, errors, Markdown conversion, keyboard activation under Strict Mode, and the first-day assistant rendering path.