Merge branch 'dev' into feat/file-attachment

This commit is contained in:
Dinh Long Nguyen 2025-10-14 14:06:17 +07:00 committed by GitHub
commit b23e88f078
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 21 deletions

View File

@ -973,7 +973,6 @@ const ChatInput = ({
)}
<TextareaAutosize
ref={textareaRef}
disabled={Boolean(streamingContent)}
minRows={2}
rows={1}
maxRows={10}
@ -989,15 +988,15 @@ const ChatInput = ({
// e.keyCode 229 is for IME input with Safari
const isComposing =
e.nativeEvent.isComposing || e.keyCode === 229
if (
e.key === 'Enter' &&
!e.shiftKey &&
prompt.trim() &&
!isComposing
) {
if (e.key === 'Enter' && !e.shiftKey && !isComposing) {
e.preventDefault()
// Submit the message when Enter is pressed without Shift
handleSendMessage(prompt)
// Submit prompt when the following conditions are met:
// - Enter is pressed without Shift
// - The streaming content has finished
// - Prompt is not empty
if (!streamingContent && prompt.trim()) {
handleSendMessage(prompt)
}
// When Shift+Enter is pressed, a new line is added (default behavior)
}
}}

View File

@ -413,18 +413,6 @@ describe('ChatInput', () => {
})
})
it('disables input when streaming', async () => {
// Mock streaming state
mockAppState.streamingContent = { thread_id: 'test-thread' }
await act(async () => {
renderWithRouter()
})
const textarea = screen.getByTestId('chat-input')
expect(textarea).toBeDisabled()
})
it('shows tools dropdown when model supports tools and MCP servers are connected', async () => {
// Mock connected servers
mockGetConnectedServers.mockResolvedValue(['server1'])