feat(graph): Add editing function for entity and relationship attributes

This commit is contained in:
choizhang
2025-04-12 00:48:19 +08:00
parent 9487eca772
commit 7e3e685763
6 changed files with 421 additions and 8 deletions

View File

@@ -116,6 +116,10 @@ interface GraphState {
// Node operation state
nodeToExpand: string | null
nodeToPrune: string | null
// Version counter to trigger data refresh
graphDataVersion: number
incrementGraphDataVersion: () => void
}
const useGraphStoreBase = create<GraphState>()((set) => ({
@@ -219,6 +223,10 @@ const useGraphStoreBase = create<GraphState>()((set) => ({
triggerNodeExpand: (nodeId: string | null) => set({ nodeToExpand: nodeId }),
triggerNodePrune: (nodeId: string | null) => set({ nodeToPrune: nodeId }),
// Version counter implementation
graphDataVersion: 0,
incrementGraphDataVersion: () => set((state) => ({ graphDataVersion: state.graphDataVersion + 1 })),
}))
const useGraphStore = createSelectors(useGraphStoreBase)