From 6f3b60254e363016444e39d83f0ea9aa0b8e7021 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 24 Jul 2026 16:46:58 +0200 Subject: [PATCH] server: order library root as crabidy first, orphans last, rest alphabetical Co-Authored-By: Claude Opus 4.8 (1M context) --- crabidy-server/src/provider.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crabidy-server/src/provider.rs b/crabidy-server/src/provider.rs index 11acda3..46139c6 100644 --- a/crabidy-server/src/provider.rs +++ b/crabidy-server/src/provider.rs @@ -789,6 +789,18 @@ impl ProviderClient for ProviderOrchestrator { ); root_node.children.push(child); } + // Ordering: `crabidy` always first, `orphans` always last, everything + // else alphabetically by name. + root_node.children.sort_by(|a, b| { + fn rank(name: &str) -> (u8, &str) { + match name { + "crabidy" => (0, name), + "orphans" => (2, name), + _ => (1, name), + } + } + rank(&a.title).cmp(&rank(&b.title)) + }); root_node }