Fix GoalTracker progress overflow issue#330
Conversation
|
@Akankshya-35-45 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. |
There was a problem hiding this comment.
Thanks for your first PR on DevTrack! 🎉
A maintainer will review it within 48 hours. While you wait:
- Make sure CI is passing (type-check + lint)
- Double-check the PR description is filled out and the issue is linked
- Feel free to ask questions in Discussions if you need help
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Clamps the goal progress bar width to avoid overflowing past 100%.
Changes:
- Limit the computed progress percentage used for the bar width to a maximum of 100%.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <div | ||
| className={`h-full rounded-full transition-all ${completed ? "bg-emerald-500" : "bg-[var(--accent)]"}`} | ||
| style={{ width: `${pct}%` }} | ||
| style={{ width: `${Math.min(pct, 100)}%` }} |
|
Thanks for the suggestion! Updated the logic to clamp the progress value between 0 and 100 using |
|
Thanks for the fix! The progress bar overflow bug has already been fixed in PR #286 which was just merged. That PR also resolves this issue alongside the confetti feature. This PR is now conflicting with main. The core fix (Math.min cap) is correct — it was just merged via a different PR. Closing this as resolved. |
Summary
Fixes the GoalTracker progress bar overflow issue when the current value exceeds the target value.
Closes #243
Type of Change
Changes Made
Math.min()How to Test
Steps for the reviewer to verify this works:
npm run devScreenshots (if UI change)
N/A
Checklist
npm run lintpasses locallynpm run type-check)