Import audio debug drawer

This commit is contained in:
Xin Wang
2026-02-09 17:16:47 +08:00
parent 9cac01e31d
commit b52cd65848

View File

@@ -2000,6 +2000,13 @@ export const DebugDrawer: React.FC<{
</Button> </Button>
</div> </div>
) : callStatus === 'calling' ? ( ) : callStatus === 'calling' ? (
mode === 'voice' ? (
<div className="flex-1 min-h-0 overflow-hidden animate-in fade-in">
<div className="h-[68vh] min-h-[420px] max-h-[68vh] w-full flex flex-col min-h-0 overflow-hidden">
<TranscriptionLog scrollRef={scrollRef} messages={messages} isLoading={isLoading} className="flex-1 min-h-0 h-full" />
</div>
</div>
) : (
<div className="flex-1 flex flex-col items-center justify-center space-y-6"> <div className="flex-1 flex flex-col items-center justify-center space-y-6">
<div className="h-24 w-24 rounded-full bg-primary/20 flex items-center justify-center animate-bounce"> <div className="h-24 w-24 rounded-full bg-primary/20 flex items-center justify-center animate-bounce">
<PhoneCall className="h-10 w-10 text-primary" /> <PhoneCall className="h-10 w-10 text-primary" />
@@ -2010,6 +2017,7 @@ export const DebugDrawer: React.FC<{
</div> </div>
<Button onClick={handleHangup} variant="destructive" className="rounded-full h-10 px-8"></Button> <Button onClick={handleHangup} variant="destructive" className="rounded-full h-10 px-8"></Button>
</div> </div>
)
) : ( ) : (
<div className="flex-1 flex flex-col min-h-0 space-y-2"> <div className="flex-1 flex flex-col min-h-0 space-y-2">
{mode === 'voice' ? ( {mode === 'voice' ? (
@@ -2046,11 +2054,11 @@ export const DebugDrawer: React.FC<{
)} )}
</div> </div>
<div className={mode === 'text' && textSessionStarted ? 'shrink-0 mt-3 px-1 mb-3' : 'shrink-0 space-y-2 mt-2 px-1 mb-3'}> <div className={mode === 'text' && textSessionStarted ? 'shrink-0 mt-3 px-1 mb-3' : mode === 'voice' ? 'shrink-0 space-y-3 mt-3 px-1 mb-3' : 'shrink-0 space-y-2 mt-2 px-1 mb-3'}>
{mode === 'voice' && ( {mode === 'voice' && (
<div className="w-full"> <div className="w-full flex items-center gap-2 pb-1">
<select <select
className="w-full text-xs bg-white/5 border border-white/10 rounded px-2 py-1 text-foreground" className="flex-1 text-xs bg-white/5 border border-white/10 rounded px-2 py-1 text-foreground"
value={selectedMic} value={selectedMic}
onChange={(e) => setSelectedMic(e.target.value)} onChange={(e) => setSelectedMic(e.target.value)}
> >
@@ -2058,6 +2066,26 @@ export const DebugDrawer: React.FC<{
<option key={d.deviceId} value={d.deviceId}>{d.label || 'Mic'}</option> <option key={d.deviceId} value={d.deviceId}>{d.label || 'Mic'}</option>
))} ))}
</select> </select>
<div
className={`px-2 py-1 rounded border text-[11px] inline-flex items-center gap-1.5 whitespace-nowrap ${
callStatus === 'active'
? 'border-green-500/40 bg-green-500/10 text-green-300'
: callStatus === 'calling'
? 'border-amber-500/40 bg-amber-500/10 text-amber-200'
: 'border-white/10 bg-black/20 text-muted-foreground'
}`}
>
<span
className={`h-1.5 w-1.5 rounded-full ${
callStatus === 'active'
? 'bg-green-400 animate-pulse'
: callStatus === 'calling'
? 'bg-amber-300 animate-pulse'
: 'bg-muted-foreground/60'
}`}
/>
{callStatus === 'active' ? '通话中' : callStatus === 'calling' ? '连接中...' : '未开始'}
</div>
</div> </div>
)} )}
<div className="w-full flex items-center gap-2 min-w-0"> <div className="w-full flex items-center gap-2 min-w-0">