feat: goal completion history & analytics - trend chart with avg completion rate #2121#2126
Open
IshitaSingh0822 wants to merge 2 commits into
Open
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):
|
Owner
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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