mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 18:18:37 +00:00
fix(ui): session detail missing tool calls, memory dialog toast errors (#458)
1. Session detail: isDisplayable() filtered out assistant messages with
only tool_calls or thinking (no text content). Live chat renders these
via MergedToolGroup but session history silently dropped them.
2. Memory document dialog: load error showed "Failed to create document"
(wrong i18n key toast.failedCreate). Save error used the same wrong key.
Fixed to use toast.docLoadFailed and toast.docUpdateFailed respectively.
Added missing docLoadFailed key to en/vi/zh locale files.
3. Memory dialogs: all 5 dialogs missing aria-describedby={undefined} on
DialogContent, causing Radix UI console warnings about missing
Description for accessibility.
Co-authored-by: Luvu182 <208665161+Luvu182@users.noreply.github.com>
This commit is contained in:
1 parent
1f72f0d179
commit
95ce4200dd
9 files changed
+20
-13
No files matched your search
@@ -185,6 +185,7 @@
|
||||
"docIndexFailed": "Failed to index document",
|
||||
"allIndexed": "All documents indexed",
|
||||
"allIndexFailed": "Failed to index all",
|
||||
"searchFailed": "Search failed"
|
||||
"searchFailed": "Search failed",
|
||||
"docLoadFailed": "Failed to load document"
|
||||
}
|
||||
}
|
||||
@@ -185,6 +185,7 @@
|
||||
"docIndexFailed": "Không thể lập chỉ mục tài liệu",
|
||||
"allIndexed": "Đã lập chỉ mục tất cả tài liệu",
|
||||
"allIndexFailed": "Không thể lập chỉ mục tất cả",
|
||||
"searchFailed": "Tìm kiếm thất bại"
|
||||
"searchFailed": "Tìm kiếm thất bại",
|
||||
"docLoadFailed": "Không thể tải tài liệu"
|
||||
}
|
||||
}
|
||||
@@ -185,6 +185,7 @@
|
||||
"docIndexFailed": "索引文档失败",
|
||||
"allIndexed": "所有文档已索引",
|
||||
"allIndexFailed": "索引所有文档失败",
|
||||
"searchFailed": "搜索失败"
|
||||
"searchFailed": "搜索失败",
|
||||
"docLoadFailed": "加载文档失败"
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ export function KGEntityDetailDialog({ open, onOpenChange, agentId, entity, getE
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={(v) => !traversing && onOpenChange(v)}>
|
||||
<DialogContent className="max-w-3xl max-h-[85vh] flex flex-col">
|
||||
<DialogContent aria-describedby={undefined} className="max-w-3xl max-h-[85vh] flex flex-col">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<span>{entity?.name}</span>
|
||||
|
||||
@@ -38,7 +38,7 @@ export function KGExtractDialog({ open, onOpenChange, onExtract }: KGExtractDial
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={(v) => !loading && onOpenChange(v)}>
|
||||
<DialogContent className="max-w-2xl max-h-[85vh] flex flex-col">
|
||||
<DialogContent aria-describedby={undefined} className="max-w-2xl max-h-[85vh] flex flex-col">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{t("kg.extractDialog.title")}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -96,7 +96,7 @@ export function MemoryCreateDialog({ open, onOpenChange, agentId: parentAgentId,
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={(v) => !loading && onOpenChange(v)}>
|
||||
<DialogContent className="max-w-3xl max-h-[85vh] flex flex-col">
|
||||
<DialogContent aria-describedby={undefined} className="max-w-3xl max-h-[85vh] flex flex-col">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{t("createDialog.title")}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -48,7 +48,7 @@ export function MemoryDocumentDialog({ open, onOpenChange, agentId, document }:
|
||||
setDetail(res);
|
||||
setContent(res.content);
|
||||
} catch {
|
||||
toast.error(i18next.t("memory:toast.failedCreate"));
|
||||
toast.error(i18next.t("memory:toast.docLoadFailed"));
|
||||
} finally {
|
||||
setLoadingDetail(false);
|
||||
}
|
||||
@@ -98,7 +98,7 @@ export function MemoryDocumentDialog({ open, onOpenChange, agentId, document }:
|
||||
toast.success(i18next.t("memory:documentDialog.title"), document.path);
|
||||
onOpenChange(false);
|
||||
} catch (err) {
|
||||
toast.error(i18next.t("memory:toast.failedCreate"), err instanceof Error ? err.message : "");
|
||||
toast.error(i18next.t("memory:toast.docUpdateFailed"), err instanceof Error ? err.message : "");
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
@@ -108,7 +108,7 @@ export function MemoryDocumentDialog({ open, onOpenChange, agentId, document }:
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={(v) => !saving && onOpenChange(v)}>
|
||||
<DialogContent className="max-w-4xl max-h-[85vh] flex flex-col">
|
||||
<DialogContent aria-describedby={undefined} className="max-w-4xl max-h-[85vh] flex flex-col">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<span className="font-mono text-sm">{document?.path}</span>
|
||||
|
||||
@@ -37,7 +37,7 @@ export function MemorySearchDialog({ open, onOpenChange, agentId }: MemorySearch
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-w-2xl max-h-[85vh] flex flex-col">
|
||||
<DialogContent aria-describedby={undefined} className="max-w-2xl max-h-[85vh] flex flex-col">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{t("searchDialog.title")}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -25,9 +25,13 @@ function isSystemMessage(msg: ChatMessage): boolean {
|
||||
function isDisplayable(msg: ChatMessage): boolean {
|
||||
// Hide tool role messages (shown inline with assistant)
|
||||
if (msg.role === "tool") return false;
|
||||
// Hide messages with empty/whitespace content
|
||||
if (!msg.content?.trim()) return false;
|
||||
return true;
|
||||
// Show if there is text content
|
||||
if (msg.content?.trim()) return true;
|
||||
// Assistant messages with tool calls or thinking should still be displayed
|
||||
if (msg.role === "assistant") {
|
||||
return !!(msg.toolDetails?.length || msg.tool_calls?.length || msg.thinking?.trim());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
interface SessionDetailPageProps {
|
||||
|
||||
Reference in new issue
Block a user