From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 07C9B1FF14F for ; Wed, 17 Jun 2026 14:58:47 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9C883353A5; Wed, 17 Jun 2026 14:58:46 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Subject: [PATCH widget-toolkit] fix #7721: fix zoom interaction on charts with no initial store Date: Wed, 17 Jun 2026 14:58:00 +0200 Message-ID: <20260617125812.3418396-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.049 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: JSVCSNEYMYABXF7FYKTGX6OELE4QWR77 X-Message-ID-Hash: JSVCSNEYMYABXF7FYKTGX6OELE4QWR77 X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: In our current ExtJs version (7.0), having animations disabled on charts breaks the zoom interaction. One can zoom in and out once, but never again. We generally keep animations enabled on our proxmoxRRDChart, but only after the store's first load, to avoid animating from the empty store to the initial data. This happens in initComponent on the store that was given during instantiation. In some cases, however (e.g. the PBS datastore summary panel), the chart has no initial store and instead gets one via 'setStore'. Here, the event of the old (non-existent) store was never fired, so animations were never activated and the zoom interaction was buggy. Fix this by overriding `setStore` to install an event handler for the new store that enables the animations. If this runs more than once, it would just set the animation value to the same again, which is fine. Signed-off-by: Dominik Csapak --- src/panel/RRDChart.js | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/panel/RRDChart.js b/src/panel/RRDChart.js index 82615ce..b352202 100644 --- a/src/panel/RRDChart.js +++ b/src/panel/RRDChart.js @@ -160,6 +160,29 @@ Ext.define('Proxmox.widget.RRDChart', { }, }, + // enable animation after the store is loaded + delayAnimationStart() { + let me = this; + me.store.onAfter( + 'load', + function () { + me.setAnimation({ + duration: 200, + easing: 'easeIn', + }); + }, + this, + { single: true }, + ); + }, + + setStore: function (store) { + let me = this; + let res = Ext.chart.CartesianChart.prototype.setStore.call(me, store); + me.delayAnimationStart(); + return res; + }, + width: 770, height: 300, animation: false, @@ -340,18 +363,7 @@ Ext.define('Proxmox.widget.RRDChart', { ); }); - // enable animation after the store is loaded - me.store.onAfter( - 'load', - function () { - me.setAnimation({ - duration: 200, - easing: 'easeIn', - }); - }, - this, - { single: true }, - ); + me.delayAnimationStart(); me.checkThemeColors(); -- 2.47.3