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

@@ -10,6 +10,10 @@ export interface ChatMessage {
metadata?: Record<string, unknown>;
/** Optimistic send status for user messages */
sendStatus?: 'sending' | 'sent' | 'error';
/** Timestamp (ms) when streaming started for this message */
streamStartedAt?: number;
/** Total generation time in milliseconds (set when streaming ends) */
generationTimeMs?: number;
}
export type MessageBlock =