Skip to content

Fix Engaging sort to rank by reaction count#496

Merged
soyalejolopez merged 1 commit into
microsoft:masterfrom
soyalejolopez:soyalejolopez-fluffy-carnival
Jul 22, 2026
Merged

Fix Engaging sort to rank by reaction count#496
soyalejolopez merged 1 commit into
microsoft:masterfrom
soyalejolopez:soyalejolopez-fluffy-carnival

Conversation

@soyalejolopez

Copy link
Copy Markdown
Member

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 THUMBS_UP counted. build-stats.js counted only THUMBS_UP reactions 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.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.

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
@soyalejolopez
soyalejolopez merged commit 77c923f into microsoft:master Jul 22, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🛰️ PR Sweeper report

Risk: 🟢 LOW · Security gate: ✅ passing · Files: 2

🔒 Automated guardrails (authoritative)

Category Location Finding
ℹ️ scope Change(s) outside known content roots: index.html.

🤖 Dual-model AI review (advisory)

Deep-reasoning revieweropenai/o3 · verdict: comment · risk: low

No security, privacy, or licensing issues detected. Changes adjust sorting heuristics and broaden reaction counting logic. Implementation is straightforward and unobfuscated. Only minor quality concerns: editing generated HTML and potential behaviour change in reaction counting.

Quality notes:

  • index.html — Directly editing the built HTML bundle can make future maintenance harder and diverge from source-of-truth templates or scripts. Consider applying this sorting-logic change in the source JS/TS file and regenerate the bundle.
  • tools/catalog-build/build-stats.js — New logic now sums all reaction groups, not only THUMBS_UP. Confirm this is intentional; it will count all emoji reactions equally (e.g., laugh, hooray) and may inflate 'upvotes'.

✅ Suggested next steps

  • Verify that the repository’s build workflow regenerates index.html from a source file; if so, move the change to the appropriate source to avoid manual bundle edits.
  • Confirm that including all reaction types (not just THUMBS_UP) in upvote counts is the desired behaviour; otherwise, refine the filter.
  • Add/update unit tests (if available) to cover the new engaging-sort criteria and the revised reaction-count aggregation.

The automated guardrails are authoritative and gate the security status. The AI review is advisory and never auto-merges. Thanks for contributing to FastTrack! 🛩️

@github-actions github-actions Bot added sweeper:ai-reviewed PR Sweeper: dual-model AI review attached sweeper:risk-low PR Sweeper: low risk sweeper:scope-review PR Sweeper: scope/sensitive-path review labels Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sweeper:ai-reviewed PR Sweeper: dual-model AI review attached sweeper:risk-low PR Sweeper: low risk sweeper:scope-review PR Sweeper: scope/sensitive-path review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants