mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-23 06:00:42 -05:00
feat: show when an assistant reply finished instead of when the prompt was sent (#33895)
Assistant replies showed the time the prompt was sent, so a reply carried the same time as the message above it, even when it took minutes to finish. Replies now show the time they finished. Open WebUI already records that time for every reply, and replies created before v0.12.5, which did not record it yet, keep showing the send time. A reply that is stopped or fails shows its finish time after a reload.
This commit is contained in:
1 parent
1cfb04e054
commit
4bd5fafffc
2 files changed
+11
-8
No files matched your search
@@ -3685,6 +3685,7 @@
|
||||
|
||||
if (done) {
|
||||
message.done = true;
|
||||
message.meta = { ...message.meta, response_ended_at: Date.now() / 1000 };
|
||||
if ($contextCompactions[message.id] === 'in_progress') clearContextCompaction(message.id);
|
||||
if (shared) return;
|
||||
if (message.error) {
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
usage?: unknown;
|
||||
};
|
||||
annotation?: { type: string; rating: number };
|
||||
meta?: { response_ended_at?: number };
|
||||
}
|
||||
|
||||
export let chatId = '';
|
||||
@@ -205,6 +206,7 @@
|
||||
? resolveLocalizedModelName(model, $i18n.language)
|
||||
: message.modelName || message.model;
|
||||
$: model = $models.find((m) => m.id === message.model);
|
||||
$: responseTimestamp = message?.meta?.response_ended_at ?? message?.timestamp;
|
||||
|
||||
$: statusEntries = message?.statusHistory ?? [...(message?.status ? [message?.status] : [])];
|
||||
$: hasVisibleStatus =
|
||||
@@ -978,18 +980,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if compactPreview && message.timestamp}
|
||||
{#if compactPreview && responseTimestamp}
|
||||
<div class="mt-0.5 flex justify-start whitespace-nowrap text-gray-600 dark:text-gray-500">
|
||||
<Tooltip
|
||||
className="flex self-center"
|
||||
content={formatMessageTimestampFull(message.timestamp * 1000, $i18n.language)}
|
||||
content={formatMessageTimestampFull(responseTimestamp * 1000, $i18n.language)}
|
||||
placement="bottom"
|
||||
>
|
||||
<time
|
||||
datetime={new Date(message.timestamp * 1000).toISOString()}
|
||||
datetime={new Date(responseTimestamp * 1000).toISOString()}
|
||||
class="ml-1 shrink-0 whitespace-nowrap text-[0.6875rem] tabular-nums text-gray-400 dark:text-gray-600 select-none"
|
||||
>
|
||||
{formatMessageTimestamp(message.timestamp * 1000, $i18n.language)}
|
||||
{formatMessageTimestamp(responseTimestamp * 1000, $i18n.language)}
|
||||
</time>
|
||||
</Tooltip>
|
||||
</div>
|
||||
@@ -1692,17 +1694,17 @@
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{#if message.timestamp}
|
||||
{#if responseTimestamp}
|
||||
<Tooltip
|
||||
className="flex self-center"
|
||||
content={formatMessageTimestampFull(message.timestamp * 1000, $i18n.language)}
|
||||
content={formatMessageTimestampFull(responseTimestamp * 1000, $i18n.language)}
|
||||
placement="bottom"
|
||||
>
|
||||
<time
|
||||
datetime={new Date(message.timestamp * 1000).toISOString()}
|
||||
datetime={new Date(responseTimestamp * 1000).toISOString()}
|
||||
class="hover-reveal ml-1 shrink-0 whitespace-nowrap text-[0.6875rem] tabular-nums text-gray-400 dark:text-gray-600 select-none"
|
||||
>
|
||||
{formatMessageTimestamp(message.timestamp * 1000, $i18n.language)}
|
||||
{formatMessageTimestamp(responseTimestamp * 1000, $i18n.language)}
|
||||
</time>
|
||||
</Tooltip>
|
||||
{/if}
|
||||
|
||||
Reference in new issue
Block a user