Skip to content

feat: add urgent deadline badges to Program Tracker cards (#1007)#1417

Open
Xenon010101 wants to merge 4 commits into
Sachinchaurasiya360:mainfrom
Xenon010101:fix/urgent-deadline-badge
Open

feat: add urgent deadline badges to Program Tracker cards (#1007)#1417
Xenon010101 wants to merge 4 commits into
Sachinchaurasiya360:mainfrom
Xenon010101:fix/urgent-deadline-badge

Conversation

@Xenon010101
Copy link
Copy Markdown
Contributor

Closes #1007

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

Warning

Review limit reached

@Xenon010101, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 687cafdd-318d-446b-b410-42b550fc69cf

📥 Commits

Reviewing files that changed from the base of the PR and between e15a36c and 4f39537.

📒 Files selected for processing (4)
  • client/src/module/student/opensource/GSoCReposPage.tsx
  • client/src/module/student/opensource/ProgramTrackerPage.tsx
  • client/src/module/student/opensource/SuggestRepoModal.tsx
  • client/src/module/student/opensource/_shared/repo-utils.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the level:intermediate Requires moderate project understanding label Jun 4, 2026
@github-actions github-actions Bot added enhancement New feature or request gssoc labels Jun 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

Hi @Xenon010101, thanks for contributing to InternHack! 🎉

I have automatically:

  • 👤 Assigned this PR to you.
  • 🏷️ Applied the gssoc:approved label.

Our workflows will now analyze your changes to classify:

  • 📈 PR Difficulty: level:*
  • 🧩 PR Type: type:*
  • 🌟 PR Quality: quality:*

Tip

Ensure your PR description references the issue it resolves (e.g. Closes #123). This allows the bot to inherit any additional labels from that issue!

Happy coding! 🚀

@github-actions github-actions Bot added gssoc:approved Approved for GSSoC scoring type:bug Bug fixes type:feature New feature implementation scope:frontend Changes to client-side / UI code quality:clean Clean and well-structured contribution labels Jun 4, 2026
@Sachinchaurasiya360
Copy link
Copy Markdown
Owner

Code Review — PR #1417: Urgent Deadline Badges on Program Tracker

Hi @Xenon010101, the urgency levels and animate-pulse banner are a good UX addition. Found two issues.


🔴 nextDate() is called at module load time — deadlines go stale while the page is open

PROGRAMS is a module-level constant array. nextDate() is called inside it:

const PROGRAMS: Program[] = [
  {
    applicationDeadline: nextDate(4, 19),  // ← computed ONCE when the module loads
  },
  ...
];

new Date() inside nextDate runs when JavaScript first imports this module — typically when the user first opens the app. If the user keeps the tab open past midnight on a day when nextDate would roll over (e.g. the deadline year increments), the displayed deadline is frozen at the initial value. The "days left" countdown will not match reality without a page refresh.

Fix: Compute the deadlines dynamically inside the component render, or use useMemo with a dependency that triggers re-computation (e.g. current date at minute granularity). Alternatively, move nextDate() inside the component:

function ProgramCard({ program }: { program: Program }) {
  const deadlines = useMemo(() => computeDeadlines(), []);
  ...
}

🟡 Merge conflict: PRs #1414, #1415, #1416, and this PR (#1417) all modify ProgramTrackerPage.tsx

All four PRs touch the same file. Whichever merges last will conflict with the previous three. These PRs need to be merged in sequence with each rebased on top of the previous:

Suggested order: #1414 (dynamic deadlines) → #1415 (dynamic year) → #1416 (URL hint) → #1417 (urgency badges)

Please coordinate with the PR author and rebase on top of whichever merges first.

Copy link
Copy Markdown
Owner

@Sachinchaurasiya360 Sachinchaurasiya360 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gssoc:approved Approved for GSSoC scoring gssoc level:intermediate Requires moderate project understanding quality:clean Clean and well-structured contribution scope:frontend Changes to client-side / UI code type:bug Bug fixes type:feature New feature implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: urgent deadline badge on Program Tracker — highlight programs closing within 7 days

2 participants