Add support for voice-input refinement prompts, and other improvements to Temrinal

This commit is contained in:
James Babcock committed 2026-07-14 15:57:14 -07:00
1 parent 915aa78653
commit 1550c0ca32
9 files changed
+680 -36

No files matched your search

+10 -3
View File
@@ -422,7 +422,7 @@ class Shell {
next?.requestRender();
}
private openVoiceDialog(): void {
private openVoiceDialog(finishOnClick = false): void {
const layer = new VoiceInputLayer(
this.config.actions,
() => {
@@ -431,6 +431,7 @@ class Shell {
}
},
(text) => this.sendTextToForegroundWindow(text),
finishOnClick,
);
this.activeVoiceLayer = layer;
this.stack.push(layer);
@@ -447,8 +448,14 @@ class Shell {
const items: MenuItem[] = [
{
label: "Voice input",
onSelect: () => {
this.openVoiceDialog();
onSelect: (ctx) => {
// Pop the menu first (its onRemoved yields focus to the sidebar),
// then take focus back: the transcript is aimed at the window the
// menu was opened over. The button is no longer held here, so the
// dialog finishes on click instead of long-press-release.
ctx.stack.pop();
this.focus = "window";
this.openVoiceDialog(true);
},
},
];
+11
View File
@@ -20,6 +20,11 @@ export type WorkerAppMessage =
export type WorkerAppReply =
| { type: "yield-focus"; windowId: string }
| {
/** Foreground and focus one of the app's existing windows. */
type: "focus-window";
windowId: string;
}
| {
/** App-initiated window (e.g. a terminal view opened from the hub list). */
type: "open-window-request";
@@ -84,6 +89,12 @@ export class WorkerAppHost {
shell.yieldFocusToSidebar();
}
break;
case "focus-window":
if (this.openWindows.has(message.windowId)) {
shell.focusWindow(message.windowId);
this.options.requestShellRender();
}
break;
case "open-window-request":
this.openWindow({
windowId: message.windowId,