feat: show response generation time on assistant messages

Track how long each assistant response took to generate and display
it subtly next to the timestamp (e.g. '· 12.3s'). The timing is
measured from the first streaming delta to the final state, and
preserved across the history reload that follows stream completion.

Only visible for messages generated during the current session.
This commit is contained in:
Nicolas Varrot
2026-02-13 15:46:29 +00:00
parent d31374baf7
commit 622aa107f8
3 changed files with 31 additions and 0 deletions

View File

@@ -539,6 +539,13 @@ export const ChatMessageComponent = memo(function ChatMessageComponent({ message
</span>
)}
{message.timestamp && <Timestamp ts={message.timestamp} />}
{!isUser && message.generationTimeMs != null && (
<span className="text-[10px] text-pc-text-faint" title="Generation time">
· {message.generationTimeMs < 1000
? `${message.generationTimeMs}ms`
: `${(message.generationTimeMs / 1000).toFixed(1)}s`}
</span>
)}
{isUser && message.sendStatus === 'sending' && (
<span title="Sending..."><Clock size={10} className="animate-pulse text-pc-text-faint" /></span>
)}