Skip to content

Fix contributor graph score milestone thresholds to match backend scoring#331

Merged
rushabhcodes merged 2 commits into
tscircuit:mainfrom
rushabhcodes:fix/contributor-graph-score-thresholds
May 24, 2026
Merged

Fix contributor graph score milestone thresholds to match backend scoring#331
rushabhcodes merged 2 commits into
tscircuit:mainfrom
rushabhcodes:fix/contributor-graph-score-thresholds

Conversation

@rushabhcodes
Copy link
Copy Markdown
Contributor

@rushabhcodes rushabhcodes commented May 24, 2026

Summary

Fixes a scoring consistency bug in the contributor graph by deriving score milestone markers from the shared backend scoring thresholds instead of maintaining a separate frontend
copy.

Changes

  • import SCORE_TO_STAR_THRESHOLDS from lib/scoring/scoreToStars
  • remove the duplicated SCORE_LABEL_ENTRIES threshold table from the frontend
  • derive graph reference-line labels directly from the shared scoring constants
  • keep contributor score markers automatically aligned with backend badge thresholds

Why

The contributor graph had a duplicated score-to-badge mapping that had already drifted from the backend scoring rules once. This change removes that source of inconsistency and
ensures future threshold updates stay in sync across the app.

Before

image

After

image

Refactoring for consistency and maintainability:

  • Replaced the hardcoded SCORE_LABEL_ENTRIES array with a derived array generated from the imported SCORE_TO_STAR_THRESHOLDS constant, filtering out entries with a minScore of 0 or an empty starString (frontend/src/components/ContributorGraph.tsx).
  • Imported SCORE_TO_STAR_THRESHOLDS from lib/scoring/scoreToStars to use as the source of truth for score-to-star mappings (frontend/src/components/ContributorGraph.tsx).

Copilot AI review requested due to automatic review settings May 24, 2026 14:16
@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

@rushabhcodes is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the frontend contributor score graph’s milestone reference lines so they match the backend score→badge threshold mapping, preventing UI/scoring discrepancies.

Changes:

  • Updated ContributorGraph score milestone thresholds to 4, 11, 50, 82, 122, 162.
  • Adjusted the displayed badge labels at each milestone to match the current backend mapping.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/components/ContributorGraph.tsx Outdated
@rushabhcodes rushabhcodes merged commit 15baf0b into tscircuit:main May 24, 2026
4 of 5 checks passed
@rushabhcodes rushabhcodes deleted the fix/contributor-graph-score-thresholds branch May 24, 2026 16:02
@tscircuitbot
Copy link
Copy Markdown


Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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.

4 participants