handle errors on goal deletion and show user feedback#583
Conversation
|
@mrdeyroy 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):
|
|
Hi, @Priyanshu-byte-coder |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
PR #577 (mobile responsiveness fixes) was already merged into main. This PR includes the same responsive grid changes to CIAnalytics, FriendComparison, IssueMetrics, LanguageBreakdown, PRMetrics, and StreakTracker — causing conflicts.
Please rebase on main and remove the duplicate responsive grid changes. Keep only the GoalTracker deletion error handling, which is the new value this PR adds.
fe6e2b7 to
b4aa191
Compare
I have removed the duplicate responsive grid changes and only kept the GoalTracker deletion error handling part. Can you please check now! |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Hardcoded Tailwind red classes — replace with CSS vars:
border-red-500/20,bg-red-500/10,text-red-400,hover:text-red-300→border-[var(--destructive)]/20,bg-[var(--destructive)]/10,text-[var(--destructive)]
Summary
This PR fixes a bug where failing API requests during goal deletion were being silently swallowed. Previously, if the
DELETE /api/goals/{id}request failed (e.g., due to a network issue), the optimistic UI would revert the goal list but provide no error message to the user, causing confusion.This change introduces a
deleteErrorstate to catch the failure and display a dismissible error banner.Closes #582
Type of Change
Changes Made
deleteErrorstate inGoalTracker.tsx.handleDeleteto catch unsuccessful API responses and set the appropriate error message.CONTRIBUTING.mdbranch naming and conventional commit guidelines.How to Test
Steps for the reviewer to verify this works:
npm run dev./api/goalsrequest endpoint.Screenshots (if UI change)
N/A
Checklist
npm run lintpasses locallynpm run type-check)