diff --git a/src/extension.ts b/src/extension.ts index 3d3f9f845..728facdcc 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1180,12 +1180,16 @@ export async function activate(context: vscode.ExtensionContext) { context.subscriptions.push( vscode.commands.registerCommand("codex-editor-extension.generateTranscriptions", async () => { const countInput = await vscode.window.showInputBox({ - prompt: "How many cells to transcribe?", - placeHolder: "e.g., 5", - validateInput: (val) => (val && !isNaN(Number(val)) && Number(val) >= 1 ? undefined : "Enter a positive number"), + prompt: "How many cells to transcribe? (0 or blank = all untranscribed cells)", + placeHolder: "0 for all, or a specific number", + value: "0", + validateInput: (val) => { + if (!val || val.trim() === "") return undefined; + return !isNaN(Number(val)) && Number(val) >= 0 ? undefined : "Enter 0 for all, or a positive number"; + }, }); - if (!countInput) return; - const count = Math.max(1, Math.floor(Number(countInput))); + if (countInput === undefined) return; // user cancelled + const count = Math.max(0, Math.floor(Number(countInput || 0))); const provider = GlobalProvider.getInstance().getProvider("codex-cell-editor") as CodexCellEditorProvider | undefined; if (!provider) { @@ -1194,7 +1198,10 @@ export async function activate(context: vscode.ExtensionContext) { } provider.postMessageToWebviews({ type: "startBatchTranscription", content: { count } } as any); - vscode.window.showInformationMessage(`Starting transcription for up to ${count} cells...`); + const label = count > 0 ? `up to ${count}` : "all untranscribed"; + vscode.window.showInformationMessage( + `Starting transcription for ${label} cells... First request may take ~45s to warm up.` + ); }) ); diff --git a/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts b/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts index 760083a4f..7e6e23246 100644 --- a/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts +++ b/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts @@ -406,10 +406,11 @@ const messageHandlers: Record Promise("asrLanguage", "eng"); + debug(`[getAsrConfig] Sending config: endpoint=${endpoint}, hasToken=${!!authToken}, language=${language}`); safePostMessageToPanel(webviewPanel, { type: "asrConfig", - content: { endpoint, authToken } + content: { endpoint, authToken, language } }); } catch (error) { console.error("Error sending ASR config:", error); @@ -429,6 +430,19 @@ const messageHandlers: Record Promise { + const count = (event as any).content?.count ?? 0; + // Forward to the webview as a startBatchTranscription message + safePostMessageToPanel(webviewPanel, { + type: "startBatchTranscription", + content: { count }, + } as any); + const label = count > 0 ? `up to ${count}` : "all untranscribed"; + vscode.window.showInformationMessage( + `Starting transcription for ${label} cells... First request may take ~45s to warm up.` + ); + }, + updateCellAfterTranscription: async ({ event, document, webviewPanel, provider }) => { const typedEvent = event as Extract; const { cellId, transcribedText, language } = typedEvent.content; diff --git a/webviews/codex-webviews/src/CodexCellEditor/AudioWaveformWithTranscription.tsx b/webviews/codex-webviews/src/CodexCellEditor/AudioWaveformWithTranscription.tsx index e658762c4..47978831f 100644 --- a/webviews/codex-webviews/src/CodexCellEditor/AudioWaveformWithTranscription.tsx +++ b/webviews/codex-webviews/src/CodexCellEditor/AudioWaveformWithTranscription.tsx @@ -33,6 +33,7 @@ interface AudioWaveformWithTranscriptionProps { isTranscribing: boolean; transcriptionProgress: number; onTranscribe: () => void; + onTranscribeAll?: () => void; onInsertTranscription: () => void; disabled?: boolean; onRequestRemove?: () => void; @@ -50,6 +51,7 @@ const AudioWaveformWithTranscription: React.FC {!transcription && !isTranscribing && ( - + <> + + {onTranscribeAll && ( + + )} + )}