diff --git a/apps/rowboat/app/projects/[projectId]/playground/messages.tsx b/apps/rowboat/app/projects/[projectId]/playground/messages.tsx index cd4c979e..af3a2fab 100644 --- a/apps/rowboat/app/projects/[projectId]/playground/messages.tsx +++ b/apps/rowboat/app/projects/[projectId]/playground/messages.tsx @@ -52,9 +52,9 @@ function AssistantMessage({ content, sender, latency }: { content: string, sende
{sender ?? 'Assistant'}
-
+ {latency > 0 &&
{Math.round(latency / 1000)}s -
+
}
@@ -273,6 +273,7 @@ export function Messages({ }) { const messagesEndRef = useRef(null); let lastUserMessageTimestamp = 0; + let userMessageSeen = false; // scroll to bottom on new messages useEffect(() => { @@ -302,7 +303,11 @@ export function Messages({ />; } else { // the assistant message createdAt is an ISO string timestamp - const latency = new Date(message.createdAt).getTime() - lastUserMessageTimestamp; + let latency = new Date(message.createdAt).getTime() - lastUserMessageTimestamp; + // if this is the first message, set the latency to 0 + if (!userMessageSeen) { + latency = 0; + } if (message.agenticResponseType === 'internal') { return ( ; } return <>;