From 7ebcbc8acd5e10d48ae987100b879ef0b0509888 Mon Sep 17 00:00:00 2001 From: dextmorgn Date: Mon, 3 Nov 2025 14:38:15 +0100 Subject: [PATCH] fix(app): remove virtualization on relations list --- .../graphs/details-panel/relationships.tsx | 69 +++++-------------- 1 file changed, 18 insertions(+), 51 deletions(-) diff --git a/flowsint-app/src/components/graphs/details-panel/relationships.tsx b/flowsint-app/src/components/graphs/details-panel/relationships.tsx index 56c04173..02485743 100644 --- a/flowsint-app/src/components/graphs/details-panel/relationships.tsx +++ b/flowsint-app/src/components/graphs/details-panel/relationships.tsx @@ -4,9 +4,8 @@ import { TypeBadge } from '@/components/type-badge' import { Badge } from '@/components/ui/badge' import { useGraphStore } from '@/stores/graph-store' import { useQuery } from '@tanstack/react-query' -import { useVirtualizer } from '@tanstack/react-virtual' import { ArrowRight } from 'lucide-react' -import { memo, useCallback, useRef } from 'react' +import { memo, useCallback } from 'react' import { GraphEdge, GraphNode } from '@/types' type Relation = { @@ -33,16 +32,8 @@ const Relationships = memo( queryFn: () => sketchService.getNodeNeighbors(sketchId, nodeId) }) - const parentRef = useRef(null) const relationships = getInlineRelationships(neighborsData?.nds || [], neighborsData?.rls || []) - const rowVirtualizer = useVirtualizer({ - count: relationships.length, - getScrollElement: () => parentRef.current, - estimateSize: () => 40, // Estimate height of each relationship item - overscan: 5 - }) - if (isLoading) return (
@@ -51,48 +42,24 @@ const Relationships = memo( ) return ( -
-
- {rowVirtualizer.getVirtualItems().map((virtualRow) => { - const rel = relationships[virtualRow.index] - return ( -
- -
-
- -
- -
- {rel.edge.label} -
- -
- -
-
-
+
+ {relationships.map((rel, index) => ( + +
+
+
- ) - })} -
+ +
+ {rel.edge.label} +
+ +
+ +
+
+ + ))}
) }