all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Elias Huhsovitz <e.huhsovitz@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Elias Huhsovitz <e.huhsovitz@proxmox.com>
Subject: [PATCH manager v2] fix #7136: ui: tree: harmonize folder view resource ordering
Date: Tue, 18 Aug 2026 13:52:37 +0200	[thread overview]
Message-ID: <20260818115237.91447-1-e.huhsovitz@proxmox.com> (raw)

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 <e.huhsovitz@proxmox.com>
---
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





             reply	other threads:[~2026-08-18 11:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 11:52 Elias Huhsovitz [this message]
2026-08-18 13:45 ` applied: [PATCH manager v2] fix #7136: ui: tree: harmonize folder view resource ordering Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260818115237.91447-1-e.huhsovitz@proxmox.com \
    --to=e.huhsovitz@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal