feat(ui): times on injects and every spoken message

This commit is contained in:
hh
2026-09-02 04:52:26 +02:00
parent 74843451a4
commit b6d111a610
+15 -2
View File
@@ -251,15 +251,27 @@
{@const newMinute =
message.ts &&
minuteOf(message.ts) !== minuteOf(messages[index - 1]?.ts)}
{@const spoken =
message.role === "user" ||
parts.some((b) => b.type === "text" && Boolean(b.text))}
{#if newDay}
<p class="label-quiet self-center pt-2">
{fmtDateTime(message.ts).replace(DAY_TIME, "")}
</p>
{/if}
{#if system}
<div class="flex min-w-0 items-start justify-center gap-2">
{#if message.ts}
<span
class="tabular shrink-0 py-1 text-[11px] text-muted-foreground opacity-60"
title={fmtDateTime(message.ts)}
>
{minuteOf(message.ts)}
</span>
{/if}
<button
aria-expanded={openSystem.has(index)}
class="@md:max-w-[75ch] max-w-full self-center rounded-md px-2 py-1 text-left font-mono text-muted-foreground text-xs hover:bg-accent"
class="@md:max-w-[75ch] min-w-0 max-w-full rounded-md px-2 py-1 text-left font-mono text-muted-foreground text-xs hover:bg-accent"
onclick={() => toggleSystem(index)}
type="button"
>
@@ -271,6 +283,7 @@
>
{/if}
</button>
</div>
{:else if !(isResultOnly && !showResults)}
<div
class={cn(
@@ -278,7 +291,7 @@
message.role === "user" && !isResultOnly && "items-end"
)}
>
{#if message.ts && newMinute && !isResultOnly}
{#if message.ts && (newMinute || spoken) && !isResultOnly}
<span
class="tabular px-1 text-[11px] text-muted-foreground opacity-60 transition-opacity group-hover:opacity-100"
title={fmtDateTime(message.ts)}