[pdm-devel] [PATCH datacenter-manager 4/5] ui: pve: tree: use correct key for the root node

Dominik Csapak d.csapak at proxmox.com
Wed Sep 10 13:52:53 CEST 2025


the default/empty path is '_' so use that to select the root node

not really relevant at the moment since the root node is not visible,
but this makes it work when we change that.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 ui/src/pve/tree.rs | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/ui/src/pve/tree.rs b/ui/src/pve/tree.rs
index f38e0da..c669bab 100644
--- a/ui/src/pve/tree.rs
+++ b/ui/src/pve/tree.rs
@@ -386,11 +386,15 @@ impl LoadableComponent for PveTreeComp {
                 }
             }
             Msg::RouteChanged(path) => {
-                let key = Key::from(format!(
-                    "remote/{}/{}",
-                    ctx.props().remote,
-                    path.replace("+", "/")
-                ));
+                let key = if path == "_" {
+                    Key::from("__root__")
+                } else {
+                    Key::from(format!(
+                        "remote/{}/{}",
+                        ctx.props().remote,
+                        path.replace("+", "/")
+                    ))
+                };
                 self.view_selection.select(key);
             }
             Msg::Filter(text) => {
-- 
2.47.3





More information about the pdm-devel mailing list