Feat: Collapse the excess portion of the tool node and retrieval node #9869 (#10604)

### What problem does this PR solve?

Feat: Collapse the excess portion of the tool node and retrieval node
#9869

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-10-16 15:17:13 +08:00
committed by GitHub
parent 8a41057236
commit 7b664b5a84
5 changed files with 97 additions and 35 deletions

View File

@ -1,3 +1,4 @@
import { NodeCollapsible } from '@/components/collapse';
import { RAGFlowAvatar } from '@/components/ragflow-avatar';
import { useFetchKnowledgeList } from '@/hooks/knowledge-hooks';
import { IRetrievalNode } from '@/interfaces/database/flow';
@ -44,8 +45,8 @@ function InnerRetrievalNode({
[styles.nodeHeader]: knowledgeBaseIds.length > 0,
})}
></NodeHeader>
<section className="flex flex-col gap-2">
{knowledgeBaseIds.map((id) => {
<NodeCollapsible items={knowledgeBaseIds}>
{(id) => {
const item = knowledgeList.find((y) => id === y.id);
const label = getLabel(id);
@ -63,8 +64,8 @@ function InnerRetrievalNode({
</div>
</div>
);
})}
</section>
}}
</NodeCollapsible>
</NodeWrapper>
</ToolBar>
);