Skip to content

feat(repo-health): add clickable health score breakdown panel#306

Open
mallya-m wants to merge 6 commits into
Priyanshu-byte-coder:mainfrom
mallya-m:feat/repo-health-breakdown-256
Open

feat(repo-health): add clickable health score breakdown panel#306
mallya-m wants to merge 6 commits into
Priyanshu-byte-coder:mainfrom
mallya-m:feat/repo-health-breakdown-256

Conversation

@mallya-m
Copy link
Copy Markdown
Contributor

What does this PR do?

Makes the repo health score badge in TopRepos clickable. Clicking opens a panel showing a per-dimension breakdown of the score with actionable improvement tips.

Related issue

Closes #256

Changes made

  • Created RepoHealthPanel.tsx component with 5 dimension breakdown
  • Dimensions: Commit Activity, PR Merge Rate, PR Turnaround, Issue Load, Recent Activity
  • Each dimension shows score out of 20, a progress bar, and a tip if score is low
  • Made health badge in TopRepos.tsx a clickable button that opens the panel
  • Panel closes on backdrop click or ✕ button
  • Uses existing signals data from /api/metrics/repo-health — no new API calls

How to test

  1. Sign in and go to the dashboard
  2. Find the Top Repositories widget
  3. Click any colored score badge (green/yellow/red number)
  4. Panel opens showing breakdown for that repo
  5. Click outside or ✕ to close

Screenshots

Screenshot 2026-05-18 030814

@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

@mallya-m 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.

@mallya-m
Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder
Could you please add the gssoc:approved and type:feature labels?
Thank you!

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

The health panel feature looks great — clean component, proper CSS vars, good a11y. However PR #303 (sortable columns) just merged and it touched the same area of TopRepos.tsx, so this PR now has a conflict.

Please rebase onto main:

git fetch upstream
git rebase upstream/main

When resolving conflicts in TopRepos.tsx: the sort state/logic is already in main from #303, so keep that and layer your activeHealthRepo state and the badge→button change on top. The RepoHealthPanel.tsx file has no conflict.

Once rebased and pushed, I'll merge.

@mallya-m mallya-m force-pushed the feat/repo-health-breakdown-256 branch from 7826005 to 00c8d13 Compare May 19, 2026 14:57
@mallya-m
Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder conflict resolved and rebased onto main — ready for merge!

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

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

Good feature. Two accessibility issues:

1. Dialog missing aria-labelledby
role="dialog" aria-modal="true" without aria-labelledby — screen readers won't know the dialog's title. Add an id to the <h2> and reference it:

<div role="dialog" aria-modal="true" aria-labelledby="health-panel-title">
  ...
  <h2 id="health-panel-title" ...>Health Breakdown</h2>

2. No Escape key to close
Modal panels should close on Escape. Add to RepoHealthPanel:

useEffect(() => {
  const handler = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); };
  document.addEventListener('keydown', handler);
  return () => document.removeEventListener('keydown', handler);
}, [onClose]);

Everything else is solid — proper aria-hidden on overlay, aria-label on close button, CSS vars for layout colors, and the score-bar semantic colors (green/yellow/red) are appropriate for health indicators.

@mallya-m mallya-m force-pushed the feat/repo-health-breakdown-256 branch from 29c9992 to e4b1992 Compare May 19, 2026 16:53
@mallya-m
Copy link
Copy Markdown
Contributor Author

Hi @Priyanshu-byte-coder

Resolved the merge conflict and synced package-lock.json with the latest dependencies after rebasing onto main.

Also addressed the requested accessibility updates:

  • Added aria-labelledby
  • Added Escape key handling for modal close
  • Fixed React hook ordering issue

All checks are passing locally now.
Ready to Merge !

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

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

  1. Hardcoded colors — bg-green-500, bg-yellow-500, bg-red-500 in ScoreBar and text-green-400, text-yellow-400, text-red-400 in grade badge. Use CSS vars (var(--success), var(--destructive), or var(--accent)). 2. supabase/.temp/cli-latest committed — local Supabase temp file must not be in the repo. Add supabase/.temp/ to .gitignore and remove from branch. 3. .gitignore shows as binary diff — investigate encoding corruption. 4. Missing EOF newlines on RepoHealthPanel.tsx and TopRepos.tsx. 5. No-health-data fallback removed — repos with no health score now show nothing. Restore the -- fallback badge. 6. package-lock.json churn — unrelated npm version artifacts. Revert.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature labels May 20, 2026
@mallya-m
Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder all 6 issues addressed:

  1. Replaced hardcoded bg-green/yellow/red with CSS vars
  2. Restored -- fallback badge for repos with no health data
  3. Added supabase/.temp/ to .gitignore and removed from tracking
  4. Reverted package-lock.json churn
  5. Added EOF newlines to RepoHealthPanel.tsx and TopRepos.tsx
  6. Verified .gitignore encoding

Ready for merge!

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

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

Issues found in this PR:

  • Missing EOF newline — add a trailing newline to all modified files.

  • Raw Tailwind color classes — replace text-red-* / bg-red-* with text-[var(--destructive)] / appropriate CSS var equivalents. All colors must use CSS variables for theme support.

@mallya-m mallya-m force-pushed the feat/repo-health-breakdown-256 branch from 16a258b to 6bcb5a8 Compare May 21, 2026 19:39
@mallya-m
Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder addressed both issues:

  1. Replaced all raw Tailwind color classes with CSS vars — var(--accent), var(--destructive), var(--warning,#ca8a04)
  2. Fixed EOF newlines — single trailing newline on all modified files
  3. Rebased onto latest main

Ready for merge!

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

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

Two issues:

  1. Missing EOF newline
  2. Hardcoded fallback hex in CSS varsvar(--warning, #ca8a04) — remove the fallback. The var should be defined in globals.css. Since --warning is now defined in main (via merged PRs), just use var(--warning).

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

Labels

gssoc26 GSSoC 2026 contribution level:intermediate GSSoC: Intermediate difficulty (35 pts) type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add repository health score breakdown widget with actionable tips

2 participants