diff --git a/frontend/src/components/strategyEvaluation/StrategyEvaluationChart.tsx b/frontend/src/components/strategyEvaluation/StrategyEvaluationChart.tsx index a963527..1d3158c 100644 --- a/frontend/src/components/strategyEvaluation/StrategyEvaluationChart.tsx +++ b/frontend/src/components/strategyEvaluation/StrategyEvaluationChart.tsx @@ -531,27 +531,6 @@ const StrategyEvaluationChart: React.FC = ({ emitEvalWindowMeta, ]); - const scrollToBar = useCallback((barIdx: number) => { - const mgr = managerRef.current; - if (!mgr?.hasMainSeries() || barIdx < 0 || barIdx >= bars.length) return; - const bar = bars[barIdx]; - const barSec = timeframeBarSeconds(timeframe); - const pad = Math.max(barSec * 48, 3600); - mgr.applyVisibleTimeRange(bar.time - pad, bar.time + Math.max(barSec * 8, 600)); - }, [bars, timeframe]); - - const prevSelectedBarIndexRef = useRef(selectedBarIndex); - useEffect(() => { - prevSelectedBarIndexRef.current = -1; - }, [market, timeframe, strategy?.id, paramsRevision]); - - useEffect(() => { - if (bars.length === 0) return; - if (prevSelectedBarIndexRef.current === selectedBarIndex) return; - prevSelectedBarIndexRef.current = selectedBarIndex; - scrollToBar(selectedBarIndex); - }, [selectedBarIndex, bars.length, scrollToBar]); - const onManagerReady = useCallback((mgr: ChartManager) => { managerRef.current = mgr; setChartMgr(mgr);