feat(ui): times on injects and every spoken message
This commit is contained in:
@@ -251,26 +251,39 @@
|
|||||||
{@const newMinute =
|
{@const newMinute =
|
||||||
message.ts &&
|
message.ts &&
|
||||||
minuteOf(message.ts) !== minuteOf(messages[index - 1]?.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}
|
{#if newDay}
|
||||||
<p class="label-quiet self-center pt-2">
|
<p class="label-quiet self-center pt-2">
|
||||||
{fmtDateTime(message.ts).replace(DAY_TIME, "")}
|
{fmtDateTime(message.ts).replace(DAY_TIME, "")}
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
{#if system}
|
{#if system}
|
||||||
<button
|
<div class="flex min-w-0 items-start justify-center gap-2">
|
||||||
aria-expanded={openSystem.has(index)}
|
{#if message.ts}
|
||||||
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"
|
<span
|
||||||
onclick={() => toggleSystem(index)}
|
class="tabular shrink-0 py-1 text-[11px] text-muted-foreground opacity-60"
|
||||||
type="button"
|
title={fmtDateTime(message.ts)}
|
||||||
>
|
|
||||||
{#if openSystem.has(index)}
|
|
||||||
<span class="whitespace-pre-wrap break-words">{system}</span>
|
|
||||||
{:else}
|
|
||||||
<span class="block truncate"
|
|
||||||
>{clip(system.split("\n")[0], 120)}</span
|
|
||||||
>
|
>
|
||||||
|
{minuteOf(message.ts)}
|
||||||
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
<button
|
||||||
|
aria-expanded={openSystem.has(index)}
|
||||||
|
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"
|
||||||
|
>
|
||||||
|
{#if openSystem.has(index)}
|
||||||
|
<span class="whitespace-pre-wrap break-words">{system}</span>
|
||||||
|
{:else}
|
||||||
|
<span class="block truncate"
|
||||||
|
>{clip(system.split("\n")[0], 120)}</span
|
||||||
|
>
|
||||||
|
{/if}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
{:else if !(isResultOnly && !showResults)}
|
{:else if !(isResultOnly && !showResults)}
|
||||||
<div
|
<div
|
||||||
class={cn(
|
class={cn(
|
||||||
@@ -278,7 +291,7 @@
|
|||||||
message.role === "user" && !isResultOnly && "items-end"
|
message.role === "user" && !isResultOnly && "items-end"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{#if message.ts && newMinute && !isResultOnly}
|
{#if message.ts && (newMinute || spoken) && !isResultOnly}
|
||||||
<span
|
<span
|
||||||
class="tabular px-1 text-[11px] text-muted-foreground opacity-60 transition-opacity group-hover:opacity-100"
|
class="tabular px-1 text-[11px] text-muted-foreground opacity-60 transition-opacity group-hover:opacity-100"
|
||||||
title={fmtDateTime(message.ts)}
|
title={fmtDateTime(message.ts)}
|
||||||
|
|||||||
Reference in New Issue
Block a user