diff --git a/frontend/src/components/ChatInput.tsx b/frontend/src/components/ChatInput.tsx index d92ef93..ec3459c 100644 --- a/frontend/src/components/ChatInput.tsx +++ b/frontend/src/components/ChatInput.tsx @@ -22,6 +22,8 @@ interface Props { initialText?: string; cwd?: string; voice?: UseVoiceReturn; + branch?: string; + isWorktree?: boolean; } export function ChatInput({ @@ -32,6 +34,8 @@ export function ChatInput({ initialText, cwd, voice, + branch, + isWorktree, }: Props) { const [text, setText] = useState(initialText || ''); const [images, setImages] = useState([]); @@ -150,6 +154,24 @@ export function ChatInput({ const canSend = text.trim() || images.length > 0; + const micProps = voice + ? { + available: voice.available, + recording: voice.recording, + transcribing: voice.transcribing, + micBlocked: voice.micBlocked, + onRecordStart: voice.startRecording, + onRecordStop: async () => { + const transcript = await voice.stopRecording(); + if (transcript) { + setText((prev) => (prev ? `${prev} ${transcript}` : transcript)); + textareaRef.current?.focus(); + } + }, + onRecordCancel: voice.cancelRecording, + } + : null; + function handleInterrupt() { if (!onInterrupt) return; const trimmed = text.trim(); @@ -191,54 +213,46 @@ export function ChatInput({ {voice?.recording && voice.partialTranscript && (
{voice.partialTranscript}
)} -
-
- - + + + {micProps && } + {branch && ( + - + - - -
- {voice && ( - { - const transcript = await voice.stopRecording(); - if (transcript) { - setText((prev) => (prev ? `${prev} ${transcript}` : transcript)); - textareaRef.current?.focus(); - } - }} - onRecordCancel={voice.cancelRecording} - /> + {branch} + )} +
+