Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

feat(app): fix node positions

dextmorgn4e9c17d98e0a
diff --git a/flowsint-app/src/components/graphs/graph-main.tsx b/flowsint-app/src/components/graphs/graph-main.tsx
index 893bc663..62b320de 100644
--- a/flowsint-app/src/components/graphs/graph-main.tsx
+++ b/flowsint-app/src/components/graphs/graph-main.tsx
@@ -75,7 +75,6 @@ const GraphMain = () => {
showIcons={true}
onGraphRef={handleGraphRef}
allowLasso
- minimap={false}
sketchId={sketchId}
/>
diff --git a/flowsint-app/src/components/graphs/graph-viewer.tsx b/flowsint-app/src/components/graphs/graph-viewer.tsx
index 1f65c33f..c27a7b15 100644
--- a/flowsint-app/src/components/graphs/graph-viewer.tsx
+++ b/flowsint-app/src/components/graphs/graph-viewer.tsx
@@ -34,7 +34,6 @@ interface GraphViewerProps {
onGraphRef?: (ref: any) => void
instanceId?: string // Add instanceId prop for instance-specific actions
allowLasso?: boolean
- minimap?: boolean
sketchId?: string // Add sketchId for saving node positions
}
@@ -150,7 +149,6 @@ const GraphViewer: React.FC<GraphViewerProps> = ({
onGraphRef,
instanceId,
allowLasso = false,
- minimap = false,
sketchId
}) => {
const [containerSize, setContainerSize] = useState({ width: 0, height: 0 })
@@ -181,7 +179,6 @@ const GraphViewer: React.FC<GraphViewerProps> = ({
// Store selectors
const nodeColors = useNodesDisplaySettings((s) => s.colors)
const getSize = useNodesDisplaySettings((s) => s.getSize)
- const view = useGraphControls((s) => s.view)
// Get settings by categories to avoid re-renders
const forceSettings = useGraphSettingsStore((s) => s.forceSettings)
diff --git a/flowsint-app/src/hooks/use-save-node-positions.ts b/flowsint-app/src/hooks/use-save-node-positions.ts
index ab45d202..ee528802 100644
--- a/flowsint-app/src/hooks/use-save-node-positions.ts
+++ b/flowsint-app/src/hooks/use-save-node-positions.ts
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'
import { useDebounce } from './use-debounce'
import { sketchService } from '@/api/sketch-service'
import { useGraphSaveStatus } from '@/stores/graph-save-status-store'
+import { useGraphStore } from '@/stores/graph-store'
interface NodePosition {
x: number
@@ -16,6 +17,7 @@ export type SaveStatus = 'idle' | 'pending' | 'saving' | 'saved' | 'error'
*/
export function useSaveNodePositions(sketchId?: string) {
const [changedNodePositions, setChangedNodePositions] = useState<Map<string, NodePosition>>(new Map())
+ const setNodes = useGraphStore(s => s.setNodes)
const isStabilizingRef = useRef(false) // Start as false, mark as true only during layout regeneration
const setSaveStatus = useGraphSaveStatus((state) => state.setSaveStatus)
@@ -68,6 +70,7 @@ export function useSaveNodePositions(sketchId?: string) {
if (newMap.size > 0) {
setChangedNodePositions(newMap)
+ setNodes(nodes)
setSaveStatus('pending')
}
}, [sketchId])