refactor collaboration

This commit is contained in:
hjlarry
2025-08-03 13:34:07 +08:00
parent 7233b4de55
commit 348fd18230
11 changed files with 240 additions and 343 deletions

View File

@ -83,7 +83,6 @@ import Confirm from '@/app/components/base/confirm'
import DatasetsDetailProvider from './datasets-detail-store/provider'
import { HooksStoreContextProvider } from './hooks-store'
import type { Shape as HooksStoreShape } from './hooks-store'
import { useCollaborationStore } from '@/app/components/workflow/store/collaboration-store'
const nodeTypes = {
[CUSTOM_NODE]: CustomNode,
@ -128,21 +127,6 @@ export const Workflow: FC<WorkflowProps> = memo(({
return workflowCanvasHeight - bottomPanelHeight
}, [workflowCanvasHeight, bottomPanelHeight])
const collaborationNodes = useCollaborationStore((state) => {
return state.nodes
})
const collaborationEdges = useCollaborationStore((state) => {
return state.edges
})
useEffect(() => {
setNodes(collaborationNodes)
}, [collaborationNodes, setNodes])
useEffect(() => {
setEdges(collaborationEdges)
}, [collaborationEdges, setEdges])
// update workflow Canvas width and height
useEffect(() => {
if (workflowContainerRef.current) {