From 07fea50216d9b2ce7dd29e8bd0de0449b1c5bbab Mon Sep 17 00:00:00 2001 From: JzoNg Date: Sat, 9 May 2026 10:36:16 +0800 Subject: [PATCH] fix(web): remote file upload --- .../chat/answer/__tests__/operation.spec.tsx | 7 +++++ .../base/chat/chat/answer/operation.tsx | 10 +++--- .../__tests__/index.spec.tsx | 23 ++++++++++++++ .../file-uploader-in-attachment/index.tsx | 31 +++++++++++-------- 4 files changed, 54 insertions(+), 17 deletions(-) diff --git a/web/app/components/base/chat/chat/answer/__tests__/operation.spec.tsx b/web/app/components/base/chat/chat/answer/__tests__/operation.spec.tsx index 094c5c987b..4eb8f37f19 100644 --- a/web/app/components/base/chat/chat/answer/__tests__/operation.spec.tsx +++ b/web/app/components/base/chat/chat/answer/__tests__/operation.spec.tsx @@ -248,6 +248,13 @@ describe('Operation', () => { expect(screen.getByTestId('log-btn'))!.toBeInTheDocument() }) + it('should keep hover-only controls visible when a descendant popup is open', () => { + renderOperation({ ...baseProps, showPromptLog: true }) + + expect(screen.getByTestId('operation-actions')).toHaveClass('group-has-[[data-popup-open]]:flex') + expect(screen.getByTestId('log-btn').parentElement).toHaveClass('group-has-[[data-popup-open]]:block') + }) + it('should not show prompt log for opening statements', () => { const item = { ...baseItem, isOpeningStatement: true } renderOperation({ ...baseProps, item, showPromptLog: true }) diff --git a/web/app/components/base/chat/chat/answer/operation.tsx b/web/app/components/base/chat/chat/answer/operation.tsx index 6804271d64..178a5e8e3c 100644 --- a/web/app/components/base/chat/chat/answer/operation.tsx +++ b/web/app/components/base/chat/chat/answer/operation.tsx @@ -41,6 +41,8 @@ type FeedbackTooltipProps = { } const feedbackTooltipClassName = 'max-w-[260px]' +const answerActiveFlexClassName = 'group-hover:flex group-has-[[data-popup-open]]:flex' +const answerActiveBlockClassName = 'group-hover:block group-has-[[data-popup-open]]:block' const FeedbackTooltip = ({ content, children }: FeedbackTooltipProps) => { return ( @@ -199,7 +201,7 @@ function Operation({ {shouldShowUserFeedbackBar && !humanInputFormDataList?.length && (
{hasUserFeedback @@ -241,7 +243,7 @@ function Operation({ {shouldShowAdminFeedbackBar && !humanInputFormDataList?.length && (
{displayUserFeedback?.rating && ( @@ -308,12 +310,12 @@ function Operation({
)} {showPromptLog && !isOpeningStatement && ( -
+
)} {!isOpeningStatement && ( -
+