Skip to content

feat: add Block Kit output mode#33

Draft
Koan-Bot wants to merge 3 commits into
masterfrom
koan.atoomic/block-kit-output-mode
Draft

feat: add Block Kit output mode#33
Koan-Bot wants to merge 3 commits into
masterfrom
koan.atoomic/block-kit-output-mode

Conversation

@Koan-Bot

@Koan-Bot Koan-Bot commented May 3, 2026

Copy link
Copy Markdown
Collaborator

What

Add native Block Kit output mode via format => 'blocks' constructor option.

Why

Slack's legacy attachment format (colored sidebars) is no longer evolving. Block Kit is the recommended format for new development (#24). This gives users a simple migration path without changing their post_* call sites.

How

  • New format accessor: 'attachment' (default, backwards compatible) or 'blocks'
  • In blocks mode, notify_slack() emits a single section block with mrkdwn text
  • Emoji prefixes replace colored sidebars (check-mark for OK, warning-sign for warning, etc.)
  • post() is unaffected — always sends raw payloads
  • Includes examples/blocks.pl showing both modes (native + manual via post())

Testing

  • Full test suite in t/block-kit.t (all post_* methods, title rendering, post_end timing, raw post bypass)
  • Existing t/hooks.t unchanged — default attachment mode behavior preserved

Resolves #24. Supersedes #25 (Block Kit docs now included here).


🤖 Generated with Claude Code

Koan-Bot and others added 2 commits May 3, 2026 06:51
Adds opt-in Block Kit support for post_* convenience methods.
When constructed with format => 'blocks', colored methods produce
Slack Block Kit sections with emoji severity prefixes instead of
legacy attachments with colored sidebars.

Default behavior (attachments) is unchanged. post() always sends
raw payloads regardless of format setting.

Addresses #24.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cpm now requires Perl 5.24+, breaking CI for older Perl versions
in the Docker-based matrix. cpanm supports Perl 5.8+ and handles
cpanfile installation identically.

The ubuntu job (system Perl 5.38) keeps cpm since it works fine there.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add examples/blocks.pl showing both format=>'blocks' mode and manual
Block Kit via post(). Expand post() POD to mention Block Kit as the
recommended format for custom layouts.

Subsumes PR #25 content — that PR can be closed after this merges.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Consider Slack Block Kit support (attachments are legacy)

1 participant