WIP read aloud keeps playing across chats

This commit is contained in:
2026-12-03 22:18:38 +00:00
parent 81c73275c0
commit f4bd8ad44c
24 changed files with 778 additions and 78 deletions
@@ -143,6 +143,29 @@ void main() {
expect(speech.state, SpeechState.idle);
});
testWidgets('reading names the conversation until the reply ends', (
tester,
) async {
reader();
await speech.read(speechMessageId('chat-1', 'm1'), ['Hi'], title: 'One');
expect(
speech.reading.value,
const SpeechReading(scope: 'chat-1', title: 'One'),
);
speech.retitle('chat-2', 'Other');
expect(speech.reading.value?.title, 'One');
speech.retitle('chat-1', 'Renamed');
expect(speech.reading.value?.title, 'Renamed');
// Another reply replaces it; finishing clears it.
await speech.read(speechMessageId('chat-2', 'm1'), ['Yo'], title: 'Two');
expect(speech.reading.value?.scope, 'chat-2');
engine.onStart!();
engine.onCompletion!();
expect(speech.reading.value, isNull);
expect(speech.state, SpeechState.idle);
});
testWidgets('voice and rate are applied and persist across a reload', (
tester,
) async {