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 0E0C81FF0A7 for ; Tue, 18 Aug 2026 13:52:48 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E6E8D214E0; Tue, 18 Aug 2026 13:52:46 +0200 (CEST) From: Elias Huhsovitz To: pve-devel@lists.proxmox.com Subject: [PATCH manager v2] fix #7136: ui: tree: harmonize folder view resource ordering Date: Tue, 18 Aug 2026 13:52:37 +0200 Message-ID: <20260818115237.91447-1-e.huhsovitz@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787053938201 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.750 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: KM7EIJWZCOCKR6K5H7YLSH6EBWT7443V X-Message-ID-Hash: KM7EIJWZCOCKR6K5H7YLSH6EBWT7443V X-MailFrom: e.huhsovitz@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 CC: Elias Huhsovitz X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Resources in the Folder View are ordered lexicographically, whereas the Server View uses the `getTypeOrder` function for ordering. This happens because grouping nodes in the Folder View have their `type` property set to the literal string 'type', causing `getTypeOrder` to return the same default value for all groups. Fix this by resolving the actual resource type from the `groupbyid` field in `nodeSortFn` when `type === 'type'`. This applies the defined sort order (LXC, QEMU, Node, SDN, Network, Storage). Signed-off-by: Elias Huhsovitz --- Changes v1->v2: --------------- * preserve the type: 'type' semantic marker used by other UI components * resolve the actual resource type from groupbyid in nodeSortFn when type === 'type' * do not refactor bug-irrelevant variables from `let` to `const` * run `make tidy` * update commit message (Thanks @Dominik for the review) v1: https://lore.proxmox.com/pve-devel/20260818083110.15786-1-e.huhsovitz@proxmox.com/ www/manager6/tree/ResourceTree.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js index 6ea28919..e2acc431 100644 --- a/www/manager6/tree/ResourceTree.js +++ b/www/manager6/tree/ResourceTree.js @@ -121,7 +121,9 @@ Ext.define('PVE.tree.ResourceTree', { let n2IsGuest = n2.type === 'qemu' || n2.type === 'lxc'; if (me['group-guest-types'] || !n1IsGuest || !n2IsGuest) { // first sort (group) by type - let res = me.getTypeOrder(n1.type) - me.getTypeOrder(n2.type); + const type1 = n1.type === 'type' ? n1.groupbyid : n1.type; + const type2 = n2.type === 'type' ? n2.groupbyid : n2.type; + const res = me.getTypeOrder(type1) - me.getTypeOrder(type2); if (res !== 0) { return res; } -- 2.47.3