Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the PR digest pages by adding bot/community PR categorization functionality. It analyzes PR authors to distinguish between bot PRs (those with "[bot]" suffix or "@copilot" in the username) and community PRs, displaying them in a new "カテゴリ別" (Category) tab alongside the existing list and label views.
Changes:
- Added bot detection logic that categorizes PRs based on username patterns
- Introduced a bot PR count stat card on the index page
- Created a new category tab view on daily digest pages separating Community and Bot PRs
- Extracted a reusable
AppendHeadingListItemhelper method to reduce code duplication
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| src/PRDigest.NET/PullReqeustAnalayzer.cs | Added bot detection logic, PR categorization tracking, and new fields to AnalayzerResult for bot/community PR headings |
| src/PRDigest.NET/HtmlGenereator.cs | Added bot PR stat card, category tab UI, extracted AppendHeadingListItem helper, and updated stats grid to 3 columns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public int PullRequestCountForBot; | ||
| public Dictionary<string, List<HeadingBlock>>? LabelInfo; | ||
| public Dictionary<string, string>? LabelColorMap; | ||
| public List<HeadingBlock>? BotPullRequestHeadings; |
There was a problem hiding this comment.
There's an inconsistency in the nullability of BotPullRequestHeadings (nullable) versus CommunityPullRequestHeadings (non-nullable). Both are initialized as new List instances and used in similar ways. Since CommunityPullRequestHeadings is also used to create a ReadOnlySpan via CollectionsMarshal.AsSpan (which requires a non-null list), it makes sense for it to be non-nullable. For consistency, BotPullRequestHeadings should also be non-nullable, and the null-coalescing operators on lines 204 and 208 in HtmlGenereator.cs can be removed.
| public List<HeadingBlock>? BotPullRequestHeadings; | |
| public List<HeadingBlock> BotPullRequestHeadings; |
| .stats-grid { | ||
| display: grid; | ||
| grid-template-columns: repeat(2, 1fr); | ||
| grid-template-columns: repeat(3, 1fr); |
There was a problem hiding this comment.
The stats grid now has 3 columns on all screen sizes. On mobile devices (max-width: 768px), this may result in cramped cards. Consider adding a responsive style in the @media (max-width: 768px) section to make the grid single-column or wrap to 2 columns on mobile, for example: '.stats-grid { grid-template-columns: 1fr; }' or '.stats-grid { grid-template-columns: repeat(2, 1fr); }'.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
This PR add this following feature.
[bot]suffix,@Copilot)Related PR
#1