Fix Engaging sort to rank by reaction count#496
Merged
soyalejolopez merged 1 commit intoJul 22, 2026
Conversation
The Engaging sort used a smoothed upvotes-per-view rate, which buried high-traffic resources so a resource with many views and a single reaction never surfaced. Rank by raw reaction/upvote count (views as tiebreaker, then name) so reactions drive the sort as expected. Also count all GitHub Discussion reaction types (not just THUMBS_UP) when computing upvotes in build-stats.js, so any reaction registers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ee4765a-3082-46e1-8848-c29193ffd00f
Contributor
🛰️ PR Sweeper reportRisk: 🟢 LOW · Security gate: ✅ passing · Files: 2 🔒 Automated guardrails (authoritative)
🤖 Dual-model AI review (advisory)Deep-reasoning reviewer —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Sorting the catalog by Engaging never surfaced highly-reacted resources. PowerClaw — the only resource with a reaction — stayed near the bottom instead of the top.
Two root causes:
(upvotes + 2) / (views + 40). With 1,632 views, a single reaction produces a microscopic rate, so PowerClaw sank below low-traffic resources that had zero reactions.build-stats.jscounted onlyTHUMBS_UPreactions as upvotes, so any other reaction (heart, rocket, tada, eyes ...) was ignored entirely.Changes
index.html— "Engaging" now ranks by raw reaction/upvote count descending, with views as a tiebreaker, then name.tools/catalog-build/build-stats.js—mapDiscussionsnow sums reactors across all reaction groups, not justTHUMBS_UP. Theupvotesfield name is unchanged (now represents total reactions), so nothing downstream changes.Notes
resource-stats.jsonstill needs a freshtraffic-statsworkflow run to pick up the new reaction totals; after that, reacted resources will sort to the top of Engaging.