Fix: File selection in Retrieval testing causes other options to disappear (#7759)

### What problem does this PR solve?

https://github.com/infiniflow/ragflow/issues/7753

The internal is due to when the selected row keys change will trigger a
testing, but I do not know why.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Stephen Hu
2025-05-30 09:38:50 +08:00
committed by GitHub
parent e97fd2b5e6
commit a31ad7f960
9 changed files with 150 additions and 18 deletions

View File

@ -1,6 +1,9 @@
import { useFetchMindMap, useFetchRelatedQuestions } from '@/hooks/chat-hooks';
import { useSetModalState } from '@/hooks/common-hooks';
import { useTestChunkRetrieval } from '@/hooks/knowledge-hooks';
import {
useTestChunkAllRetrieval,
useTestChunkRetrieval,
} from '@/hooks/knowledge-hooks';
import {
useGetPaginationWithRouter,
useSendMessageWithSse,
@ -21,6 +24,7 @@ export const useSendQuestion = (kbIds: string[]) => {
api.ask,
);
const { testChunk, loading } = useTestChunkRetrieval();
const { testChunkAll, loading: loadingAll } = useTestChunkAllRetrieval();
const [sendingLoading, setSendingLoading] = useState(false);
const [currentAnswer, setCurrentAnswer] = useState({} as IAnswer);
const { fetchRelatedQuestions, data: relatedQuestions } =
@ -88,6 +92,15 @@ export const useSendQuestion = (kbIds: string[]) => {
page,
size,
});
testChunkAll({
kb_id: kbIds,
highlight: true,
question: q,
doc_ids: [],
page,
size,
});
},
[sendingLoading, searchStr, kbIds, testChunk, selectedDocumentIds],
);