From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 36EF71FF0E4 for ; Tue, 11 Aug 2026 10:57:27 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id A458D2147A; Tue, 11 Aug 2026 10:57:26 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Subject: [PATCH widget-toolkit v2] fix #7721: fix zoom interaction on charts with no initial store Date: Tue, 11 Aug 2026 10:55:03 +0200 Message-ID: <20260811085723.1272853-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 1.030 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: DIFHR3JKD27EM3H7H4FLN7ACBRCYPCEN X-Message-ID-Hash: DIFHR3JKD27EM3H7H4FLN7ACBRCYPCEN 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. Also guard the delay method against calls from `setStore(null)` which can happen when a component is being destroyed. Signed-off-by: Dominik Csapak --- changes from v1: * rebase on master * guard against empty store when the component is destroyed thanks @Christian for catching this. As for the error message there: When the destroy fails, the navigation aborts and does not clean up some left over components, leading to some lingering events on half destroyed components... src/panel/RRDChart.js | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/src/panel/RRDChart.js b/src/panel/RRDChart.js index 82615ce..7480cbc 100644 --- a/src/panel/RRDChart.js +++ b/src/panel/RRDChart.js @@ -160,6 +160,32 @@ Ext.define('Proxmox.widget.RRDChart', { }, }, + // enable animation after the store is loaded + delayAnimationStart() { + let me = this; + if (!me.store) { + return; + } + 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 +366,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