Skip to content

Your lightweight open-source personal agent.

fix(webui): align message actions and simplify compaction notices

chengyongrua3e9d0f9a911
diff --git a/webui/src/components/MessageBubble.tsx b/webui/src/components/MessageBubble.tsx
index 4d26742dd..09028ada9 100644
--- a/webui/src/components/MessageBubble.tsx
+++ b/webui/src/components/MessageBubble.tsx
@@ -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"
diff --git a/webui/src/components/thread/ContextCompactionNotice.tsx b/webui/src/components/thread/ContextCompactionNotice.tsx
index 4fbfafc15..ea2f64250 100644
--- a/webui/src/components/thread/ContextCompactionNotice.tsx
+++ b/webui/src/components/thread/ContextCompactionNotice.tsx
@@ -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>
);
}
diff --git a/webui/src/globals.css b/webui/src/globals.css
index 172ac7f4f..47de92129 100644
--- a/webui/src/globals.css
+++ b/webui/src/globals.css
@@ -735,7 +735,15 @@
}
}
+.message-actions > button:first-child {
+ margin-inline-start: -0.5rem;
+}
+
@media (pointer: coarse) {
+ .message-actions > button:first-child {
+ margin-inline-start: -0.875rem;
+ }
+
.touch-target {
min-width: 2.75rem;
min-height: 2.75rem;
diff --git a/webui/src/i18n/locales/en/common.json b/webui/src/i18n/locales/en/common.json
index 3052e5dd1..2a244519d 100644
--- a/webui/src/i18n/locales/en/common.json
+++ b/webui/src/i18n/locales/en/common.json
@@ -1387,7 +1387,7 @@
"compaction": {
"cancelled": "Context compaction cancelled",
"empty": "Nothing to compact.",
- "started": "Compressing context…",
+ "started": "Compressing context",
"failed": "Context compaction failed",
"succeeded": "Context compacted"
},
diff --git a/webui/src/i18n/locales/es/common.json b/webui/src/i18n/locales/es/common.json
index 069e9b84f..33d6b551f 100644
--- a/webui/src/i18n/locales/es/common.json
+++ b/webui/src/i18n/locales/es/common.json
@@ -1188,7 +1188,7 @@
"compaction": {
"cancelled": "Compresión de contexto cancelada",
"empty": "No hay contexto que comprimir.",
- "started": "Comprimiendo el contexto…",
+ "started": "Comprimiendo el contexto",
"failed": "La compresión del contexto falló",
"succeeded": "Contexto comprimido"
},
diff --git a/webui/src/i18n/locales/fr/common.json b/webui/src/i18n/locales/fr/common.json
index 6eecb481f..ee004ba8c 100644
--- a/webui/src/i18n/locales/fr/common.json
+++ b/webui/src/i18n/locales/fr/common.json
@@ -1187,7 +1187,7 @@
"compaction": {
"cancelled": "Compression du contexte annulée",
"empty": "Aucun contexte à compresser.",
- "started": "Compression du contexte…",
+ "started": "Compression du contexte",
"failed": "Échec de la compression du contexte",
"succeeded": "Contexte compressé"
},
diff --git a/webui/src/i18n/locales/id/common.json b/webui/src/i18n/locales/id/common.json
index 71393657f..847eef9c8 100644
--- a/webui/src/i18n/locales/id/common.json
+++ b/webui/src/i18n/locales/id/common.json
@@ -1187,7 +1187,7 @@
"compaction": {
"cancelled": "Pemadatan konteks dibatalkan",
"empty": "Tidak ada konteks yang perlu dipadatkan.",
- "started": "Memadatkan konteks…",
+ "started": "Memadatkan konteks",
"failed": "Pemadatan konteks gagal",
"succeeded": "Konteks dipadatkan"
},
diff --git a/webui/src/i18n/locales/ja/common.json b/webui/src/i18n/locales/ja/common.json
index 082743927..3433b38c8 100644
--- a/webui/src/i18n/locales/ja/common.json
+++ b/webui/src/i18n/locales/ja/common.json
@@ -1187,7 +1187,7 @@
"compaction": {
"cancelled": "コンテキストの圧縮をキャンセルしました",
"empty": "圧縮するコンテキストはありません。",
- "started": "コンテキストを圧縮中…",
+ "started": "コンテキストを圧縮中",
"failed": "コンテキストの圧縮に失敗しました",
"succeeded": "コンテキストを圧縮しました"
},
diff --git a/webui/src/i18n/locales/ko/common.json b/webui/src/i18n/locales/ko/common.json
index d0f7f23b4..ca99c11ee 100644
--- a/webui/src/i18n/locales/ko/common.json
+++ b/webui/src/i18n/locales/ko/common.json
@@ -1187,7 +1187,7 @@
"compaction": {
"cancelled": "컨텍스트 압축이 취소되었습니다",
"empty": "압축할 컨텍스트가 없습니다.",
- "started": "컨텍스트 압축 중…",
+ "started": "컨텍스트 압축 중",
"failed": "컨텍스트 압축 실패",
"succeeded": "컨텍스트를 압축했습니다"
},
diff --git a/webui/src/i18n/locales/pt-BR/common.json b/webui/src/i18n/locales/pt-BR/common.json
index 6f8629fb5..17386d237 100644
--- a/webui/src/i18n/locales/pt-BR/common.json
+++ b/webui/src/i18n/locales/pt-BR/common.json
@@ -1201,7 +1201,7 @@
"compaction": {
"cancelled": "Compactação do contexto cancelada",
"empty": "Não há contexto para compactar.",
- "started": "Compactando contexto…",
+ "started": "Compactando contexto",
"failed": "Falha ao compactar o contexto",
"succeeded": "Contexto compactado"
},
diff --git a/webui/src/i18n/locales/vi/common.json b/webui/src/i18n/locales/vi/common.json
index f011f0605..eb07db563 100644
--- a/webui/src/i18n/locales/vi/common.json
+++ b/webui/src/i18n/locales/vi/common.json
@@ -1187,7 +1187,7 @@
"compaction": {
"cancelled": "Đã hủy nén ngữ cảnh",
"empty": "Không có ngữ cảnh cần nén.",
- "started": "Đang nén ngữ cảnh…",
+ "started": "Đang nén ngữ cảnh",
"failed": "Nén ngữ cảnh không thành công",
"succeeded": "Đã nén ngữ cảnh"
},
diff --git a/webui/src/i18n/locales/zh-CN/common.json b/webui/src/i18n/locales/zh-CN/common.json
index 0c42c4db4..477bb0895 100644
--- a/webui/src/i18n/locales/zh-CN/common.json
+++ b/webui/src/i18n/locales/zh-CN/common.json
@@ -1387,7 +1387,7 @@
"compaction": {
"cancelled": "上下文压缩已取消",
"empty": "无需压缩上下文",
- "started": "正在压缩上下文…",
+ "started": "正在压缩上下文",
"failed": "上下文压缩失败",
"succeeded": "上下文已压缩"
},
diff --git a/webui/src/i18n/locales/zh-TW/common.json b/webui/src/i18n/locales/zh-TW/common.json
index 779d5fcf3..4700b1aa2 100644
--- a/webui/src/i18n/locales/zh-TW/common.json
+++ b/webui/src/i18n/locales/zh-TW/common.json
@@ -1187,7 +1187,7 @@
"compaction": {
"cancelled": "上下文壓縮已取消",
"empty": "無需壓縮上下文",
- "started": "正在壓縮上下文…",
+ "started": "正在壓縮上下文",
"failed": "上下文壓縮失敗",
"succeeded": "上下文已壓縮"
},
diff --git a/webui/src/tests/message-bubble.test.tsx b/webui/src/tests/message-bubble.test.tsx
index 729fe73d0..6c5041ea7 100644
--- a/webui/src/tests/message-bubble.test.tsx
+++ b/webui/src/tests/message-bubble.test.tsx
@@ -133,7 +133,6 @@ describe("MessageBubble", () => {
expect(notice).toHaveAttribute("aria-live", "polite");
expect(screen.getByText("Context compacted")).toBeInTheDocument();
expect(notice).toHaveTextContent(/^Context compacted$/);
- expect(notice?.querySelector(".lucide-archive")).toBeInTheDocument();
});
it("renders user messages as right-aligned pills", () => {