From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 6BE381FF0A7 for ; Tue, 18 Aug 2026 11:36:55 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 78DC321599; Tue, 18 Aug 2026 11:36:53 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 18 Aug 2026 11:36:49 +0200 Message-Id: Subject: Re: [PATCH manager 1/2] fix #7136: ui: tree: harmonize folder view resource ordering From: "Elias Huhsovitz" To: "Dominik Csapak" , X-Mailer: aerc 0.20.0 References: <20260818083110.15786-1-e.huhsovitz@proxmox.com> <20260818083110.15786-2-e.huhsovitz@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787045787949 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.754 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: CF6POGIF5327D2BPV2ZH6O3QVN5QF3AK X-Message-ID-Hash: CF6POGIF5327D2BPV2ZH6O3QVN5QF3AK 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 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Thanks for the quick reply! Sorry, i didnt notice the bugs, i am always a bit blind when it comes to this stuff. I guess in that case i will opt for simply checking=20 type =3D=3D=3D 'type' It felt like a band-aid fix, so i wanted to avoid it, but considering the intricacies of the frontend code base i belive you are correct. I will prepare the patch! On Tue Aug 18, 2026 at 11:15 AM CEST, Dominik Csapak wrote: > 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=20 > 'Resource-Pools') > > to fix the bug, wouldn't it be easier to use the 'groupbyid' field > in case the type =3D=3D=3D '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. >>=20 >> This causes Resources in the Folder View to be ordered >> lexicographically, whereas the Server View correctly relies on the >> `getTypeOrder` function. >>=20 >> 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. >>=20 >> Simplify the text resolution logic in `addChildSorted`. >>=20 >> Propagate `iconCls` from `typeDefaults` to ensure grouping nodes >> display the correct icons. >>=20 >> Signed-off-by: Elias Huhsovitz >> --- >> www/manager6/tree/ResourceTree.js | 16 +++++++++++----- >> 1 file changed, 11 insertions(+), 5 deletions(-) >>=20 >> diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/Resou= rceTree.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 =3D me.viewFilter.groupRenderer(info); >> - } else if (info.type =3D=3D=3D 'type') { >> + } else { >> let defaults =3D PVE.tree.ResourceTree.typeDefaults[in= fo.groupbyid]; >> if (defaults && defaults.text) { >> info.text =3D defaults.text; >> + } else { >> + info.text =3D info.groupbyid; >> } >> - } else { >> - info.text =3D info.groupbyid; >> } >> } >> let child =3D Ext.create('PVETree', info); >> @@ -267,11 +267,17 @@ Ext.define('PVE.tree.ResourceTree', { >> if (info.type =3D=3D=3D groupBy) { >> groupinfo =3D info; >> } else { >> + const type =3D groupBy =3D=3D=3D 'type' ? v : group= By; >> groupinfo =3D { >> - type: groupBy, >> + type: type, >> id: groupBy + '/' + v, >> }; >> - if (groupBy !=3D=3D 'type') { >> + if (groupBy =3D=3D=3D 'type') { >> + let defaults =3D PVE.tree.ResourceTree.typeDefa= ults[v]; >> + if (defaults && defaults.iconCls) { >> + groupinfo.iconCls =3D defaults.iconCls; >> + } >> + } else { >> groupinfo[groupBy] =3D v; >> } >> }