Function group_by_kind
pub fn group_by_kind<T>(
ranked: Vec<T>,
kind: impl Fn(&T) -> &ResourceKind,
row_budget: usize,
) -> Vec<KindGroup<T>>Expand description
Ranked hits arranged into contiguous per-kind groups and trimmed to a
row_budget shared round-robin: a palette paints ~10 rows, and an
outscoring kind (forty file hits) can otherwise push a correctly-ranked
app off the bottom. A lone group is exempt — narrowing to one kind means
“show me all of these”. A zero budget keeps everything.