Read chat replies aloud with word highlighting

An assistant reply gets Read aloud beside Copy; while it reads it becomes
Pause/Resume and Stop, one reply at a time app-wide. The spoken word is
highlighted in the rendered reply (across multi-part replies) and the
transcript scrolls only when that word leaves the viewport. Reading stops
when its chat closes or is swapped, another reply starts, or the app goes
to the background. Markdown is spoken as sentences; code blocks are
announced as "Code block.".

Speech goes through a SpeechEngine seam with a flutter_tts implementation
(Android, macOS, web; hidden on Linux) and a fake for tests. Settings has
a Read aloud section: a voice picker grouped by language (device language
first, a sample per voice), a rate slider and reset, saved per device.

flutter_tts has no Swift package, so macOS/iOS gain the CocoaPods
integration (Podfiles with the Runner deployment targets); Android
declares the TTS_SERVICE query. The capture fixture gains ?speech=fake.
This commit is contained in:
2026-11-13 01:29:04 +00:00
parent 26e68140fd
commit 6367cce68a
40 changed files with 2643 additions and 29 deletions
+4
View File
@@ -33,6 +33,10 @@ URL parameters (the kit sets them from `open=` and the options):
or script's `params`) adds fixture
options such as `chats=2&rich=1`. Use `route=/settings` to open Settings and then
click `Server health`; the fixture channel returns `server_stats` automatically.
`speech=fake` (with `speechStep=<ms>`, default 600) reads replies aloud with a
scripted engine that reports one word per step, since headless Chrome has no
voices: Read aloud, Pause/Resume/Stop, the word highlight and the Settings
voice list can then be captured.
Without `theme`, the app follows the browser's colour
scheme. `--theme` also sets that colour scheme through Chrome emulation.