fix(webui): align message actions and simplify compaction notices
This commit is contained in:
1 parent
39a817e72d
commit
a3e9d0f9a9
14 files changed
+29
-33
No files matched your search
@@ -304,7 +304,7 @@ function IncomingSessionMessage({
|
||||
{createdAtLabel || showCopyAction ? (
|
||||
<TooltipProvider>
|
||||
<div
|
||||
className="mt-1 flex min-h-8 items-center gap-1.5 text-muted-foreground"
|
||||
className="message-actions mt-1 flex min-h-8 items-center gap-1.5 text-muted-foreground"
|
||||
>
|
||||
{showCopyAction ? <MessageCopyButton content={message.content} /> : null}
|
||||
{createdAtLabel ? (
|
||||
@@ -530,7 +530,7 @@ export function MessageBubble({
|
||||
data-state={showAssistantFooterRow ? "visible" : "reserved"}
|
||||
aria-hidden={showAssistantFooterRow ? undefined : true}
|
||||
className={cn(
|
||||
"mt-2 flex min-h-8 flex-wrap items-center gap-x-2 gap-y-1 text-muted-foreground",
|
||||
"message-actions mt-2 flex min-h-8 flex-wrap items-center gap-x-2 gap-y-1 text-muted-foreground",
|
||||
"transition-opacity duration-300 ease-out motion-reduce:transition-none",
|
||||
showAssistantFooterRow
|
||||
? "opacity-100"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Archive, CircleAlert, LoaderCircle } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -11,17 +10,12 @@ interface ContextCompactionNoticeProps {
|
||||
export function ContextCompactionNotice({ compaction }: ContextCompactionNoticeProps) {
|
||||
const { t } = useTranslation();
|
||||
const title = compaction.phase === "started"
|
||||
? t("thread.compaction.started", { defaultValue: "Compressing context…" })
|
||||
? t("thread.compaction.started", { defaultValue: "Compressing context" })
|
||||
: compaction.phase === "failed"
|
||||
? t("thread.compaction.failed", { defaultValue: "Context compaction failed" })
|
||||
: compaction.phase === "cancelled"
|
||||
? t("thread.compaction.cancelled", { defaultValue: "Context compaction cancelled" })
|
||||
: t("thread.compaction.succeeded", { defaultValue: "Context compacted" });
|
||||
const Icon = compaction.phase === "started"
|
||||
? LoaderCircle
|
||||
: compaction.phase === "failed"
|
||||
? CircleAlert
|
||||
: Archive;
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -29,23 +23,18 @@ export function ContextCompactionNotice({ compaction }: ContextCompactionNoticeP
|
||||
aria-live={compaction.announce ? "polite" : undefined}
|
||||
aria-busy={compaction.phase === "started"}
|
||||
data-context-compaction={compaction.phase}
|
||||
className="mx-auto flex w-full max-w-[49.5rem] items-center gap-2.5 py-1 text-xs text-muted-foreground"
|
||||
className="mx-auto flex w-full max-w-[49.5rem] items-center justify-center gap-3 py-2 text-xs text-muted-foreground"
|
||||
>
|
||||
<span
|
||||
<span aria-hidden className="h-px min-w-4 max-w-16 flex-1 bg-border/60" />
|
||||
<p
|
||||
className={cn(
|
||||
"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted/60",
|
||||
compaction.phase === "failed" && "text-destructive",
|
||||
"min-w-0 text-center leading-5",
|
||||
compaction.phase === "failed" && "text-destructive/80",
|
||||
)}
|
||||
>
|
||||
<Icon
|
||||
className={cn(
|
||||
"size-3.5",
|
||||
compaction.phase === "started" && "animate-spin motion-reduce:animate-none",
|
||||
)}
|
||||
aria-hidden
|
||||
/>
|
||||
</span>
|
||||
<p className="min-w-0 font-medium leading-5 text-foreground/80">{title}</p>
|
||||
{title}
|
||||
</p>
|
||||
<span aria-hidden className="h-px min-w-4 max-w-16 flex-1 bg-border/60" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user