-
Notifications
You must be signed in to change notification settings - Fork 38
feat: Add contributor activity timeline to daily summary #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This commit introduces a new timeline visualization on the daily summary page, displaying contributor activity throughout the day. Key changes: 1. **Data Structures (`src/lib/data/types.ts`):** * Added `ContributorActivityHour` interface and `TimelineActivityData` type to represent hourly activity. 2. **Data Fetching (`src/app/[interval]/[[...date]]/queries.ts`):** * Implemented `getTimelineActivityData` query to fetch commits, PRs, issues, reviews, and comments, aggregated by contributor and hour for a given day. * The query joins with the `users` table to include login and avatar information. 3. **Timeline Component (`src/app/[interval]/[[...date]]/components/ContributorActivityTimeline.tsx`):** * Created a new React component to render the timeline. * Displays 24 hour slots with contributor avatars shown under the hour of their activity. * Uses existing `Avatar` and `Tooltip` UI components. * Handles cases with no activity and provides avatar fallbacks. 4. **Integration (`src/app/[interval]/[[...date]]/page.tsx`):** * The `ContributorActivityTimeline` is now included on the daily summary page, positioned above the "Code Changes" section. * Data is fetched using the new query and passed to the component. 5. **Testing:** * Added comprehensive unit tests for `getTimelineActivityData` in `queries.test.ts`, mocking database responses and covering various scenarios (no activity, single/multiple users, aggregation, different activity types). * Added unit tests for `ContributorActivityTimeline` in `ContributorActivityTimeline.test.tsx` using React Testing Library, covering rendering logic, empty states, avatar display, and fallbacks. This new timeline provides a clear visual overview of when contributors are active during a specific day, enhancing the insights available on the daily summary page.
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This commit introduces a new timeline visualization on the daily summary page, displaying contributor activity throughout the day.
Key changes:
Data Structures (
src/lib/data/types.ts
):ContributorActivityHour
interface andTimelineActivityData
type to represent hourly activity.Data Fetching (
src/app/[interval]/[[...date]]/queries.ts
):getTimelineActivityData
query to fetch commits, PRs, issues, reviews, and comments, aggregated by contributor and hour for a given day.users
table to include login and avatar information.Timeline Component (
src/app/[interval]/[[...date]]/components/ContributorActivityTimeline.tsx
):Avatar
andTooltip
UI components.Integration (
src/app/[interval]/[[...date]]/page.tsx
):ContributorActivityTimeline
is now included on the daily summary page, positioned above the "Code Changes" section.Testing:
getTimelineActivityData
inqueries.test.ts
, mocking database responses and covering various scenarios (no activity, single/multiple users, aggregation, different activity types).ContributorActivityTimeline
inContributorActivityTimeline.test.tsx
using React Testing Library, covering rendering logic, empty states, avatar display, and fallbacks.This new timeline provides a clear visual overview of when contributors are active during a specific day, enhancing the insights available on the daily summary page.