feat(dashboard): add interactive Repository Health Explorer (#398)#2069
feat(dashboard): add interactive Repository Health Explorer (#398)#2069Ridanshi wants to merge 1 commit into
Conversation
|
@Ridanshi is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
|
This PR has conflicts with main. Please rebase: Then push and we'll review. |
|
This PR has merge conflicts with git fetch origin
git rebase origin/main |
…u-byte-coder#398) Implements a dedicated /dashboard/repo-health page that exposes the existing health scoring system with interactive visualisations: • SVG semi-circle gauge for the 0-100 composite score • Recharts radar chart with 5 normalised axes (commits, PR rate, PR speed, issues, recent activity) – lazy-loaded via next/dynamic • Weighted score breakdown table (earned/max per dimension + progress bars) • Rule-based recommendations engine (generateInsights) — all thresholds are data-driven from the existing scoring functions; no repo-specific hard-coding • Letter grade system (A+ → D) with colour-coded grade cards • Repo selection panel with sorted RepoHealthCard list • "Full Analysis →" shortcut added to the existing RepoHealthPanel modal • Entry-point banner added to the Analytics & Repositories dashboard section • 76 unit tests (regression coverage for all scoring functions + new helpers) New files src/lib/repo-health-insights.ts — gradeLetter, gradeLabel, buildRadarData, buildBreakdown, generateInsights src/components/repo-health/RepoHealthGauge.tsx src/components/repo-health/RepoHealthRadar.tsx src/components/repo-health/RepoHealthBreakdown.tsx src/components/repo-health/RepoHealthInsights.tsx src/components/repo-health/RepoHealthCard.tsx src/components/repo-health/RepoHealthExplorer.tsx src/app/dashboard/repo-health/page.tsx test/repo-health-explorer.test.ts Modified files src/components/RepoHealthPanel.tsx — "Full Analysis →" link src/app/dashboard/page.tsx — health explorer entry banner
50abce7 to
35ad0a6
Compare
|
Hi, I've pushed the requested fixes, resolved conflicts, and all completed checks are passing. The Playwright smoke test is still in progress. Could someone please review when convenient? Thanks! |
Summary
/dashboard/repo-healthpage that surfaces the existing health scoring system (src/lib/repo-health.ts) through interactive visualisationsscoreCommitFrequency,scorePrMergeRate, etc.) are reused directly/dashboard/career-intelligence(thin server page + rich client component)Architecture
New lib (
src/lib/repo-health-insights.ts)Pure functions consumed by both the UI and the test suite:
gradeLetter(score)— A+ → D letter gradesgradeLabel(grade)— human-readable tier names (Healthy / Needs Attention / At Risk)buildRadarData(signals)— normalises each sub-score to 0-100 for the radar chartbuildBreakdown(signals)— per-dimension earned/max breakdown rowsgenerateInsights(signals)— rule-based recommendations engine (5 signal × multi-threshold rules)New components (
src/components/repo-health/)RepoHealthGauge.tsxRepoHealthRadar.tsxRadarChart— 5 normalised axesRepoHealthBreakdown.tsxRepoHealthInsights.tsxRepoHealthCard.tsxRepoHealthExplorer.tsxNew page
src/app/dashboard/repo-health/page.tsx— auth-guarded server componentExisting files modified
src/components/RepoHealthPanel.tsx— added "Full Analysis →" shortcut link to the explorersrc/app/dashboard/page.tsx— added health explorer entry banner in Analytics & Repositories sectionVisualisations
role="img"labelRadarChart/Radar, lazy-loaded vianext/dynamicPerformance
next/dynamic,ssr: false) so the charting bundle is only downloaded when the explorer page is visitedlocalStorageto avoid redundant fetches on re-visits/api/metrics/repo-healthendpoint — caching behaviour unchangedbuildRadarData,buildBreakdown,generateInsights) wrapped inuseMemoRepoHealthCardandDetailPanelwrapped inReact.memoAccessibility
role="img"andaria-labelrole="progressbar"witharia-valuenow/min/maxaria-pressedfor selection state and descriptivearia-label<aside>for the repo list,<main>for the detail panel,<section>for each content block<label>(viasr-only) andaria-labelaria-labelTest results
Regression tests verify all 5 existing scoring functions remain unchanged. New tests cover
gradeLetter,gradeLabel,buildRadarData,buildBreakdown, andgenerateInsightsat all significant thresholds.