server: order library root as crabidy first, orphans last, rest alphabetical
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2e94760a69
commit
6f3b60254e
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue