Skip to content

feat: add contribution heatmap drill-down sheet on cell click (#227)#426

Open
devendra-w wants to merge 6 commits into
Priyanshu-byte-coder:mainfrom
devendra-w:feat/heatmap-drilldown
Open

feat: add contribution heatmap drill-down sheet on cell click (#227)#426
devendra-w wants to merge 6 commits into
Priyanshu-byte-coder:mainfrom
devendra-w:feat/heatmap-drilldown

Conversation

@devendra-w
Copy link
Copy Markdown
Contributor

Summary

Adds a slide-in panel when clicking a heatmap cell, showing the daily commit breakdown by repository. Panel is keyboard accessible and closes on Escape or backdrop click.
Closes #227

Type of Change

  • New feature

Changes Made

  • Added src/components/DailyBreakdownSheet.tsx — slide-in panel showing date, repo names, commit counts and links
  • Updated src/components/ContributionHeatmap.tsx — added selectedDate state and onClick handler on each cell
  • Panel closes on Escape key or backdrop click
  • Loading skeleton shown while fetching data

How to Test

  1. Sign in and navigate to /dashboard
  2. Click any heatmap cell
  3. Verify slide-in panel appears from the right showing the date
  4. Press Escape or click backdrop to close
  5. Verify future date cells are not clickable

Screenshots (if UI change)

N/A - requires auth to test

Checklist

  • Linked issue in summary
  • npm run lint passes locally
  • Self-reviewed the diff
  • Added/updated tests if applicable

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

@devendra-w 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.

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

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

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.

Feature is broken — API shape mismatch.

The component fetches /api/metrics/contributions?days=365 and reads result.repos?.[date]. The actual API response shape is { days, total, data: Record<string, number> } — a flat date→count map with no repos key. result.repos will always be undefined, so the sheet always shows "No commit data available for this day."

To fix: either add a new endpoint that returns per-repo breakdown for a specific date, or restructure the existing endpoint to include repo-level data.

Other issues:

  • Full 365-day dataset is re-fetched on every cell click — the heatmap already has this data, pass it down as a prop instead
  • Missing EOF newline on both DailyBreakdownSheet.tsx and ContributionHeatmap.tsx
  • onClose in useEffect dep array with an inline () => setSelectedDate(null) creates a new ref each render, causing the event listener to be removed/re-added constantly — wrap in useCallback or use a useRef

@Priyanshu-byte-coder Priyanshu-byte-coder added the level:intermediate GSSoC: Intermediate difficulty (35 pts) label May 20, 2026
@devendra-w
Copy link
Copy Markdown
Contributor Author

Hi @Priyanshu-byte-coder! I've addressed all the requested changes:

  • Fixed the API shape mismatch by creating a new /api/metrics/contributions/daily endpoint that returns per-repo breakdown for a specific date
  • Eliminated the redundant 365-day re-fetch on every cell click by passing heatmapData as a prop
  • Fixed the useEffect event listener being removed/re-added constantly using useRef
  • Added EOF newlines to both files

Ready for re-review!

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.

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 contribution heatmap drill-down — click a week cell to see daily breakdown

2 participants