From bd25240123cf046dd36adc819d6a2e8cf5eed012 Mon Sep 17 00:00:00 2001 From: hyl64 <78853927+hyl64@users.noreply.github.com> Date: Fri, 17 Apr 2026 16:21:32 +0800 Subject: [PATCH 1/2] fix: raise chat settings select dropdown above dialog (#35357) Co-authored-by: Stephen Zhou --- .../inputs-form/__tests__/content.spec.tsx | 13 +++++++++++++ .../chat/chat-with-history/inputs-form/content.tsx | 2 +- .../inputs-form/__tests__/content.spec.tsx | 11 +++++++++++ .../chat/embedded-chatbot/inputs-form/content.tsx | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/web/app/components/base/chat/chat-with-history/inputs-form/__tests__/content.spec.tsx b/web/app/components/base/chat/chat-with-history/inputs-form/__tests__/content.spec.tsx index c1a0f3e294..6081024490 100644 --- a/web/app/components/base/chat/chat-with-history/inputs-form/__tests__/content.spec.tsx +++ b/web/app/components/base/chat/chat-with-history/inputs-form/__tests__/content.spec.tsx @@ -248,6 +248,19 @@ describe('InputsFormContent', () => { expect(mockSetCurrentConversationInputs).toHaveBeenCalledWith(expect.objectContaining({ sel: 'A' })) }) + it('renders select dropdown above the settings dialog layer', async () => { + const user = userEvent.setup() + const context = createMockContext({ + inputsForms: [{ variable: 'sel', type: InputVarType.select, label: 'Sel', options: ['A', 'B'], default: 'B' }], + currentConversationInputs: {}, + }) + + renderWithContext(, context) + await user.click(screen.getByText('B')) + + expect(screen.getByText('A').closest('.z-\\[60\\]')).not.toBeNull() + }) + it('handles select input with existing value (value not in options -> shows placeholder)', () => { const context = createMockContext({ inputsForms: [{ variable: 'sel', type: InputVarType.select, label: 'Sel', options: ['A'], default: undefined }], diff --git a/web/app/components/base/chat/chat-with-history/inputs-form/content.tsx b/web/app/components/base/chat/chat-with-history/inputs-form/content.tsx index 127cf2c252..4baa46744d 100644 --- a/web/app/components/base/chat/chat-with-history/inputs-form/content.tsx +++ b/web/app/components/base/chat/chat-with-history/inputs-form/content.tsx @@ -86,7 +86,7 @@ const InputsFormContent = ({ showTip }: Props) => { )} {form.type === InputVarType.select && ( ({ value: option, name: option }))} onSelect={item => handleFormChange(form.variable, item.value as string)} diff --git a/web/app/components/base/chat/embedded-chatbot/inputs-form/__tests__/content.spec.tsx b/web/app/components/base/chat/embedded-chatbot/inputs-form/__tests__/content.spec.tsx index 526fca2061..f682752645 100644 --- a/web/app/components/base/chat/embedded-chatbot/inputs-form/__tests__/content.spec.tsx +++ b/web/app/components/base/chat/embedded-chatbot/inputs-form/__tests__/content.spec.tsx @@ -200,6 +200,17 @@ describe('InputsFormContent', () => { expect(mockContextValue.handleNewConversationInputsChange).toHaveBeenCalled() }) + it('should render select dropdown above the settings dialog layer', async () => { + render() + const selectTrigger = screen.getAllByText(/Select Label/i).find(el => el.tagName === 'SPAN') + if (!selectTrigger) + throw new Error('Select trigger not found') + + await user.click(selectTrigger) + + expect(screen.getByText('Option 1').closest('.z-\\[60\\]')).not.toBeNull() + }) + it('should handle single file upload change', async () => { render() const uploadButtons = screen.getAllByText('Upload') diff --git a/web/app/components/base/chat/embedded-chatbot/inputs-form/content.tsx b/web/app/components/base/chat/embedded-chatbot/inputs-form/content.tsx index 2ce40480c3..733e3b1101 100644 --- a/web/app/components/base/chat/embedded-chatbot/inputs-form/content.tsx +++ b/web/app/components/base/chat/embedded-chatbot/inputs-form/content.tsx @@ -86,7 +86,7 @@ const InputsFormContent = ({ showTip }: Props) => { )} {form.type === InputVarType.select && ( ({ value: option, name: option }))} onSelect={item => handleFormChange(form.variable, item.value as string)} From f56ce9d3b1ad33b31a445be8b497d45918643d8e Mon Sep 17 00:00:00 2001 From: hyl64 <78853927+hyl64@users.noreply.github.com> Date: Fri, 17 Apr 2026 16:34:04 +0800 Subject: [PATCH 2/2] fix: guard chat file preview rendering when mime type is missing (#35355) Co-authored-by: Stephen Zhou --- .../__tests__/file-item.spec.tsx | 15 +++++++++++++++ .../file-uploader-in-chat-input/file-item.tsx | 7 ++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/web/app/components/base/file-uploader/file-uploader-in-chat-input/__tests__/file-item.spec.tsx b/web/app/components/base/file-uploader/file-uploader-in-chat-input/__tests__/file-item.spec.tsx index c03f009cee..00dd7d9971 100644 --- a/web/app/components/base/file-uploader/file-uploader-in-chat-input/__tests__/file-item.spec.tsx +++ b/web/app/components/base/file-uploader/file-uploader-in-chat-input/__tests__/file-item.spec.tsx @@ -222,6 +222,21 @@ describe('FileItem (chat-input)', () => { expect(document.querySelector('audio')).not.toBeInTheDocument() }) + it('should not throw when file type is missing', () => { + expect(() => { + render( + , + ) + }).not.toThrow() + }) + it('should close video preview', () => { render( { - type.split('/')[0] === 'audio' && canPreview && previewUrl && ( + typeCategory === 'audio' && canPreview && previewUrl && ( { setPreviewUrl('') }} /> ) }