Repository navigation
Read a selection aloud from the quote popup #17978
dkrisman
started this conversation in
Feature Requests & Suggestions
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Selecting text in a message shows a small popup with Add to chat. When
text-to-speech is enabled, I'd like a Read aloud button under it that reads
just the selected text, using the user's TTS engine, voice and speed.
Why: Read aloud today is all or nothing per message. On a long answer you often
want only one paragraph, a recipe step, or a list read out, and the only option
is to sit through the whole message.
How it would work:
buttons sit as one stack beside the selection, so neither covers it, and they
share the existing touch press/release handling.
screen-reader-only labels are skipped, blocks get a pause between them, and a
web-search citation chip or source card is read once as "Hyperlink: <title>"
instead of its label plus "More details about <title>".
since the native selection is cleared so the quote popup doesn't reopen), and
a Stop button sits over it. Esc stops too.
engine, the text is requested one sentence at a time and appended to a single
MediaSource, so the end of each sentence in the audio is known; the browser
engine reports word boundaries directly.
Areas affected:
client/src/components/Chat/Input/QuoteButton.tsx(the popup),a new read-a-selection hook beside the existing TTS hooks, a
data-citation-labelattribute on citation chips and source cards(
components/Web/SourceHovercard.tsx,Sources.tsx), and a small CSS rule forthe highlight. No server or config changes.
I have this running on a self-hosted v0.8.8 instance, with tests for the
popup and the reading hook, and would be glad to adapt it to
mainand open aPR if this is something you'd take.
All reactions