Repository navigation
feat(discord): lay the PR digest out as cards - #218
Conversation
The digest was plain text: a title line, then one wall of bullet lines per person. It now opens with a header card counting the open PRs, the people they wait on and what was wrapped up. Each person gets a card coloured by their oldest PR, listing their PRs oldest first with an age badge, then what they wrapped up. The mention stays in the message content so it pings. A card longer than Discord's 4096-character embed description continues in further messages, and only the first one pings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔵 Tier A · Mergeable after minor fixes
This change replaces the Discord PR digest’s plain-text output with a header embed and per-assignee embed cards. It adds age badges and colours, wrapped-up PR sections, title truncation, and message chunking for long cards, while preserving per-assignee mention controls.
Note Not approving while a bug finding is open: Exclude roundup-only groups from the waiting headcount
Fix with agent prompt### Issue 1
crates/claudear-integrations/src/notifier/discord/pr_digest.rs:68
**Exclude roundup-only groups from the waiting headcount**
Groups are also retained for people with only wrapped-up PRs, so `groups.len()` can count people with nothing waiting. In that case the header can say “0 open PRs waiting on 1 person”; count only groups with nonempty `pull_requests`.
```suggestion
let people = digest.groups.iter().filter(|group| !group.pull_requests.is_empty()).count();
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 2
Reviewed |
| /// how many were wrapped up since the last one. It pings no one. | ||
| pub(super) fn header(digest: &Digest) -> (DiscordMessage, AllowedMentions) { | ||
| let count = digest.count(); | ||
| let people = digest.groups.len(); |
There was a problem hiding this comment.
Exclude roundup-only groups from the waiting headcount
Groups are also retained for people with only wrapped-up PRs, so groups.len() can count people with nothing waiting. In that case the header can say “0 open PRs waiting on 1 person”; count only groups with nonempty pull_requests.
| let people = digest.groups.len(); | |
| let people = digest.groups.iter().filter(|group| !group.pull_requests.is_empty()).count(); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/claudear-integrations/src/notifier/discord/pr_digest.rs
Line: 68
Comment:
**Exclude roundup-only groups from the waiting headcount**
Groups are also retained for people with only wrapped-up PRs, so `groups.len()` can count people with nothing waiting. In that case the header can say “0 open PRs waiting on 1 person”; count only groups with nonempty `pull_requests`.
```suggestion
let people = digest.groups.iter().filter(|group| !group.pull_requests.is_empty()).count();
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · bug · Reply if this doesn't apply.
Why
The first weekly PR digest was a plain-text title followed by a wall of bullet lines for each person. This PR switches it to Discord embeds.
Layout
<@id>mention goes in the message content, outside the embed, so it still pings.🔴 \9d` org/repo#1 Title`, oldest first. Titles are cut at 100 characters and can never ping anyone.Tests
The new tests in
notifier/discord/pr_digest.rscover:The existing webhook and partial-delivery tests have been updated for the new content.
🤖 Generated with Claude Code