Merge branch 'edit-node' into add-graph-db-lock

This commit is contained in:
yangdx
2025-04-14 03:39:57 +08:00
10 changed files with 681 additions and 10 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)