Add attachment text extraction, auto web news skill, and chat/voice UI updates.
Simplify asset upload temp paths, refresh deploy docs for Aliyun DNS topology, and ship MindSpace content-scan and auth improvements. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -41,6 +41,7 @@ export function VoiceInputButton({
|
||||
onVoiceComplete,
|
||||
onRecordingChange,
|
||||
onError,
|
||||
stopSignal = 0,
|
||||
}: {
|
||||
disabled?: boolean;
|
||||
onTranscript?: (text: string) => void;
|
||||
@@ -49,6 +50,7 @@ export function VoiceInputButton({
|
||||
onVoiceComplete?: () => void;
|
||||
onRecordingChange?: (recording: boolean) => void;
|
||||
onError?: (message: string) => void;
|
||||
stopSignal?: number;
|
||||
}) {
|
||||
const [available, setAvailable] = useState(true);
|
||||
const [browserActive, setBrowserActive] = useState(false);
|
||||
@@ -62,6 +64,7 @@ export function VoiceInputButton({
|
||||
const startingRef = useRef(false);
|
||||
const browserCommittedRef = useRef(false);
|
||||
const prevRecordingRef = useRef(false);
|
||||
const lastStopSignalRef = useRef(stopSignal);
|
||||
|
||||
useEffect(() => {
|
||||
setAvailable(isVoiceInputAvailable());
|
||||
@@ -131,6 +134,19 @@ export function VoiceInputButton({
|
||||
resetSession();
|
||||
}, [browserActive, resetSession, wechatMode]);
|
||||
|
||||
useEffect(() => {
|
||||
if (stopSignal === lastStopSignalRef.current) return;
|
||||
lastStopSignalRef.current = stopSignal;
|
||||
setBrowserActive(false);
|
||||
if (wechatMode) {
|
||||
void stopWechatVoiceRecord().catch(() => {
|
||||
// best-effort stop when the parent explicitly ends the current draft
|
||||
});
|
||||
setWechatPhase('idle');
|
||||
pendingWechatStopRef.current = false;
|
||||
}
|
||||
}, [stopSignal, wechatMode]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!wechatMode) return;
|
||||
let cancelled = false;
|
||||
|
||||
Reference in New Issue
Block a user