Skip to content

feat: add activity ring chart with 24-segment SVG arc visualization #475

Open
devendra-w wants to merge 9 commits into
Priyanshu-byte-coder:mainfrom
devendra-w:feat/activity-ring-chart
Open

feat: add activity ring chart with 24-segment SVG arc visualization #475
devendra-w wants to merge 9 commits into
Priyanshu-byte-coder:mainfrom
devendra-w:feat/activity-ring-chart

Conversation

@devendra-w
Copy link
Copy Markdown
Contributor

Summary

Adds a circular 24-segment activity ring chart that visualizes commit frequency by hour of day, replacing the previous 4-block radar chart approach.

Closes #228

Type of Change

  • New feature

Changes Made

  • Added src/app/api/metrics/contributions/hourly/route.ts — new endpoint that fetches commits and groups them by local hour (0–23)
  • Rewrote src/components/ActivityRingChart.tsx — custom SVG arc chart with 24 segments, hover tooltips, peak hour highlight, and mount animation that respects prefers-reduced-motion

How to Test

  1. Sign in and navigate to /dashboard
  2. Scroll to the Activity Ring section
  3. Verify 24 segments render in a clock-like layout with labels at 12am, 6am, 12pm, 6pm
  4. Hover over any segment — center should update to show that hour and commit count
  5. The most active hour segment should be highlighted
  6. Switch between Last 7d / 30d / 90d — chart should update accordingly

Screenshots (if UI change)

image

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

@devendra-w
Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder PR is ready for the check and can be cleanly merged. Please do add a difficulty label to this issue. Thankyou!

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 — four fixes before merge:

  1. Missing EOF newlines on three new files:

    • src/app/api/metrics/contributions/daily/route.ts
    • src/app/api/metrics/contributions/hourly/route.ts
    • src/components/ActivityRingChart.tsx
  2. Hardcoded colorActivityRingChart.tsx error state uses text-red-400. Replace with text-[var(--destructive)].

  3. withMetricsCache not used on new API routes — all other metric routes cache responses. Add caching to /hourly and /daily consistent with the rest of the codebase.

  4. Server timezonedate.getHours() on the server gives UTC hours, not user's local hours. Worth a code comment so future contributors don't assume it's timezone-aware.

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

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

  • Added EOF newlines to all three new files
  • Replaced text-red-400 with text-[var(--destructive)]
  • Added withMetricsCache caching to both /hourly and /daily routes
  • Added timezone comment to clarify date.getHours() returns UTC on the server

Regarding the E2E / Playwright smoke tests failure it appears to be a JWT_SESSION_ERROR decryption issue in the CI environment and is unrelated to this PR's changes. All 7 other checks are passing including Build, Lint, Type check, and Dependency audit.
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.

Missing EOF newline — one of the files in this PR ends without a trailing newline (diff shows '\ No newline at end of file'). Please add a newline to the end of 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 streak freeze management page in dashboard settings

2 participants