From bec736a894eb9b6d29396f7f509592f71aa395f1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Jan 2026 12:01:11 +0000 Subject: [PATCH] Sort node dropdown alphabetically in admin interface Nodes in the dropdown are now sorted alphabetically by name, with unnamed nodes appearing at the end. --- src/meshcore_hub/web/routes/admin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/meshcore_hub/web/routes/admin.py b/src/meshcore_hub/web/routes/admin.py index 9ff5619..cb34146 100644 --- a/src/meshcore_hub/web/routes/admin.py +++ b/src/meshcore_hub/web/routes/admin.py @@ -97,6 +97,10 @@ async def admin_node_tags( if response.status_code == 200: data = response.json() nodes = data.get("items", []) + # Sort nodes alphabetically by name (unnamed nodes at the end) + nodes.sort( + key=lambda n: (n.get("name") is None, (n.get("name") or "").lower()) + ) except Exception as e: logger.exception("Failed to fetch nodes: %s", e) context["error"] = "Failed to fetch nodes"