From 98e53873564300ef28930b602da0abd9ffc4bbd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?= Date: Tue, 7 Apr 2026 11:23:56 +0800 Subject: [PATCH] fix: web app user avatar display incorrect black (#34624) --- .../base/chat/chat/__tests__/question.spec.tsx | 12 +++++++++++- web/app/components/base/chat/chat/question.tsx | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/web/app/components/base/chat/chat/__tests__/question.spec.tsx b/web/app/components/base/chat/chat/__tests__/question.spec.tsx index e9392adb8a..55eaaef905 100644 --- a/web/app/components/base/chat/chat/__tests__/question.spec.tsx +++ b/web/app/components/base/chat/chat/__tests__/question.spec.tsx @@ -501,6 +501,16 @@ describe('Question component', () => { expect(onRegenerate).toHaveBeenCalled() }) + it('should render default question avatar icon when questionIcon is not provided', () => { + const { container } = renderWithProvider( + makeItem(), + vi.fn() as unknown as OnRegenerate, + ) + + const defaultIcon = container.querySelector('.question-default-user-icon') + expect(defaultIcon).toBeInTheDocument() + }) + it('should render custom questionIcon when provided', () => { const { container } = renderWithProvider( makeItem(), @@ -509,7 +519,7 @@ describe('Question component', () => { ) expect(screen.getByTestId('custom-question-icon')).toBeInTheDocument() - const defaultIcon = container.querySelector('.i-custom-public-avatar-user') + const defaultIcon = container.querySelector('.question-default-user-icon') expect(defaultIcon).not.toBeInTheDocument() }) diff --git a/web/app/components/base/chat/chat/question.tsx b/web/app/components/base/chat/chat/question.tsx index 1af54bcf1e..acfed3ea6b 100644 --- a/web/app/components/base/chat/chat/question.tsx +++ b/web/app/components/base/chat/chat/question.tsx @@ -15,6 +15,7 @@ import { import { useTranslation } from 'react-i18next' import Textarea from 'react-textarea-autosize' import { FileList } from '@/app/components/base/file-uploader' +import { User } from '@/app/components/base/icons/src/public/avatar' import { Markdown } from '@/app/components/base/markdown' import { cn } from '@/utils/classnames' import ActionButton from '../../action-button' @@ -243,7 +244,7 @@ const Question: FC = ({ { questionIcon || (
-
+
) }