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
@@ -47,6 +47,7 @@ import 'perf/perf_fixture.dart';
import 'probe_folder_fixture.dart';
import 'probe_files_fixture.dart';
import 'probe_usage_fixture.dart';
import 'probe_speech_fixture.dart';
/// The run every run-scoped hit names. Its recorded sequences are deliberately
/// not its row indexes (plan 5, build 2, plan 1), exactly like the unit
@@ -786,6 +787,8 @@ class _FixtureSink implements WebSocketSink {
/// `?terminal=float` opens them at launch (tool/perf/terminal_fixture.dart);
/// `?windows=N` opens N floating probe windows whose content opens every
/// kind of popup and a pushed page (tool/capture/window_probe.dart);
/// `?speech=fake` reads replies aloud with a scripted engine, one word per
/// `?speechStep=` ms (tool/probe_speech_fixture.dart);
/// `?theme=dark` / `?theme=light` pins the platform brightness the app's
/// `ThemeMode.system` follows (omitted: the browser's color scheme).
///
@@ -806,6 +809,7 @@ Future<void> main() async {
return;
}
configurePerfFixture(params);
installSpeechFixture(params);
if (params['files'] == '1') {
probeMissingRememberedFolder = params['filesMissing'] == '1';
installFilesFixture();