mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(voice): keep chat's view across a provider switch and clear stale errors
Switching AI Provider in Settings opened from chat rebuilt the voice control, so Settings fell back to voice and the dock went idle, widening the wings. The switch now carries chat's Settings, or chat itself, to the new provider as it already carries the input mode; the conversation still starts fresh and focus stays on the provider choice. After a voice error, opening chat or closing the voice panel left the dock red on ERROR, because both stopped only an active session. They now also end a session left in error, which returns the dock to idle.
This commit is contained in:
1 parent
4859ba4c94
commit
53ea76251f
7 files changed
+120
-6
No files matched your search
@@ -1298,6 +1298,27 @@ test('undocking while a tray is open brings the panel back as its bar', async (t
|
||||
assert.equal($('#gev-chat-panel').dataset.placement, 'compact');
|
||||
});
|
||||
|
||||
test('opening chat or closing the voice panel clears a stale voice error', async (t) => {
|
||||
for (const leave of ['chat', 'close']) {
|
||||
const f = mounted(t, { view: true });
|
||||
await f.commands.session.start();
|
||||
f.commands.voicePanel.select('preview');
|
||||
f.instances[0].hooks.emit({
|
||||
type: 'state',
|
||||
state: 'error',
|
||||
detail: 'Lost',
|
||||
});
|
||||
await f.settle();
|
||||
assert.equal($('#gev-voice-control').dataset.status, 'error');
|
||||
assert.equal(f.commands.session.isActive(), false);
|
||||
if (leave === 'chat') $('#gev-chat-button').click();
|
||||
else $('#gev-voice-settings-close').click();
|
||||
await f.settle();
|
||||
assert.equal(f.commands.session.state, 'idle', leave);
|
||||
assert.notEqual($('#gev-voice-control').dataset.status, 'error', leave);
|
||||
}
|
||||
});
|
||||
|
||||
test('the voice panel close turns voice off', async (t) => {
|
||||
const f = mounted(t, { view: true });
|
||||
await f.commands.session.start();
|
||||
|
||||
Reference in new issue
Block a user