Skip to content

Redesign Discord notification system with rich embeds#8

Merged
byubean merged 43 commits intomainfrom
codex-plain-text-notifications
Apr 15, 2026
Merged

Redesign Discord notification system with rich embeds#8
byubean merged 43 commits intomainfrom
codex-plain-text-notifications

Conversation

@robbykap
Copy link
Copy Markdown
Collaborator

@robbykap robbykap commented Apr 1, 2026

Summary

Supersedes #7 (closed without merge). Redesigns Canvas and Docker Discord notifications from plain-text content into rich embeds with colored sidebars, author blocks, emoji badges, field-based sections, and timestamps.

What changed

  • Canvas & Docker notifications now use rich Discord embeds instead of plain-text content:
    • Colored sidebar: green (0x57F287) success, yellow (0xFEE75C) review needed, red (0xED4245) error
    • Author block with GitHub avatar
    • Embed fields for "Needs review" and "Deployed"/"Built"/"Failed" sections with emoji badges
    • Automatic field chunking when items exceed Discord's 1024-char field limit (handles 170+ items)
    • Embed-level chunking across multiple messages when total exceeds 6000 chars
    • Invisible spacer fields between major sections
    • UTC timestamps for Discord's native relative rendering
  • New --author-icon CLI arg for send_course.py — action passes https://github.com/{actor}.png
  • dedupe_remaining_content now returns (type, label, url) triples instead of (label, url) pairs
  • PyPI notification migration was split into follow-up PR Move PyPI notifications to shared notification package #9

⚠️ Breaking Changes

Canvas / Docker workflows

Caller workflows require these inputs (introduced in #7, carried forward here):

with:
  course_id: "235"
  course_name: "CS 235 Spring 2025"
  course_url: "https://byu.instructure.com/courses/12345"

utils_ref remains optional (for smoke-testing against a non-main utils branch).

Downstream course workflow PRs (from #7):

Repo PR Description
CS235-course-content #256 Add required course notification inputs
CS110-course-content #56 Add required course notification inputs
CS312-course-content #215 Add required course notification inputs
CS301R-Agent-Engineering-Course-Content #40 Add required course notification inputs

dedupe_remaining_content return type

Changed from list[tuple[str, str | None]] to list[tuple[str, str, str | None]] — now includes the content type. Only used internally by canvas_format.py.


Verified

  • Canvas notification — end-to-end tested via testkapua/testing-repo (170 items, field chunking works)
  • Docker notification — end-to-end tested via testkapua/testing-repo
  • Error state notifications render truncated tracebacks in embed description
  • Role mentions (<@&{cicd_role_id}>) still work via content field
  • Embed chunking handles payloads exceeding Discord's 6000-char embed limit

Post-merge checklist

  • Merge downstream course workflow PRs: CS235#256, CS110#56, CS312#215, CS301R#40
  • Review or merge follow-up PyPI PR: #9
  • Update testkapua/testing-repo workflow refs from codex-plain-text-notifications to main

🤖 Generated with Claude Code

robbykap and others added 29 commits February 13, 2026 12:16
This reverts commit c61eb59.
Embed provides a colored header bar with title and footer.
Plain text content uses Discord markdown (### headers, links,
code blocks) for clean readability. Color-coded sidebar:
green (success), orange (needs review), red (errors).

Simplified formatters, removed unused helpers, updated tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace plain-text content with rich Discord embeds matching the
MDXCanvas deploy notification style: colored sidebar (green/yellow/red),
author block with GitHub avatar, emoji resource-type badges, embed
fields for deployed/review/failed items, and timestamps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Discord field values are capped at 1024 chars. With 170+ deployed
items, a single field overflows and Discord returns 400. Added
chunk_field_lines() to split lines into field-sized chunks, and
continuation fields use zero-width space headers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Zero-width space spacers were invisible. Replace with a thin
horizontal dash line for clear visual separation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MDXCanvas outputs lowercase types (page, quiz, module_item) but
the emoji map had PascalCase keys. Normalized to lowercase lookup
and added module_item, announcement, syllabus types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@robbykap robbykap changed the title Redesign Discord notification system Redesign Discord notification system with rich embeds Apr 1, 2026
robbykap and others added 13 commits April 8, 2026 12:38
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
EmbedBuilder tracks character budget and field count, enforcing Discord
embed limits when building Embed dataclasses incrementally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…in wrappers

Remove all constants and chunking functions from send_notification.py (now delegates
to discord_limits) and remove chunk_field_lines, emoji_for, RESOURCE_EMOJI, and
MAX_FIELD_CHARS from formatting_utils.py. Replace test_embed_chunking.py to test the
canonical discord_limits exports instead of the deleted private helpers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the old chunk_field_lines/emoji approach with the new 3-case
notification format: error (red), needs-review (yellow), success (green).
Uses tabulate pipe-format overview tables, EmbedBuilder/MessageBuilder
for limit-aware field packing, and removes all emojis per spec.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… to pass cicd_role_id, and update formatter tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@byubean byubean merged commit e186133 into main Apr 15, 2026
@byubean byubean deleted the codex-plain-text-notifications branch April 15, 2026 21:30
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