File tree Expand file tree Collapse file tree 1 file changed +0
-6
lines changed
Expand file tree Collapse file tree 1 file changed +0
-6
lines changed Original file line number Diff line number Diff line change @@ -405,17 +405,11 @@ export function GitVisualizer({
405405 } , [ commits ] ) ;
406406
407407 // Re-run layout when commit set changes size to avoid race conditions during rapid branch switches
408- const lastElementCountRef = useRef < number > ( 0 ) ;
409408 useEffect ( ( ) => {
410409 const cy = cyRef . current ;
411410 if ( ! cy ) return ;
412411 const elementCount = elements . length ;
413412 if ( ! elementCount ) return ;
414- // Only run a fresh layout if number of nodes or edges changed significantly
415- const shouldRelayout = elementCount !== lastElementCountRef . current ;
416- lastElementCountRef . current = elementCount ;
417- if ( ! shouldRelayout ) return ;
418-
419413 // Defer layout to next frame to ensure Cytoscape has applied React prop diff
420414 const frame = requestAnimationFrame ( ( ) => {
421415 const liveCy = cyRef . current ;
You can’t perform that action at this time.
0 commit comments