Skip to content

feat: add user contributions summary#9

Open
Jampaa wants to merge 1 commit into
mainfrom
feat/user-contributions
Open

feat: add user contributions summary#9
Jampaa wants to merge 1 commit into
mainfrom
feat/user-contributions

Conversation

@Jampaa
Copy link
Copy Markdown
Collaborator

@Jampaa Jampaa commented May 14, 2026

User Contributions Feature – Summary

Implemented a new User Contributions page that displays group-level annotator and reviewer totals using:

GET /contributions/{group_id}/summary

The page shows:

Overall totals (all-time)
Filtered totals (within a selected date range)

in the format:

overall (filtered)

Example: 40 (17).

Key Logic
Default filter uses a rolling 30-day inclusive range.
end = today
start = end - 29 days
Both dates are inclusive, so the range always contains exactly 30 days.
Data Fetching
Overall and filtered summaries are fetched in parallel using Promise.all().
Results are cached with TanStack Query using groupId + date range as the cache key.
User Experience
Non-admin users automatically see their group’s contributions for the last 30 days.
Admins can view all groups and apply custom date filters per group.
Additional Updates
Added route: /admin/user-contributions
Added sidebar navigation item
Added English and Tibetan translations

non admin view
Screenshot 2026-05-14 at 11 49 56 AM

admin view (video demo)

neww.mov

@Jampaa Jampaa requested review from UzumakiSither and tenkus47 May 14, 2026 06:29
Copy link
Copy Markdown
Member

@tenkus47 tenkus47 left a comment

Choose a reason for hiding this comment

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

Looks good to me:

Dont use too much States, try using params for things like date and filters. so they dont get reset on page refresh

@Jampaa
Copy link
Copy Markdown
Collaborator Author

Jampaa commented May 14, 2026 via email

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.

2 participants