cleanup and fix messages re-rendering while chat is streaming

This commit is contained in:
Zane Staggs
2025-10-09 15:48:42 -07:00
parent b6c5eada47
commit 2165876401
2 changed files with 1 additions and 6 deletions
@@ -189,7 +189,7 @@ export default function ProgressiveMessageList({
return (
<div
key={message.id && `${message.id}-${message.content.length}`}
key={message.id || `message-${index}`}
className={`relative ${index === 0 ? 'mt-0' : 'mt-4'} ${isUser ? 'user' : 'assistant'}`}
data-testid="message-container"
>
-5
View File
@@ -3,10 +3,6 @@ import { Session } from '../api';
import { useSessionStreamContext } from '../contexts/SessionStreamContext';
interface UseSessionStreamOptions {
/**
* Whether to enable streaming. If false, will not connect.
* @default true
*/
enabled?: boolean;
onUpdate?: (session: Session) => void;
onError?: (error: string) => void;
@@ -45,7 +41,6 @@ export function useSessionStream(
const onUpdateRef = useRef(onUpdate);
const onErrorRef = useRef(onError);
// Keep refs up to date
useEffect(() => {
onUpdateRef.current = onUpdate;
onErrorRef.current = onError;