feat: add urgent deadline badges to Program Tracker cards (#1007)#1417
feat: add urgent deadline badges to Program Tracker cards (#1007)#1417Xenon010101 wants to merge 4 commits into
Conversation
|
Warning Review limit reached
More reviews will be available in 3 minutes and 50 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @Xenon010101, thanks for contributing to InternHack! 🎉 I have automatically:
Our workflows will now analyze your changes to classify:
Tip Ensure your PR description references the issue it resolves (e.g. Happy coding! 🚀 |
Code Review — PR #1417: Urgent Deadline Badges on Program TrackerHi @Xenon010101, the urgency levels and 🔴
|
Sachinchaurasiya360
left a comment
There was a problem hiding this comment.
The badge idea is right but there are several correctness bugs that need to be fixed before merge.
Bug 1 (Critical) - The urgent badge tier is never rendered:
getUrgency() defines four levels (closed, critical, urgent, normal) but ProgramCard only checks urgency?.level === "critical" for the banner and urgency?.level === "closed" for the Closed badge. There is no case handling the "urgent" level. The PR title says "add urgent deadline badges" but the urgent tier silently produces no visual output at all. The urgent and normal cases need to be wired up in ProgramCard JSX.
Bug 2 (Critical) - Stale program.deadline used for urgency while applicationDeadline uses nextDate():
getUrgency reads program.deadline which are hardcoded static strings (e.g. GSoC has deadline "2026-04-08", already 57 days in the past). But in this same PR you changed applicationDeadline to use nextDate() for future-rolling dates. Result: GSoC and GSSoC will permanently show a "Closed" badge today because their static deadline field is in the past, while their applicationDeadline correctly shows a future 2027 date. The urgency calculation should use the same nextDate()-derived applicationDeadline, not the hardcoded deadline string.
Bug 3 (High) - Outreachy applicationStart can be after applicationDeadline for 7 days each year:
Between Feb 6 16:00 UTC and Feb 13 16:00 UTC, nextDate(2,6,16,0) rolls to next year while nextDate(2,13,16,0) stays in the current year, producing applicationStart = 2028-02-06 and applicationDeadline = 2027-02-13. Start is a full year after the deadline, generating an invalid negative-duration Google Calendar event.
Bug 4 (High) - JSX indentation regression in ProgramCard:
The diff removes the flex wrapper div at 10-space indent and re-adds it at 12-space indent, but the original closing tag remains at its old position. This makes the short-code badge and program title siblings of the flex row instead of children, breaking the card layout.
Style violations (pre-existing, but this PR edits the same block):
rounded-full appears on status and eligibility badges at lines 724, 729, and 792. Project rules (CLAUDE.md) prohibit rounded-full anywhere. Since this PR directly edits the surrounding JSX, please fix these while you are here.
Fix the three critical/high bugs and this will be ready for another review pass.
Closes #1007