fix(voice): show the voice panel that typed chat asks for

set_panel_open for voice-settings or voice-preview reported success while
chat's open state kept the voice panel hidden, minimized chat included. A
successful explicit show now closes chat, which keeps the typed session,
its running turn and its messages; reopening chat restores them.
This commit is contained in:
Sameh Khamis committed 2026-11-03 15:54:54 -08:00
1 parent b6967a3dd9
commit 4f4af9c4e0
3 files changed
+72 -4

No files matched your search

+14 -1
View File
@@ -157,7 +157,20 @@ export function createVoiceCommands({
controls.voiceCard = card;
if (panelMount) {
controls.voicePanel = panelMount.panel;
controls.captureVoicePanelOperation = panelMount.captureOperation;
// An explicit, successful show hands the frame from chat to the voice
// panel, which chat's open state hides. Closing chat keeps its typed
// session, running turn and messages; reopening chat restores them.
controls.captureVoicePanelOperation = () => {
const operation = panelMount.captureOperation();
return {
...operation,
show(view, open = true) {
const result = operation.show(view, open);
if (open && result.ok) chat?.close();
return result;
},
};
};
controls.getVoicePanelState = panelMount.snapshot;
controls.getVoicePreferences = panelHost.snapshot;
}