feat: goal completion history & analytics - trend chart with avg completion rate #2121#2126
Conversation
|
@IshitaSingh0822 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 now has a merge conflict with Please rebase your branch on git fetch origin
git rebase origin/mainOnce CI passes, we can merge this. |
…oder#2121) - Add GET /api/goals/history?weeks=8 route - Add GoalHistory.tsx with collapsible Recharts LineChart - Show weekly completion % per goal over last 8 weeks - Show average completion stat for last 4 weeks - Integrate GoalHistory into GoalTracker.tsx
d748ec4 to
f5b6bd4
Compare
0eb1c7f
into
Priyanshu-byte-coder:main
|
🎉 Merged! Thanks for contributing to DevTrack. If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers. Keep an eye on open issues for your next contribution! |
…tics feat: goal completion history & analytics - trend chart with avg completion rate #2121
Summary
Added goal history tracking and analytics to DevTrack. Users can now view weekly completion trends per goal via a collapsible line chart powered by Recharts. Includes a new Supabase table, API route, and
GoalHistorycomponent.Closes #2121
Type of Change
Changes Made
GoalHistory.tsx— collapsible section with a Recharts<LineChart>showing weekly completion % per goal (color-coded lines, one per goal)GET /api/goals/history?weeks=8route — returns last N weeks of completion data per goal with goal metadata for labelingsupabase/migrations/20250607_goal_history.sql— createsgoal_historytable with user/goal foreign keys and index on(user_id, period_end desc)GoalTracker.tsxto render<GoalHistory />at the bottom of the goals cardHow to Test
goal_historyrow is insertedScreenshots (if UI change)
N/A — chart renders only when
goal_historyrows exist; empty state shown otherwise.Checklist
npm run lintpasses locallynpm run type-check)Accessibility Checklist
aria-expandedon toggle button,aria-hiddenon decorative SVGs)Additional Notes
connectNullson Recharts<Line>— no crash on sparse datagoal_history(notgoal_completionsas in the issue spec) — consistent with the API route query