mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
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:
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'])]
|
||||
|
||||
|
||||
Reference in new issue
Block a user