From 6dd4d1c5dde58befbd5a5f47ec2de398a35df6b3 Mon Sep 17 00:00:00 2001 From: DiTus Date: Sun, 1 Mar 2026 22:45:44 +0100 Subject: [PATCH] fixed: remember RSI pane height across data updates --- .../dashboard/static/js/ui/indicators-panel-new.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 1d0afb2..d21ce99 100644 --- a/src/api/dashboard/static/js/ui/indicators-panel-new.js +++ b/src/api/dashboard/static/js/ui/indicators-panel-new.js @@ -649,7 +649,8 @@ function addIndicator(type) { params, plots: metadata.plots, series: [], - visible: true + visible: true, + paneHeight: Math.floor(window.innerHeight * 0.2) // default 20% of screen }); // Don't set configuringId so indicators are NOT expanded by default @@ -920,10 +921,9 @@ export function drawIndicatorsOnChart() { } }); - // Calculate heights based on VISIBLE indicators only + // Set main pane height (60% if indicator panes exist, 100% otherwise) const totalPanes = 1 + paneIndicators.length; const mainPaneHeight = paneIndicators.length > 0 ? 60 : 100; - const paneHeight = paneIndicators.length > 0 ? Math.floor(40 / paneIndicators.length) : 0; window.dashboard.chart.panes()[0]?.setHeight(mainPaneHeight); @@ -948,7 +948,10 @@ export function drawIndicatorsOnChart() { const pane = window.dashboard.chart.panes()[paneIndex]; if (pane) { - pane.setHeight(paneHeight); + // Use stored height or default to 20% of chart height + const defaultHeight = Math.floor(window.innerHeight * 0.2); + const storedHeight = indicator.paneHeight || defaultHeight; + pane.setHeight(storedHeight); } });