[0] Custom Hackathon Dashboards#475
Conversation
🚥 Pre-merge checks | ✅ 5 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
DGoel1602
left a comment
There was a problem hiding this comment.
The first thing is minimal but I think the second one does need some eyes
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/blade/src/app/_components/dashboard/hackathon-dashboard/point-leaderboard.tsx (1)
21-54: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRemove the hardcoded leaderboard cutoff from the base component.
targetDateis fixed to October 25, 2025. On June 24, 2026,targetDate <= Date.now()is always true, so non-admin users will stay in the hidden-leaderboard branch indefinitely. This breaks the new reusable/base behavior across hackathons.💡 Suggested fix
-export function BaseHackathonPointLeaderboard({ - hacker, - hId, -}: { +export function BaseHackathonPointLeaderboard({ + hacker, + hId, + hideLeaderboardAfter, +}: { hacker: Awaited<ReturnType<(typeof serverCall.hackerQuery)["getHacker"]>>; hId: string; + hideLeaderboardAfter?: Date; }) { @@ - const targetDate = new Date("2025-10-25T23:00:00").getTime(); + const targetDate = hideLeaderboardAfter?.getTime() ?? Number.POSITIVE_INFINITY;-<BaseHackathonPointLeaderboard - hacker={hacker} - hId={hackathon.name} -/> +<BaseHackathonPointLeaderboard + hacker={hacker} + hId={hackathon.name} + hideLeaderboardAfter={hackathon.endDate} +/>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/blade/src/app/_components/dashboard/hackathon-dashboard/point-leaderboard.tsx` around lines 21 - 54, The targetDate variable in the BaseHackathonPointLeaderboard function is hardcoded to October 25, 2025, which means once the current date passes this fixed date, the leaderboard visibility condition will always be true for non-admin users, breaking the reusable behavior across different hackathons. Remove the hardcoded targetDate variable and instead pass the leaderboard cutoff date as a configurable prop to the BaseHackathonPointLeaderboard function, or derive it from the hackathon data that is already being passed in as the hId parameter, allowing each hackathon instance to specify its own cutoff date.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/blade/src/app/_components/dashboard/hackathon-dashboard/components.tsx`:
- Around line 35-36: Remove the type assertion using `as Record<string,
BaseHackathonClassInfo>` from the DEFAULT_CLASS_INFO variable declaration and
replace it with an explicit type annotation instead. Change the declaration to
use a colon followed by the type annotation directly on the variable (`:
Record<string, BaseHackathonClassInfo>`) rather than casting with `as`. This
ensures proper type checking without bypassing it through assertions.
In `@apps/blade/src/app/hackathon/bloomknights/page.tsx`:
- Line 41: Remove the `as string` type assertion from the hacker.status
comparison on line 41. The status field is already properly typed as a string
literal union from the database schema, so the cast is unnecessary and bypasses
TypeScript's type safety. Replace the conditional check with optional chaining
syntax (hacker?.status) instead of the current `hacker && (hacker.status as
string)` pattern to achieve a cleaner, type-safe comparison while maintaining
the same functionality.
---
Outside diff comments:
In
`@apps/blade/src/app/_components/dashboard/hackathon-dashboard/point-leaderboard.tsx`:
- Around line 21-54: The targetDate variable in the
BaseHackathonPointLeaderboard function is hardcoded to October 25, 2025, which
means once the current date passes this fixed date, the leaderboard visibility
condition will always be true for non-admin users, breaking the reusable
behavior across different hackathons. Remove the hardcoded targetDate variable
and instead pass the leaderboard cutoff date as a configurable prop to the
BaseHackathonPointLeaderboard function, or derive it from the hackathon data
that is already being passed in as the hId parameter, allowing each hackathon
instance to specify its own cutoff date.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 8f344a94-5ac6-48f4-820f-80ce15e98baf
📒 Files selected for processing (19)
apps/blade/src/app/_components/dashboard/hackathon-dashboard/components.tsxapps/blade/src/app/_components/dashboard/hackathon-dashboard/countdown.tsxapps/blade/src/app/_components/dashboard/hackathon-dashboard/hackathon-dashboard.tsxapps/blade/src/app/_components/dashboard/hackathon-dashboard/hackathon-data.tsxapps/blade/src/app/_components/dashboard/hackathon-dashboard/issue-dialog.tsxapps/blade/src/app/_components/dashboard/hackathon-dashboard/point-leaderboard.tsxapps/blade/src/app/_components/dashboard/hackathon-dashboard/team-points.tsxapps/blade/src/app/_components/dashboard/hackathon-dashboard/upcoming-events.tsxapps/blade/src/app/_components/dashboard/hacker-dashboard/hacker-dashboard.tsxapps/blade/src/app/_components/dashboard/hacker-dashboard/hacker-data.tsxapps/blade/src/app/_components/dashboard/member-dashboard/current-hackathon-notice.tsxapps/blade/src/app/_components/dashboard/member-dashboard/member-dashboard.tsxapps/blade/src/app/_components/user-interface.tsxapps/blade/src/app/hackathon/bloomknights/components/bk-hackathon-dashboard.tsxapps/blade/src/app/hackathon/bloomknights/page.tsxapps/blade/src/app/hackathon/current/page.tsxapps/blade/src/app/hackathon/page.tsxpackages/api/src/routers/hackathon.tspackages/api/src/routers/hackers/mutations.ts
Custom Hackathon Dashboards
The hackathon dashboard now gets presented at
/hackathon/slug./hackathonand/hackathon/currentboth redirect to the current hackathon (determined by the api fetch), if one exists.Test Plan
cc @DGoel1602 (my forge doesn't work)
his images:
Summary by CodeRabbit
Release Notes
New Features
Improvements