Skip to content

Add Bot/Community PR categorization to digest pages#2

Merged
prozolic merged 2 commits intomainfrom
pr
Feb 14, 2026
Merged

Add Bot/Community PR categorization to digest pages#2
prozolic merged 2 commits intomainfrom
pr

Conversation

@prozolic
Copy link
Copy Markdown
Owner

Summary

This PR add this following feature.

  • Add bot PR detection and heading tracking in the analyzer, classifying PRs as Bot or Community based on username patterns ([bot] suffix, @Copilot)
  • Display bot PR count as a new stat card on the index page alongside total PRs and label count
  • Add a "カテゴリ別" (Category) tab to daily digest pages, showing Community PRs and Bot PRs in separate sections
  • Extract AppendHeadingListItem helper to share PR heading rendering logic between label view and category view

Related PR

#1

Copilot AI review requested due to automatic review settings February 14, 2026 01:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 AppendHeadingListItem helper 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.

Comment thread src/PRDigest.NET/PullReqeustAnalayzer.cs
public int PullRequestCountForBot;
public Dictionary<string, List<HeadingBlock>>? LabelInfo;
public Dictionary<string, string>? LabelColorMap;
public List<HeadingBlock>? BotPullRequestHeadings;
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
public List<HeadingBlock>? BotPullRequestHeadings;
public List<HeadingBlock> BotPullRequestHeadings;

Copilot uses AI. Check for mistakes.
Comment thread src/PRDigest.NET/PullReqeustAnalayzer.cs
Comment thread src/PRDigest.NET/HtmlGenereator.cs
Comment thread src/PRDigest.NET/PullReqeustAnalayzer.cs Outdated
Comment thread src/PRDigest.NET/PullReqeustAnalayzer.cs
.stats-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-columns: repeat(3, 1fr);
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

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); }'.

Copilot uses AI. Check for mistakes.
Comment thread src/PRDigest.NET/PullReqeustAnalayzer.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@prozolic prozolic merged commit 6941847 into main Feb 14, 2026
1 of 2 checks passed
@prozolic prozolic deleted the pr branch February 14, 2026 01:23
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