From 95ce4200dd11262bdcb071f7aa467c94e1e7413c Mon Sep 17 00:00:00 2001 From: Luan Vu Date: Wed, 25 Mar 2026 08:26:35 +0700 Subject: [PATCH] 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> --- ui/web/src/i18n/locales/en/memory.json | 3 ++- ui/web/src/i18n/locales/vi/memory.json | 3 ++- ui/web/src/i18n/locales/zh/memory.json | 3 ++- ui/web/src/pages/memory/kg-entity-detail-dialog.tsx | 2 +- ui/web/src/pages/memory/kg-extract-dialog.tsx | 2 +- ui/web/src/pages/memory/memory-create-dialog.tsx | 2 +- ui/web/src/pages/memory/memory-document-dialog.tsx | 6 +++--- ui/web/src/pages/memory/memory-search-dialog.tsx | 2 +- ui/web/src/pages/sessions/session-detail-page.tsx | 10 +++++++--- 9 files changed, 20 insertions(+), 13 deletions(-) diff --git a/ui/web/src/i18n/locales/en/memory.json b/ui/web/src/i18n/locales/en/memory.json index 2eec6732..8abafb1a 100644 --- a/ui/web/src/i18n/locales/en/memory.json +++ b/ui/web/src/i18n/locales/en/memory.json @@ -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" } } diff --git a/ui/web/src/i18n/locales/vi/memory.json b/ui/web/src/i18n/locales/vi/memory.json index 3261cda6..5f814f11 100644 --- a/ui/web/src/i18n/locales/vi/memory.json +++ b/ui/web/src/i18n/locales/vi/memory.json @@ -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" } } diff --git a/ui/web/src/i18n/locales/zh/memory.json b/ui/web/src/i18n/locales/zh/memory.json index 272ad45c..01ce0a6e 100644 --- a/ui/web/src/i18n/locales/zh/memory.json +++ b/ui/web/src/i18n/locales/zh/memory.json @@ -185,6 +185,7 @@ "docIndexFailed": "索引文档失败", "allIndexed": "所有文档已索引", "allIndexFailed": "索引所有文档失败", - "searchFailed": "搜索失败" + "searchFailed": "搜索失败", + "docLoadFailed": "加载文档失败" } } diff --git a/ui/web/src/pages/memory/kg-entity-detail-dialog.tsx b/ui/web/src/pages/memory/kg-entity-detail-dialog.tsx index 3a594ad9..bfee27da 100644 --- a/ui/web/src/pages/memory/kg-entity-detail-dialog.tsx +++ b/ui/web/src/pages/memory/kg-entity-detail-dialog.tsx @@ -52,7 +52,7 @@ export function KGEntityDetailDialog({ open, onOpenChange, agentId, entity, getE return ( !traversing && onOpenChange(v)}> - + {entity?.name} diff --git a/ui/web/src/pages/memory/kg-extract-dialog.tsx b/ui/web/src/pages/memory/kg-extract-dialog.tsx index cfcdefb5..2987f9e2 100644 --- a/ui/web/src/pages/memory/kg-extract-dialog.tsx +++ b/ui/web/src/pages/memory/kg-extract-dialog.tsx @@ -38,7 +38,7 @@ export function KGExtractDialog({ open, onOpenChange, onExtract }: KGExtractDial return ( !loading && onOpenChange(v)}> - + {t("kg.extractDialog.title")} diff --git a/ui/web/src/pages/memory/memory-create-dialog.tsx b/ui/web/src/pages/memory/memory-create-dialog.tsx index f008a3f5..276e625f 100644 --- a/ui/web/src/pages/memory/memory-create-dialog.tsx +++ b/ui/web/src/pages/memory/memory-create-dialog.tsx @@ -96,7 +96,7 @@ export function MemoryCreateDialog({ open, onOpenChange, agentId: parentAgentId, return ( !loading && onOpenChange(v)}> - + {t("createDialog.title")} diff --git a/ui/web/src/pages/memory/memory-document-dialog.tsx b/ui/web/src/pages/memory/memory-document-dialog.tsx index 112be519..8221b283 100644 --- a/ui/web/src/pages/memory/memory-document-dialog.tsx +++ b/ui/web/src/pages/memory/memory-document-dialog.tsx @@ -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 ( !saving && onOpenChange(v)}> - + {document?.path} diff --git a/ui/web/src/pages/memory/memory-search-dialog.tsx b/ui/web/src/pages/memory/memory-search-dialog.tsx index c5bf27c6..805043e6 100644 --- a/ui/web/src/pages/memory/memory-search-dialog.tsx +++ b/ui/web/src/pages/memory/memory-search-dialog.tsx @@ -37,7 +37,7 @@ export function MemorySearchDialog({ open, onOpenChange, agentId }: MemorySearch return ( - + {t("searchDialog.title")} diff --git a/ui/web/src/pages/sessions/session-detail-page.tsx b/ui/web/src/pages/sessions/session-detail-page.tsx index d90d06f2..a142afb8 100644 --- a/ui/web/src/pages/sessions/session-detail-page.tsx +++ b/ui/web/src/pages/sessions/session-detail-page.tsx @@ -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 {