Skip to content

Fix Engaging sort to rank by reaction count - #56

Open
soyalejolopez wants to merge 1 commit into
masterfrom
soyalejolopez-fluffy-carnival
Open

Fix Engaging sort to rank by reaction count#56
soyalejolopez wants to merge 1 commit into
masterfrom
soyalejolopez-fluffy-carnival

Conversation

@soyalejolopez

Copy link
Copy Markdown
Owner

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:

  1. Rate-based sort buried high-traffic resources. "Engaging" used a smoothed upvotes-per-view rate (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.
  2. Only 👍 counted. build-stats.js counted only THUMBS_UP reactions as upvotes, so any other reaction (❤️ 🚀 🎉 👀 …) 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.jsmapDiscussions now sums reactors across all reaction groups, not just THUMBS_UP. The upvotes field name is unchanged (now represents total reactions), so nothing downstream changes.

Notes

resource-stats.json still needs a fresh traffic-stats workflow run to pick up the new reaction totals; after that, reacted resources will sort to the top of Engaging.

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

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
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants