Skip to content

feat(badges): implement daily, weekly, monthly badge support#61

Open
doubledare704 wants to merge 2 commits intopinchbench:mainfrom
doubledare704:feat/48/daily-weekly-monthly-badges
Open

feat(badges): implement daily, weekly, monthly badge support#61
doubledare704 wants to merge 2 commits intopinchbench:mainfrom
doubledare704:feat/48/daily-weekly-monthly-badges

Conversation

@doubledare704
Copy link
Copy Markdown
Contributor

  • Extend badge calculation logic in lib/badges.ts for daily, weekly, monthly periods
  • Add API route handlers for badge endpoints (/daily, /weekly, /monthly)
  • Update submission page and UI components to render the new badges
  • Add unit tests covering the new badge functionality
    Implements Daily, weekly, monthly badges #48

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

@doubledare704 is attempting to deploy a commit to the Kilo Code Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
leaderboard Ready Ready Preview, Comment Mar 31, 2026 3:27pm

Request Review

@olearycrew
Copy link
Copy Markdown
Member

Love this idea @doubledare704 thanks for it

CleanShot 2026-03-31 at 11 30 14@2x

in the deploy i'm seeing these errors

CleanShot 2026-03-31 at 11 30 47@2x

Do you see those locally?

@doubledare704
Copy link
Copy Markdown
Contributor Author

Love this idea @doubledare704 thanks for it

CleanShot 2026-03-31 at 11 30 14@2x

in the deploy i'm seeing these errors

CleanShot 2026-03-31 at 11 30 47@2x

Do you see those locally?

Haven't seen during local dev run. Will keep looking for it, and rebase branch to be able to merge.

@NianJiuZst
Copy link
Copy Markdown
Contributor

@doubledare704
I love your wonderful idea!But all three badge periods use a fixed rolling window, not a calendar period.

1d → 24-hour sliding window (not "today")

7d → 7×24h sliding window (not "this week")

30d → 30×24h sliding window (not "this month")

Example for 1d: if you hold #1 at 23:59 UTC, your badge can expire ~1 minute later when the window slides. No calendar boundary is used anywhere — durationMs is just arithmetic: 24 * 60 * 60 * 1000.

Suggestion: Replace the durationMs arithmetic with UTC calendar boundaries — e.g. for 1d, use the start of the current UTC day; for 7d, the start of the current UTC week (Monday); for 30d, the first day of the current UTC month. Or if a rolling window is intentional, consider renaming labels to "24H 7D 30D" to set correct expectations.

- Extend badge calculation logic in `lib/badges.ts` for daily, weekly, monthly periods
- Add API route handlers for badge endpoints (`/daily`, `/weekly`, `/monthly`)
- Update submission page and UI components to render the new badges
- Add unit tests covering the new badge functionality
@doubledare704 doubledare704 force-pushed the feat/48/daily-weekly-monthly-badges branch from a64733a to 6d8e8c4 Compare March 31, 2026 17:33
@doubledare704
Copy link
Copy Markdown
Contributor Author

@olearycrew @NianJiuZst added changes to fix both mentioned parts

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants