mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 09:01:19 +00:00
fix: correct misleading sort order comments
Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -338,7 +338,7 @@ export class FeedEngine<TItems extends FeedItem = FeedItem> {
|
||||
}
|
||||
}
|
||||
|
||||
// Apply boost reordering: positive-boost first (desc), then zero, then negative (asc).
|
||||
// Apply boost reordering: positive-boost first (desc), then zero, then negative (desc).
|
||||
// Stable sort within each tier preserves original relative order.
|
||||
if (boostScores.size > 0) {
|
||||
currentItems = applyBoostOrder(currentItems, boostScores)
|
||||
@@ -524,7 +524,7 @@ function applyBoostOrder<T extends FeedItem>(items: T[], boostScores: Map<string
|
||||
}
|
||||
}
|
||||
|
||||
// Sort positive descending by boost, negative ascending (most negative last)
|
||||
// Sort positive descending by boost, negative descending (least negative first, most negative last)
|
||||
positive.sort((a, b) => {
|
||||
const aScore = clamp(boostScores.get(a.id) ?? 0, -1, 1)
|
||||
const bScore = clamp(boostScores.get(b.id) ?? 0, -1, 1)
|
||||
|
||||
Reference in New Issue
Block a user