[codex] Add profile range filters - #785
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Zhan-boyi
marked this pull request as ready for review
June 28, 2026 15:21
junhoyeo
approved these changes
Jun 29, 2026
junhoyeo
left a comment
Owner
There was a problem hiding this comment.
Thanks @Zhan-boyi — clean, well-scoped addition. The period filtering (all/week/month) is solid: UTC-normalized date ranges (week = 7 days inclusive, month = 30), the canonical-username redirect preserves the period param, and rolling-period overview stats are correctly recomputed from the daily-breakdown rows. The test coverage is thorough — date-range assertions, recomputed totals, and clients/models. cubic clean, CI green.
(Minor, non-blocking: sessionCount reads 0 for rolling periods since it isn't derivable from daily rows — fine to follow up later if you want to surface it.) 🚀
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds overview range filters to public user profiles so
/u/[username]can switch between all-time, rolling 7-day, and rolling 30-day views.What changed
period=week|monthsupport toGET /api/users/[username].daily_breakdownrows for rolling ranges, including tokens, cost, token breakdown, active days, active time, clients, and model usage.All / 7d / 30dsegmented control on public profile pages.Notes
monthis treated as a rolling 30-day window on user profiles, matching the UI label30d. This leaves the existing leaderboard period semantics untouched.Validation
Passed:
Observed existing unrelated blockers when running broader checks:
npx --yes bun@latest run testfails in
__tests__/lib/clientRegistry.test.tsbecausezcodeandopencoderevieware rejected/missing from the frontend registry.fails on pre-existing
react-hooks/set-state-in-effectissues inViewSelector/Footerrelated files outside this change.is blocked in this sparse checkout by an existing tuple typing issue in
groupMemberRoleRoute.test.tsand by omitted public asset files such aspublic/assets/hero-bg.png.Summary by cubic
Adds range filters to public profiles (All, 7d, 30d) with rolling stats and a segmented control. Updates the API to support period-scoped data and preserves the selected period across redirects.
GET /api/users/[username]acceptsperiod=week|month(defaultall), returnsperiodanddateRange, recalculates rolling totals fromdaily_breakdown(tokens, cost, token breakdown, active days/time), derivesclients/modelsfrom the period, hides rank and setssessionCount=0for rolling windows; canonical username redirects keepperiod. Note:monthis a rolling 30-day window.All / 7d / 30dsegmented control on/u/[username]; uses query params to fetch the selected period and preserves it in server/client redirects.Written for commit d746a2f. Summary will update on new commits.