fix(frontend): address CodeRabbit review findings on voice conversation mode

Report STT start and capture failures instead of staying on Listening, treat a failed reading as an error, skip replies with no readable text, stop auto-play replaying a reply voice mode already read, focus the text box after Edit in text box, and strip think blocks before text reaches TTS.
This commit is contained in:
Chris Scott committed 2026-10-22 20:36:01 -04:00
1 parent 5d8b2c9445
commit 73af7aec89
8 files changed
+292 -45

No files matched your search

@@ -520,6 +520,27 @@ describe('listUnspokenMessages', () => {
expect(listUnspokenMessages(messages, null, new Set())).toEqual([{ id: 'a2', text: 'Spoken' }])
})
it('excludes an inline think block from the spoken text', () => {
const messages = [
user('u1', 'hi', 1),
assistant('a1', 2, 3, ['The answer is ready <think>hidden reasoning</think> and verified']),
]
expect(listUnspokenMessages(messages, null, new Set())).toEqual([
{ id: 'a1', text: 'The answer is ready and verified' },
])
})
it('skips a completed reply that only contains a think block', () => {
const messages = [
user('u1', 'hi', 1),
assistant('a1', 2, 3, ['<think>hidden reasoning</think>']),
assistant('a2', 4, 5, ['Spoken']),
]
expect(listUnspokenMessages(messages, null, new Set())).toEqual([{ id: 'a2', text: 'Spoken' }])
})
it('considers the whole transcript when the baseline is null', () => {
const messages = [user('u1', 'only turn', 1), assistant('a1', 2, 3, ['The answer'])]