Skip to content

[0] Custom Hackathon Dashboards#475

Open
alexanderpaolini wants to merge 3 commits into
mainfrom
blade/hackathon-pages
Open

[0] Custom Hackathon Dashboards#475
alexanderpaolini wants to merge 3 commits into
mainfrom
blade/hackathon-pages

Conversation

@alexanderpaolini

@alexanderpaolini alexanderpaolini commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Custom Hackathon Dashboards

The hackathon dashboard now gets presented at /hackathon/slug. /hackathon and /hackathon/current both redirect to the current hackathon (determined by the api fetch), if one exists.

Test Plan

cc @DGoel1602 (my forge doesn't work)

his images:

image image image

Summary by CodeRabbit

Release Notes

  • New Features

    • Added dedicated hackathon dashboard pages for streamlined access to hackathon-specific information
    • Introduced active hackathon notifications in the member dashboard
  • Improvements

    • Simplified dashboard navigation by consolidating layout structure
    • Enhanced event countdown and upcoming events display for better visibility

@alexanderpaolini alexanderpaolini added Minor Small change - 1 reviewer required Blade Change modifies code in Blade app Database Change modifies code in the DB package labels Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
🚥 Pre-merge checks | ✅ 5 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
No Typescript Escape Hatches ⚠️ Warning Found 2 type assertions (as) in PR files that violate the no-escape-hatches rule: (1) Line 41 in bloomknights/page.tsx: (hacker.status as string) should use optional chaining; (2) Lines 35-36 i... Fix both type assertions: Replace (hacker.status as string) with hacker?.status and add explicit type annotation for DEFAULT_CLASS_INFO instead of casting.
Title check ⚠️ Warning The pull request title does not follow the required format; it uses "[0]" instead of a valid issue number like "[#123]". Update the title to use a valid issue number format, e.g., "[#123] Custom Hackathon Dashboards" or similar, following the pattern "[#ISSUE_NUMBER] Brief description".
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No Hardcoded Secrets ✅ Passed No hardcoded API keys, passwords, tokens, or secrets found. Only public configuration values (Notion guide URL) and normal code strings are present.
Validated Env Access ✅ Passed No direct process.env usage found in any of the 19 modified files across dashboard, hackathon, and API router changes.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch blade/hackathon-pages

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.

@DGoel1602 DGoel1602 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The first thing is minimal but I think the second one does need some eyes

Comment thread apps/blade/src/app/_components/dashboard/hackathon-dashboard/components.tsx Outdated
Comment thread apps/blade/src/app/hackathon/bloomknights/page.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 win

Remove the hardcoded leaderboard cutoff from the base component.

targetDate is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 58ad852 and a2c28bb.

📒 Files selected for processing (19)
  • apps/blade/src/app/_components/dashboard/hackathon-dashboard/components.tsx
  • apps/blade/src/app/_components/dashboard/hackathon-dashboard/countdown.tsx
  • apps/blade/src/app/_components/dashboard/hackathon-dashboard/hackathon-dashboard.tsx
  • apps/blade/src/app/_components/dashboard/hackathon-dashboard/hackathon-data.tsx
  • apps/blade/src/app/_components/dashboard/hackathon-dashboard/issue-dialog.tsx
  • apps/blade/src/app/_components/dashboard/hackathon-dashboard/point-leaderboard.tsx
  • apps/blade/src/app/_components/dashboard/hackathon-dashboard/team-points.tsx
  • apps/blade/src/app/_components/dashboard/hackathon-dashboard/upcoming-events.tsx
  • apps/blade/src/app/_components/dashboard/hacker-dashboard/hacker-dashboard.tsx
  • apps/blade/src/app/_components/dashboard/hacker-dashboard/hacker-data.tsx
  • apps/blade/src/app/_components/dashboard/member-dashboard/current-hackathon-notice.tsx
  • apps/blade/src/app/_components/dashboard/member-dashboard/member-dashboard.tsx
  • apps/blade/src/app/_components/user-interface.tsx
  • apps/blade/src/app/hackathon/bloomknights/components/bk-hackathon-dashboard.tsx
  • apps/blade/src/app/hackathon/bloomknights/page.tsx
  • apps/blade/src/app/hackathon/current/page.tsx
  • apps/blade/src/app/hackathon/page.tsx
  • packages/api/src/routers/hackathon.ts
  • packages/api/src/routers/hackers/mutations.ts

Comment thread apps/blade/src/app/_components/dashboard/hackathon-dashboard/components.tsx Outdated
Comment thread apps/blade/src/app/hackathon/bloomknights/page.tsx Outdated
@alexanderpaolini alexanderpaolini marked this pull request as ready for review June 24, 2026 02:33
@alexanderpaolini alexanderpaolini changed the title [WIP] Custom Hackathon Dashboards [0] Custom Hackathon Dashboards Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blade Change modifies code in Blade app Database Change modifies code in the DB package Minor Small change - 1 reviewer required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants