fix:merge conflicts
This commit is contained in:
commit
23508eaa74
2 changed files with 31 additions and 0 deletions
|
|
@ -181,7 +181,11 @@ export function FormGeneratorControls({
|
||||||
size="sm"
|
size="sm"
|
||||||
icon={FaTrash}
|
icon={FaTrash}
|
||||||
>
|
>
|
||||||
|
<<<<<<< HEAD
|
||||||
{allItemsSelected
|
{allItemsSelected
|
||||||
|
=======
|
||||||
|
{selectedCount === displayData.length && displayData.length > 0
|
||||||
|
>>>>>>> c76e7efd28210f45737b5afbdddff2712b2c0cc7
|
||||||
? t('formgen.delete.all', `Delete all ${selectedCount} items`).replace('{count}', selectedCount.toString())
|
? t('formgen.delete.all', `Delete all ${selectedCount} items`).replace('{count}', selectedCount.toString())
|
||||||
: t('formgen.delete.multiple', `Delete ${selectedCount} selected items`).replace('{count}', selectedCount.toString())}
|
: t('formgen.delete.multiple', `Delete ${selectedCount} selected items`).replace('{count}', selectedCount.toString())}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
|
|
@ -348,6 +348,7 @@ export function useChatbot() {
|
||||||
setInputValue(value);
|
setInputValue(value);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
// Handle file upload
|
// Handle file upload
|
||||||
const handleFileUpload = useCallback(async (file: File): Promise<{ success: boolean; data?: any }> => {
|
const handleFileUpload = useCallback(async (file: File): Promise<{ success: boolean; data?: any }> => {
|
||||||
setUploadError(null);
|
setUploadError(null);
|
||||||
|
|
@ -415,6 +416,8 @@ export function useChatbot() {
|
||||||
setUploadedFiles(prev => prev.filter(f => f.fileId !== fileId));
|
setUploadedFiles(prev => prev.filter(f => f.fileId !== fileId));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
=======
|
||||||
|
>>>>>>> c76e7efd28210f45737b5afbdddff2712b2c0cc7
|
||||||
// Stop chatbot workflow
|
// Stop chatbot workflow
|
||||||
const stopChatbot = useCallback(async () => {
|
const stopChatbot = useCallback(async () => {
|
||||||
if (!workflowId || !isRunning) {
|
if (!workflowId || !isRunning) {
|
||||||
|
|
@ -473,6 +476,7 @@ export function useChatbot() {
|
||||||
const abortController = new AbortController();
|
const abortController = new AbortController();
|
||||||
streamAbortControllerRef.current = abortController;
|
streamAbortControllerRef.current = abortController;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
// Use ref to get current file IDs (avoids closure issues)
|
// Use ref to get current file IDs (avoids closure issues)
|
||||||
const fileIdsToSend = pendingFileIdsRef.current.length > 0
|
const fileIdsToSend = pendingFileIdsRef.current.length > 0
|
||||||
? pendingFileIdsRef.current
|
? pendingFileIdsRef.current
|
||||||
|
|
@ -483,11 +487,15 @@ export function useChatbot() {
|
||||||
console.log('[handleSubmit] pendingFileIds from ref:', pendingFileIdsRef.current);
|
console.log('[handleSubmit] pendingFileIds from ref:', pendingFileIdsRef.current);
|
||||||
console.log('[handleSubmit] fileIdsToSend:', fileIdsToSend);
|
console.log('[handleSubmit] fileIdsToSend:', fileIdsToSend);
|
||||||
|
|
||||||
|
=======
|
||||||
|
// Prepare request body
|
||||||
|
>>>>>>> c76e7efd28210f45737b5afbdddff2712b2c0cc7
|
||||||
const requestBody: StartChatbotRequest = {
|
const requestBody: StartChatbotRequest = {
|
||||||
prompt: trimmedInput,
|
prompt: trimmedInput,
|
||||||
userLanguage: 'en',
|
userLanguage: 'en',
|
||||||
...(workflowId && { workflowId })
|
...(workflowId && { workflowId })
|
||||||
};
|
};
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
// Always include listFileId if there are any files
|
// Always include listFileId if there are any files
|
||||||
if (fileIdsToSend.length > 0) {
|
if (fileIdsToSend.length > 0) {
|
||||||
|
|
@ -498,6 +506,8 @@ export function useChatbot() {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[handleSubmit] Final requestBody:', JSON.stringify(requestBody, null, 2));
|
console.log('[handleSubmit] Final requestBody:', JSON.stringify(requestBody, null, 2));
|
||||||
|
=======
|
||||||
|
>>>>>>> c76e7efd28210f45737b5afbdddff2712b2c0cc7
|
||||||
|
|
||||||
// Track if workflow was created in this request
|
// Track if workflow was created in this request
|
||||||
let workflowCreated = false;
|
let workflowCreated = false;
|
||||||
|
|
@ -546,10 +556,13 @@ export function useChatbot() {
|
||||||
if (!abortController.signal.aborted) {
|
if (!abortController.signal.aborted) {
|
||||||
setIsRunning(false);
|
setIsRunning(false);
|
||||||
setInputValue(''); // Clear input on completion
|
setInputValue(''); // Clear input on completion
|
||||||
|
<<<<<<< HEAD
|
||||||
// Clear pending file IDs after successful submission (files are now part of conversation)
|
// Clear pending file IDs after successful submission (files are now part of conversation)
|
||||||
setPendingFileIds([]);
|
setPendingFileIds([]);
|
||||||
pendingFileIdsRef.current = []; // Clear ref too
|
pendingFileIdsRef.current = []; // Clear ref too
|
||||||
setUploadedFiles([]);
|
setUploadedFiles([]);
|
||||||
|
=======
|
||||||
|
>>>>>>> c76e7efd28210f45737b5afbdddff2712b2c0cc7
|
||||||
// Clear thinking message on completion if no final message was received
|
// Clear thinking message on completion if no final message was received
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
clearThinkingMessage();
|
clearThinkingMessage();
|
||||||
|
|
@ -572,7 +585,11 @@ export function useChatbot() {
|
||||||
setIsSubmitting(false);
|
setIsSubmitting(false);
|
||||||
streamAbortControllerRef.current = null;
|
streamAbortControllerRef.current = null;
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
}, [inputValue, workflowId, isRunning, isSubmitting, stopChatbot, processChatDataItem, clearThinkingMessage, loadThreads, pendingFileIds]);
|
}, [inputValue, workflowId, isRunning, isSubmitting, stopChatbot, processChatDataItem, clearThinkingMessage, loadThreads, pendingFileIds]);
|
||||||
|
=======
|
||||||
|
}, [inputValue, workflowId, isRunning, isSubmitting, stopChatbot, processChatDataItem, clearThinkingMessage, loadThreads]);
|
||||||
|
>>>>>>> c76e7efd28210f45737b5afbdddff2712b2c0cc7
|
||||||
|
|
||||||
// Delete a chatbot workflow
|
// Delete a chatbot workflow
|
||||||
const handleDeleteThread = useCallback(async (workflowIdToDelete: string): Promise<boolean> => {
|
const handleDeleteThread = useCallback(async (workflowIdToDelete: string): Promise<boolean> => {
|
||||||
|
|
@ -632,9 +649,12 @@ export function useChatbot() {
|
||||||
setSelectedThreadId(null);
|
setSelectedThreadId(null);
|
||||||
setError(null);
|
setError(null);
|
||||||
setInputValue('');
|
setInputValue('');
|
||||||
|
<<<<<<< HEAD
|
||||||
setPendingFileIds([]);
|
setPendingFileIds([]);
|
||||||
pendingFileIdsRef.current = [];
|
pendingFileIdsRef.current = [];
|
||||||
setUploadedFiles([]);
|
setUploadedFiles([]);
|
||||||
|
=======
|
||||||
|
>>>>>>> c76e7efd28210f45737b5afbdddff2712b2c0cc7
|
||||||
thinkingLogsRef.current = [];
|
thinkingLogsRef.current = [];
|
||||||
thinkingMessageIdRef.current = null;
|
thinkingMessageIdRef.current = null;
|
||||||
clearProcessedMessages();
|
clearProcessedMessages();
|
||||||
|
|
@ -655,9 +675,12 @@ export function useChatbot() {
|
||||||
setIsSubmitting(false);
|
setIsSubmitting(false);
|
||||||
setError(null);
|
setError(null);
|
||||||
setInputValue('');
|
setInputValue('');
|
||||||
|
<<<<<<< HEAD
|
||||||
setPendingFileIds([]);
|
setPendingFileIds([]);
|
||||||
pendingFileIdsRef.current = [];
|
pendingFileIdsRef.current = [];
|
||||||
setUploadedFiles([]);
|
setUploadedFiles([]);
|
||||||
|
=======
|
||||||
|
>>>>>>> c76e7efd28210f45737b5afbdddff2712b2c0cc7
|
||||||
thinkingLogsRef.current = [];
|
thinkingLogsRef.current = [];
|
||||||
thinkingMessageIdRef.current = null;
|
thinkingMessageIdRef.current = null;
|
||||||
clearProcessedMessages();
|
clearProcessedMessages();
|
||||||
|
|
@ -717,6 +740,7 @@ export function useChatbot() {
|
||||||
stopChatbot,
|
stopChatbot,
|
||||||
resetChatbot,
|
resetChatbot,
|
||||||
startNewChat,
|
startNewChat,
|
||||||
|
<<<<<<< HEAD
|
||||||
cleanup,
|
cleanup,
|
||||||
|
|
||||||
// File upload interface
|
// File upload interface
|
||||||
|
|
@ -727,6 +751,9 @@ export function useChatbot() {
|
||||||
uploadedFiles,
|
uploadedFiles,
|
||||||
uploadingFile,
|
uploadingFile,
|
||||||
uploadError
|
uploadError
|
||||||
|
=======
|
||||||
|
cleanup
|
||||||
|
>>>>>>> c76e7efd28210f45737b5afbdddff2712b2c0cc7
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue