diff --git a/ignore/measurment_down.PNG b/ignore/measurment_down.PNG new file mode 100644 index 0000000..ba89435 Binary files /dev/null and b/ignore/measurment_down.PNG differ diff --git a/ignore/measurment_up.PNG b/ignore/measurment_up.PNG new file mode 100644 index 0000000..ed87c1e Binary files /dev/null and b/ignore/measurment_up.PNG differ diff --git a/js/ui/chart.js b/js/ui/chart.js index 1696605..9d7b1bb 100644 --- a/js/ui/chart.js +++ b/js/ui/chart.js @@ -283,7 +283,11 @@ export class TradingDashboard { const data = this.candleSeries.data(); if (!data || data.length === 0) return true; - return visibleRange.to >= data.length - 5; + // Only snap to edge if we are actually at the edge or slightly panned into the past, + // but NOT if we are panned into the future (whitespace). + // visibleRange.to > data.length means we are in the future whitespace. + const isNearEdge = visibleRange.to >= data.length - 2 && visibleRange.to <= data.length + 5; + return isNearEdge; } createTimeframeButtons() { @@ -786,7 +790,13 @@ async loadNewData() { //console.log(`[NewData Load] Added ${chartData.length} new candles, total in dataset: ${this.allData.get(this.currentInterval).length}`); if (atEdge) { - this.chart.timeScale().scrollToRealTime(); + // Only auto-scroll if NOT drawing or editing + const dm = this.drawingManager; + const isInteracting = dm && (dm.activeTool !== null || dm.currentDrawing !== null || (dm.selectedDrawing !== null && dm.isMouseDown)); + + if (!isInteracting) { + this.chart.timeScale().scrollToRealTime(); + } } this.updateStats(latest);