Skip to content

feat(discord): lay the PR digest out as cards - #218

Merged
abnegate merged 1 commit into
mainfrom
feat/pr-digest-layout
Nov 12, 2026
Merged

abnegate merged 1 commit into
mainfrom
feat/pr-digest-layout

Conversation

@abnegate

Copy link
Copy Markdown
Member

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

  • Header card (pings no one): "📬 Claudear PR digest". It shows how many open PRs wait on how many people, and how many were wrapped up since the last digest. The footer explains the age badges.
  • One card per person:
    • The <@id> mention goes in the message content, outside the embed, so it still pings.
    • The card title is "N PRs waiting on you", or "🎉 You wrapped up N PRs" when nothing is waiting.
    • The card colour follows the oldest PR: green under 3 days, amber under a week, red at a week or more.
    • Each line reads 🔴 \9d` org/repo#1 Title`, oldest first. Titles are cut at 100 characters and can never ping anyone.
    • A "🎉 Wrapped up since the last digest, nice work" section lists ✅ merged and 🚫 closed PRs.
  • Chunking: a card longer than Discord's 4096-character embed description continues as "… (continued)" in further messages. Only the first message pings.

Tests

The new tests in notifier/discord/pr_digest.rs cover:

  • the line layout and badges;
  • colour by the oldest PR;
  • the roundup section;
  • a roundup-only card;
  • chunking 200 PRs within the limit while keeping every line;
  • title truncation and mention breaking;
  • the header counts.

The existing webhook and partial-delivery tests have been updated for the new content.

🤖 Generated with Claude Code

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>
@appwrite

appwrite Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🔵 Tier A · Mergeable after minor fixes

The header can misstate how many people have open PRs waiting on them when a digest contains roundup-only groups.

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.

Verdict New comments Fixed Still open
💬 Commented 1 0 0

Note

Not approving while a bug finding is open: Exclude roundup-only groups from the waiting headcount

Finding Where
🟡 Exclude roundup-only groups from the waiting headcount crates/claudear-integrations/src/notifier/discord/pr_digest.rs:68
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
File Change
crates/claudear-integrations/src/notifier/discord.rs Routes PR digest delivery through the new embed-card builder and updates digest notification tests.
crates/claudear-integrations/src/notifier/discord/pr_digest.rs Builds the header and per-assignee cards, formats PR lines and roundup entries, and chunks long descriptions.

Reviewed 7af3d2f · Details · Comment @appwrite review to re-run, or mention @appwrite with a question.

@appwrite appwrite Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · See the inline comments. Summary

/// 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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Suggested change
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.

@abnegate
abnegate merged commit 041996e into main Nov 12, 2026
19 checks passed
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.

1 participant