From 8729fe7038c6be1e75ce3cfa0b22f2421090ba14 Mon Sep 17 00:00:00 2001 From: Andreas Wrede Date: Thu, 21 May 2026 13:01:47 -0400 Subject: [PATCH] feat: sort hosts, thresholds, and channels alphabetically on settings page Co-Authored-By: Claude Sonnet 4.6 --- hbd/server/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbd/server/settings.py b/hbd/server/settings.py index 4ebc51f..50ae402 100644 --- a/hbd/server/settings.py +++ b/hbd/server/settings.py @@ -197,7 +197,7 @@ def get_settings_sections(config: dict, threshold_checker=None) -> list: # ---- Notification channels (complex, built separately) ---------------- _METADATA_KEYS = {"type", "owner", "private", "min_level"} notif_channels = [] - for ch_name, ch_cfg in (config.get("notification_channels") or {}).items(): + for ch_name, ch_cfg in sorted((config.get("notification_channels") or {}).items()): if not isinstance(ch_cfg, dict): continue ch_type = ch_cfg.get("type", "") @@ -276,7 +276,7 @@ def get_settings_sections(config: dict, threshold_checker=None) -> list: # ---- Hosts summary ---------------------------------------------------- hosts_list = [] - for hname, hcfg in (config.get("hosts") or {}).items(): + for hname, hcfg in sorted((config.get("hosts") or {}).items()): if not isinstance(hcfg, dict): continue hosts_list.append({