fix: remove dead store code and add search input maxLength

- Remove unused networkData, searchQuery, searchResults from zustand store
- Remove setNetworkData write in NetworkGraph
- Add maxLength={200} to search input
This commit is contained in:
Fringg
2026-03-19 08:08:18 +03:00
parent 235eaec85f
commit 0f756d633d
3 changed files with 3 additions and 30 deletions

View File

@@ -113,8 +113,6 @@ export function NetworkGraph({ data, className }: NetworkGraphProps) {
const hoveredNodeId = useReferralNetworkStore((s) => s.hoveredNodeId);
const highlightedNodes = useReferralNetworkStore((s) => s.highlightedNodes);
const filters = useReferralNetworkStore((s) => s.filters);
const setNetworkData = useReferralNetworkStore((s) => s.setNetworkData);
const killFA2 = useCallback(() => {
if (fa2TimerRef.current !== null) {
clearTimeout(fa2TimerRef.current);
@@ -140,8 +138,6 @@ export function NetworkGraph({ data, className }: NetworkGraphProps) {
const graph = buildFullGraph(data);
graphRef.current = graph;
setNetworkData(data);
// Compute initial hidden set from current filters
const initialFilters = useReferralNetworkStore.getState().filters;
hiddenNodesRef.current = computeHiddenNodes(graph, initialFilters);
@@ -301,7 +297,7 @@ export function NetworkGraph({ data, className }: NetworkGraphProps) {
setSigmaInstance(null);
setGraphInstance(null);
};
}, [data, setSelectedNode, setHoveredNode, setNetworkData, killFA2]);
}, [data, setSelectedNode, setHoveredNode, killFA2]);
// Recompute hidden nodes when filters change, then refresh sigma
// (no graph rebuild — positions and Sigma instance preserved)