Text records scrollable

This commit is contained in:
Xin Wang
2026-02-09 13:18:36 +08:00
parent d657a21024
commit 2bbe659897

View File

@@ -1599,7 +1599,7 @@ export const DebugDrawer: React.FC<{
}, [isOpen, assistant, voices, llmModels, asrModels]); }, [isOpen, assistant, voices, llmModels, asrModels]);
const TranscriptionLog = ({ className = '' }: { className?: string }) => ( const TranscriptionLog = ({ className = '' }: { className?: string }) => (
<div ref={scrollRef} className={`overflow-y-auto space-y-4 p-2 border border-white/5 rounded-md bg-black/20 min-h-0 ${className}`}> <div ref={scrollRef} className={`overflow-y-auto overflow-x-hidden space-y-4 p-2 border border-white/5 rounded-md bg-black/20 min-h-0 custom-scrollbar ${className}`}>
{messages.length === 0 && <div className="text-center text-muted-foreground text-xs py-4"></div>} {messages.length === 0 && <div className="text-center text-muted-foreground text-xs py-4"></div>}
{messages.map((m, i) => ( {messages.map((m, i) => (
<div key={i} className={`flex ${m.role === 'user' ? 'justify-end' : 'justify-start'}`}> <div key={i} className={`flex ${m.role === 'user' ? 'justify-end' : 'justify-start'}`}>
@@ -1699,9 +1699,9 @@ export const DebugDrawer: React.FC<{
<div className={`flex-1 overflow-hidden flex flex-col min-h-0 ${mode === 'text' && textSessionStarted ? 'mb-0' : 'mb-4'}`}> <div className={`flex-1 overflow-hidden flex flex-col min-h-0 ${mode === 'text' && textSessionStarted ? 'mb-0' : 'mb-4'}`}>
{mode === 'text' ? ( {mode === 'text' ? (
textSessionStarted ? ( textSessionStarted ? (
<div className="flex-1 min-h-0 overflow-hidden animate-in fade-in"> <div className="flex-1 min-h-0 overflow-hidden animate-in fade-in flex flex-col">
<div className="h-[68vh] min-h-[420px] max-h-[68vh] w-full overflow-hidden"> <div className="h-[68vh] min-h-[420px] max-h-[68vh] w-full flex flex-col min-h-0 overflow-hidden">
<TranscriptionLog className="h-full" /> <TranscriptionLog className="flex-1 min-h-0 h-full" />
</div> </div>
</div> </div>
) : wsStatus === 'connecting' ? ( ) : wsStatus === 'connecting' ? (
@@ -1766,18 +1766,18 @@ export const DebugDrawer: React.FC<{
) : ( ) : (
<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' ? (
<div className="flex flex-col h-full animate-in fade-in"> <div className="flex flex-col h-full min-h-0 animate-in fade-in">
<div className="h-1/3 min-h-[150px] shrink-0 border border-white/5 rounded-md bg-black/20 flex flex-col items-center justify-center text-muted-foreground space-y-4 mb-2 relative overflow-hidden"> <div className="h-1/3 min-h-[150px] shrink-0 border border-white/5 rounded-md bg-black/20 flex flex-col items-center justify-center text-muted-foreground space-y-4 mb-2 relative overflow-hidden">
<div className="h-24 w-24 rounded-full bg-primary/10 flex items-center justify-center animate-pulse relative z-10"> <div className="h-24 w-24 rounded-full bg-primary/10 flex items-center justify-center animate-pulse relative z-10">
<Mic className="h-10 w-10 text-primary" /> <Mic className="h-10 w-10 text-primary" />
</div> </div>
<p className="text-sm relative z-10">...</p> <p className="text-sm relative z-10">...</p>
</div> </div>
<h4 className="text-xs font-medium text-muted-foreground px-1 mb-1 uppercase tracking-tight"></h4> <h4 className="text-xs font-medium text-muted-foreground px-1 mb-1 uppercase tracking-tight shrink-0"></h4>
<TranscriptionLog className="flex-1 min-h-0" /> <TranscriptionLog className="flex-1 min-h-0 overflow-y-auto" />
</div> </div>
) : ( ) : (
<div className="flex flex-col h-full space-y-2 animate-in fade-in"> <div className="flex flex-col h-full min-h-0 space-y-2 animate-in fade-in">
<div className="h-3/5 shrink-0 flex flex-col gap-2"> <div className="h-3/5 shrink-0 flex flex-col gap-2">
<div className="flex gap-2 shrink-0"> <div className="flex gap-2 shrink-0">
<select className="flex-1 text-xs bg-white/5 border border-white/10 rounded px-2 py-1 text-foreground" value={selectedCamera} onChange={e => setSelectedCamera(e.target.value)}> <select className="flex-1 text-xs bg-white/5 border border-white/10 rounded px-2 py-1 text-foreground" value={selectedCamera} onChange={e => setSelectedCamera(e.target.value)}>
@@ -1793,7 +1793,7 @@ export const DebugDrawer: React.FC<{
<button className="absolute top-2 right-2 z-20 h-8 w-8 rounded-full bg-black/50 backdrop-blur flex items-center justify-center text-white border border-white/10 hover:bg-primary/80" onClick={() => setIsSwapped(!isSwapped)}><ArrowLeftRight className="h-3.5 w-3.5" /></button> <button className="absolute top-2 right-2 z-20 h-8 w-8 rounded-full bg-black/50 backdrop-blur flex items-center justify-center text-white border border-white/10 hover:bg-primary/80" onClick={() => setIsSwapped(!isSwapped)}><ArrowLeftRight className="h-3.5 w-3.5" /></button>
</div> </div>
</div> </div>
<TranscriptionLog className="flex-1 min-h-0" /> <TranscriptionLog className="flex-1 min-h-0 overflow-y-auto" />
</div> </div>
)} )}
<Button variant="destructive" size="sm" className="w-full h-10 font-bold" onClick={handleHangup}> <Button variant="destructive" size="sm" className="w-full h-10 font-bold" onClick={handleHangup}>