feat(room): read a message aloud via browser speech synthesis (LC-528) #500
Loading…
Reference in a new issue
No description provided.
Delete branch "longjacksonle/feat/LC-528-read-aloud-messages"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a "Read aloud" item to the message overflow menu that speaks the message's rendered text using the browser SpeechSynthesis API. Entirely client-side: no route, no DB, no LLM. Clicking again (or reading another message) stops; the label toggles to "Stop reading" while speaking. The utterance uses the page's resolved locale as its
lang.The item only renders for messages with a text body, and is CSS-hidden (
.lc-no-ttson<html>, set once by live.js) when the browser has no speech synthesis, so it never fails silently on click. A delegated handler in live.js covers live-swapped message fragments, and speech is stopped when the message being read leaves the DOM (delete, room switch, reconnect soft-refresh) or the page is navigated away.Reuses the existing overflow-menu partial, the live.js delegated-listener pattern, and the CSS ancestor-gate approach used for the LC-486 translate item. New i18n keys room-msg-read-aloud / room-msg-stop-reading added to en + es catalogs.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01NTRhc4n7A2uB2Y5PHV2ewL