-
Notifications
You must be signed in to change notification settings - Fork 0
agent: @U0AJM7X8FBR Admin + Docs + API - we want to update the /coding page in #21
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,25 +1,28 @@ | ||||||||||||||||||
| import type { SlackTag } from "@/types/coding-agent"; | ||||||||||||||||||
|
|
||||||||||||||||||
| interface TagsByDateEntry { | ||||||||||||||||||
| export interface TagsByDateEntry { | ||||||||||||||||||
| date: string; | ||||||||||||||||||
| count: number; | ||||||||||||||||||
| pull_request_count: number; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| /** | ||||||||||||||||||
| * Aggregates Slack tags by UTC date (YYYY-MM-DD) for charting. | ||||||||||||||||||
| * Aggregates Slack tags and their associated pull requests by UTC date (YYYY-MM-DD) for charting. | ||||||||||||||||||
| * | ||||||||||||||||||
| * @param tags - Array of SlackTag objects | ||||||||||||||||||
| * @returns Array of { date, count } sorted ascending by date | ||||||||||||||||||
| * @returns Array of { date, count, pull_request_count } sorted ascending by date | ||||||||||||||||||
| */ | ||||||||||||||||||
| export function getTagsByDate(tags: SlackTag[]): TagsByDateEntry[] { | ||||||||||||||||||
| const counts: Record<string, number> = {}; | ||||||||||||||||||
| const counts: Record<string, { count: number; pull_request_count: number }> = {}; | ||||||||||||||||||
|
|
||||||||||||||||||
| for (const tag of tags) { | ||||||||||||||||||
| const date = tag.timestamp.slice(0, 10); // "YYYY-MM-DD" | ||||||||||||||||||
| counts[date] = (counts[date] ?? 0) + 1; | ||||||||||||||||||
| if (!counts[date]) counts[date] = { count: 0, pull_request_count: 0 }; | ||||||||||||||||||
| counts[date].count += 1; | ||||||||||||||||||
| counts[date].pull_request_count += (tag.pull_requests?.length ?? 0) > 0 ? 1 : 0; | ||||||||||||||||||
| } | ||||||||||||||||||
|
Comment on lines
+20
to
23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
At Line 22, this adds 🔧 Proposed fix- counts[date].pull_request_count += (tag.pull_requests?.length ?? 0) > 0 ? 1 : 0;
+ counts[date].pull_request_count += tag.pull_requests?.length ?? 0;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| return Object.entries(counts) | ||||||||||||||||||
| .map(([date, count]) => ({ date, count })) | ||||||||||||||||||
| .map(([date, { count, pull_request_count }]) => ({ date, count, pull_request_count })) | ||||||||||||||||||
| .sort((a, b) => a.date.localeCompare(b.date)); | ||||||||||||||||||
| } | ||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.