From b2fef0bd45add049a3887a416528a61dff3b7e24 Mon Sep 17 00:00:00 2001 From: DiTus Date: Thu, 26 Feb 2026 15:04:57 +0100 Subject: [PATCH] Add extensive diagnostic logging to track indicator array lifecycle - Log initIndicatorPanel call stack - Log addIndicator with array count changes - Helps identify when/why activeIndicators gets cleared on TF switch --- src/api/dashboard/static/js/ui/indicators-panel-new.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/api/dashboard/static/js/ui/indicators-panel-new.js b/src/api/dashboard/static/js/ui/indicators-panel-new.js index 17323fd..c321c73 100644 --- a/src/api/dashboard/static/js/ui/indicators-panel-new.js +++ b/src/api/dashboard/static/js/ui/indicators-panel-new.js @@ -88,6 +88,8 @@ function groupPlotsByColor(plots) { export function initIndicatorPanel() { console.log('[IndicatorPanel] Initializing...'); + console.log('[IndicatorPanel] Current activeIndicators count:', activeIndicators.length); + console.trace('[IndicatorPanel] initIndicatorPanel call stack:'); renderIndicatorPanel(); console.log('[IndicatorPanel] Initialized'); } @@ -626,6 +628,9 @@ function addIndicator(type) { params[input.name] = input.default; }); + console.log(`[addIndicator] Adding ${id} to array, current count: ${activeIndicators.length}`); + console.trace('Call stack:'); + activeIndicators.push({ id, type, @@ -635,6 +640,9 @@ function addIndicator(type) { series: [], visible: true }); + + console.log(`[addIndicator] After push, array count: ${activeIndicators.length}`); + // Don't set configuringId so indicators are NOT expanded by default renderIndicatorPanel(); drawIndicatorsOnChart();