From cf70ff054f75f0bb22211ed374f7461fa7f065da Mon Sep 17 00:00:00 2001 From: Rushabh Patil Date: Sun, 24 May 2026 19:43:47 +0530 Subject: [PATCH 1/2] Fix contributor graph score milestone thresholds to match backend scoring --- frontend/src/components/ContributorGraph.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/ContributorGraph.tsx b/frontend/src/components/ContributorGraph.tsx index 3af10d72..c7a24770 100644 --- a/frontend/src/components/ContributorGraph.tsx +++ b/frontend/src/components/ContributorGraph.tsx @@ -26,12 +26,12 @@ const DROPDOWN_MENU_ITEMS = [ ] const SCORE_LABEL_ENTRIES: [number, string][] = [ - [3, "⭐"], - [10, "⭐⭐"], - [30, "⭐⭐⭐"], - [50, "👑"], - [75, "👑👑"], - [100, "👑👑👑"], + [4, "⭐"], + [11, "⭐⭐"], + [50, "⭐⭐⭐"], + [82, "👑"], + [122, "👑👑"], + [162, "👑👑👑"], ] const DOT_CONFIG = { r: 3 } From 5022724435595bb99822fda21d0842fe2d777c85 Mon Sep 17 00:00:00 2001 From: Rushabh Patil Date: Sun, 24 May 2026 19:58:40 +0530 Subject: [PATCH 2/2] Refactor SCORE_LABEL_ENTRIES to use SCORE_TO_STAR_THRESHOLDS for dynamic scoring --- frontend/src/components/ContributorGraph.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/ContributorGraph.tsx b/frontend/src/components/ContributorGraph.tsx index c7a24770..d13184ee 100644 --- a/frontend/src/components/ContributorGraph.tsx +++ b/frontend/src/components/ContributorGraph.tsx @@ -10,6 +10,7 @@ import { ReferenceLine, Label, } from "recharts" +import { SCORE_TO_STAR_THRESHOLDS } from "lib/scoring/scoreToStars" const DROPDOWN_MENU_ITEMS = [ { key: "prsMerged", label: "Pull Requests Merged" }, @@ -25,14 +26,9 @@ const DROPDOWN_MENU_ITEMS = [ { key: "bountiedIssuesTotal", label: "Bountied Issues (Total)" }, ] -const SCORE_LABEL_ENTRIES: [number, string][] = [ - [4, "⭐"], - [11, "⭐⭐"], - [50, "⭐⭐⭐"], - [82, "👑"], - [122, "👑👑"], - [162, "👑👑👑"], -] +const SCORE_LABEL_ENTRIES = SCORE_TO_STAR_THRESHOLDS.filter( + ({ minScore, starString }) => minScore > 0 && starString !== "", +).map(({ minScore, starString }) => [minScore, starString] as const) const DOT_CONFIG = { r: 3 } const CHART_CONTAINER_STYLE = { width: "100%", height: 400 }