add features collaboration

This commit is contained in:
hjlarry
2025-08-06 10:58:32 +08:00
parent 48c069fe68
commit 2ecf9f6ddf
2 changed files with 39 additions and 5 deletions

View File

@ -14,14 +14,15 @@ import useConfig from './nodes/start/use-config'
import type { StartNodeType } from './nodes/start/types'
import type { PromptVariable } from '@/models/debug'
import NewFeaturePanel from '@/app/components/base/features/new-feature-panel'
import { useWebSocketStore } from '@/app/components/workflow/store/websocket-store'
const Features = () => {
const setShowFeaturesPanel = useStore(s => s.setShowFeaturesPanel)
const isChatMode = useIsChatMode()
const { nodesReadOnly } = useNodesReadOnly()
const { handleSyncWorkflowDraft } = useNodesSyncDraft()
const { doSyncWorkflowDraft } = useNodesSyncDraft()
const nodes = useNodes<CommonNodeType>()
const { emit } = useWebSocketStore()
const startNode = nodes.find(node => node.data.type === 'start')
const { id, data } = startNode as Node<StartNodeType>
const { handleAddVariable } = useConfig(id, data)
@ -40,9 +41,13 @@ const Features = () => {
}
const handleFeaturesChange = useCallback(() => {
handleSyncWorkflowDraft()
doSyncWorkflowDraft(false, {
onSuccess() {
emit('varsAndFeaturesUpdate')
},
})
setShowFeaturesPanel(true)
}, [handleSyncWorkflowDraft, setShowFeaturesPanel])
}, [doSyncWorkflowDraft, setShowFeaturesPanel])
return (
<NewFeaturePanel