From 5088ab5061cb634eb807e936cd08dca27f7e41c7 Mon Sep 17 00:00:00 2001 From: HyaCinth <88471803+HyaCiovo@users.noreply.github.com> Date: Wed, 30 Apr 2025 10:57:23 +0800 Subject: [PATCH] feat(logAndAnn): add control option for question editing feature (#19117) --- web/app/components/app/log/list.tsx | 2 ++ web/app/components/base/chat/chat/index.tsx | 1 + web/app/components/base/chat/chat/question.tsx | 6 ++++-- web/app/components/base/chat/types.ts | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/web/app/components/app/log/list.tsx b/web/app/components/app/log/list.tsx index 056ce84f1..7ce164c01 100644 --- a/web/app/components/app/log/list.tsx +++ b/web/app/components/app/log/list.tsx @@ -429,6 +429,7 @@ function DetailPanel({ detail, onFeedback }: IDetailPanel) { text_to_speech: { enabled: true, }, + questionEditEnable: false, supportAnnotation: true, annotation_reply: { enabled: true, @@ -484,6 +485,7 @@ function DetailPanel({ detail, onFeedback }: IDetailPanel) { text_to_speech: { enabled: true, }, + questionEditEnable: false, supportAnnotation: true, annotation_reply: { enabled: true, diff --git a/web/app/components/base/chat/chat/index.tsx b/web/app/components/base/chat/chat/index.tsx index 27952fe46..7c8eb23b1 100644 --- a/web/app/components/base/chat/chat/index.tsx +++ b/web/app/components/base/chat/chat/index.tsx @@ -265,6 +265,7 @@ const Chat: FC = ({ item={item} questionIcon={questionIcon} theme={themeBuilder?.theme} + enableEdit={config?.questionEditEnable} switchSibling={switchSibling} /> ) diff --git a/web/app/components/base/chat/chat/question.tsx b/web/app/components/base/chat/chat/question.tsx index af4d64964..3f7f2e837 100644 --- a/web/app/components/base/chat/chat/question.tsx +++ b/web/app/components/base/chat/chat/question.tsx @@ -28,6 +28,7 @@ type QuestionProps = { item: ChatItem questionIcon?: ReactNode theme: Theme | null | undefined + enableEdit?: boolean switchSibling?: (siblingMessageId: string) => void } @@ -35,6 +36,7 @@ const Question: FC = ({ item, questionIcon, theme, + enableEdit = true, switchSibling, }) => { const { t } = useTranslation() @@ -87,9 +89,9 @@ const Question: FC = ({ }}> - + {enableEdit && - + }
& { supportAnnotation?: boolean appId?: string + questionEditEnable?: boolean supportFeedback?: boolean supportCitationHitInfo?: boolean }