Feat: Synchronize the data of the tavily form to the canvas node #3221 (#8377)

### What problem does this PR solve?

Feat: Synchronize the data of the tavily form to the canvas node #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-06-20 10:16:32 +08:00
committed by GitHub
parent 972fd919b4
commit c4e081d4c6
10 changed files with 134 additions and 77 deletions

View File

@ -75,6 +75,7 @@ export type RFState = {
generateNodeName: (name: string) => string;
setClickedNodeId: (id?: string) => void;
setClickedToolId: (id?: string) => void;
findUpstreamNodeById: (id?: string | null) => RAGFlowNodeType | undefined;
};
// this is our useStore hook that we can use in our components to get parts of the store and call actions
@ -471,6 +472,11 @@ const useGraphStore = create<RFState>()(
setClickedToolId: (id?: string) => {
set({ clickedToolId: id });
},
findUpstreamNodeById: (id) => {
const { edges, getNode } = get();
const edge = edges.find((x) => x.target === id);
return getNode(edge?.source);
},
})),
{ name: 'graph', trace: true },
),