mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -117,6 +117,7 @@ export function NetworkSearch({ className }: NetworkSearchProps) {
|
||||
ref={inputRef}
|
||||
type="text"
|
||||
value={inputValue}
|
||||
maxLength={200}
|
||||
onChange={(e) => setInputValue(e.target.value)}
|
||||
onFocus={() => {
|
||||
if (searchResults && debouncedQuery.length >= 2) setIsDropdownOpen(true);
|
||||
|
||||
Reference in New Issue
Block a user