From 0c96b5a034551b4d63c858a27c264805408012f5 Mon Sep 17 00:00:00 2001 From: Arvin Xu Date: Mon, 26 Jan 2026 00:11:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20show=20fallback=20title?= =?UTF-8?q?=20for=20custom=20assistant=20in=20chat=20messages=20(#11820)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When avatar.title is empty or null, display 'Untitled Agent' as fallback instead of showing nothing. Closes LOBE-2232 --- src/features/Conversation/ChatItem/components/Title.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/features/Conversation/ChatItem/components/Title.tsx b/src/features/Conversation/ChatItem/components/Title.tsx index 34aa262a69..4b3e0b94dc 100644 --- a/src/features/Conversation/ChatItem/components/Title.tsx +++ b/src/features/Conversation/ChatItem/components/Title.tsx @@ -1,6 +1,7 @@ import { Text } from '@lobehub/ui'; import dayjs from 'dayjs'; import { memo } from 'react'; +import { useTranslation } from 'react-i18next'; import { type ChatItemProps } from '../type'; @@ -12,11 +13,14 @@ export interface TitleProps { } const Title = memo(({ showTitle, time, avatar, titleAddon }) => { + const { t } = useTranslation('chat'); + const title = avatar.title || t('untitledAgent'); + return ( <> - {showTitle && avatar.title && ( + {showTitle && ( - {avatar.title} + {title} )} {showTitle ? titleAddon : undefined}