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 9822E1FF0A7 for ; Tue, 18 Aug 2026 11:15:58 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BDCD52157F; Tue, 18 Aug 2026 11:15:55 +0200 (CEST) Message-ID: Date: Tue, 18 Aug 2026 11:15:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH manager 1/2] fix #7136: ui: tree: harmonize folder view resource ordering To: Elias Huhsovitz , pve-devel@lists.proxmox.com References: <20260818083110.15786-1-e.huhsovitz@proxmox.com> <20260818083110.15786-2-e.huhsovitz@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20260818083110.15786-2-e.huhsovitz@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787044530511 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.957 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: 7Z4PVQJGFPZZSKHNVH2AC6P22GRTPY5J X-Message-ID-Hash: 7Z4PVQJGFPZZSKHNVH2AC6P22GRTPY5J 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 VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: while the code here looks ok this produces an issue with all places where we use the type: * selecting a category now tries to load the wrong panel type (see Workspace.js:236) * right clicking on vm/container throws an exception * resource pool folder has the wrong text ('Root' instead of 'Resource-Pools') to fix the bug, wouldn't it be easier to use the 'groupbyid' field in case the type === 'type' ? then we don't have to touch that semantic at all also one line is not correctly formatted, running make tidy before submitting would be great :) On 8/18/26 10:31 AM, Elias Huhsovitz wrote: > Grouping nodes in the Folder view are assigned the literal type: 'type' > instead of their actual type. This causes `getTypeOrder` to return a > default value for all groups. > > This causes Resources in the Folder View to be ordered > lexicographically, whereas the Server View correctly relies on the > `getTypeOrder` function. > > Match the Server View ordering by setting the grouping node's `type` to > the actual resource type when grouping by `type`. This way > `getTypeOrder` receives the correct type for sorting. > > Simplify the text resolution logic in `addChildSorted`. > > Propagate `iconCls` from `typeDefaults` to ensure grouping nodes > display the correct icons. > > Signed-off-by: Elias Huhsovitz > --- > www/manager6/tree/ResourceTree.js | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js > index 6ea28919..a7723095 100644 > --- a/www/manager6/tree/ResourceTree.js > +++ b/www/manager6/tree/ResourceTree.js > @@ -232,13 +232,13 @@ Ext.define('PVE.tree.ResourceTree', { > if (info.groupbyid) { > if (me.viewFilter.groupRenderer) { > info.text = me.viewFilter.groupRenderer(info); > - } else if (info.type === 'type') { > + } else { > let defaults = PVE.tree.ResourceTree.typeDefaults[info.groupbyid]; > if (defaults && defaults.text) { > info.text = defaults.text; > + } else { > + info.text = info.groupbyid; > } > - } else { > - info.text = info.groupbyid; > } > } > let child = Ext.create('PVETree', info); > @@ -267,11 +267,17 @@ Ext.define('PVE.tree.ResourceTree', { > if (info.type === groupBy) { > groupinfo = info; > } else { > + const type = groupBy === 'type' ? v : groupBy; > groupinfo = { > - type: groupBy, > + type: type, > id: groupBy + '/' + v, > }; > - if (groupBy !== 'type') { > + if (groupBy === 'type') { > + let defaults = PVE.tree.ResourceTree.typeDefaults[v]; > + if (defaults && defaults.iconCls) { > + groupinfo.iconCls = defaults.iconCls; > + } > + } else { > groupinfo[groupBy] = v; > } > }