Fix pilot voice composer flow and typing issues
This commit is contained in:
@@ -852,8 +852,10 @@ async function startPilotMeter(stream: MediaStream) {
|
||||
|
||||
function appendPilotTranscript(text: string) {
|
||||
const next = text.trim();
|
||||
if (!next) return;
|
||||
pilotInput.value = pilotInput.value.trim() ? `${pilotInput.value.trim()} ${next}` : next;
|
||||
if (!next) return "";
|
||||
const merged = pilotInput.value.trim() ? `${pilotInput.value.trim()} ${next}` : next;
|
||||
pilotInput.value = merged;
|
||||
return merged;
|
||||
}
|
||||
|
||||
function getAudioContextCtor(): typeof AudioContext {
|
||||
@@ -1003,11 +1005,11 @@ async function startPilotRecording() {
|
||||
if (audioBlob.size > 0) {
|
||||
const transcript = await transcribeRecordedPilotAudio(audioBlob);
|
||||
if (!transcript) return;
|
||||
if (mode === "send" && !pilotSending.value) {
|
||||
await sendPilotText(transcript);
|
||||
const mergedText = appendPilotTranscript(transcript);
|
||||
if (mode === "send" && !pilotSending.value && mergedText.trim()) {
|
||||
await sendPilotText(mergedText);
|
||||
return;
|
||||
}
|
||||
appendPilotTranscript(transcript);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2551,7 +2553,6 @@ async function decideFeedCard(card: FeedCard, decision: "accepted" | "rejected")
|
||||
v-model="pilotInput"
|
||||
class="pilot-input-textarea"
|
||||
:placeholder="pilotRecording ? 'Recording... speak, then press mic to fill or send to submit' : 'Type a message for Pilot...'"
|
||||
:disabled="pilotTranscribing"
|
||||
@keydown.enter="handlePilotComposerEnter"
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user