Skip to content

feat(palette): ship alert block in default palette#72

Merged
zhawtof merged 1 commit into
mainfrom
claude/pensive-easley-d4d852
May 19, 2026
Merged

feat(palette): ship alert block in default palette#72
zhawtof merged 1 commit into
mainfrom
claude/pensive-easley-d4d852

Conversation

@zhawtof
Copy link
Copy Markdown
Contributor

@zhawtof zhawtof commented May 19, 2026

Summary

Add the Slack alert block to defaultPalette as a first-class section (Bell icon) with all five severity variants — Default, Info, Warning, Error, Success — sitting between Structure and Rich Text.

Why

The alert block was already wired through the type system (AlertBlock, AlertLevel), had its own editor (AlertEditor), validated against the schema, and rendered in the preview — but was intentionally excluded from defaultPalette to mirror Slack's own Block Kit Builder sidebar (which doesn't list it because alerts are modal-only). Consumers had to spread extraAlertVariant onto a custom palette to surface a single variant. With this change, anyone using the default palette gets the alert block out of the box, and the showcase covers every severity level rather than just warning.

extraAlertVariant stays exported for backward compatibility; its JSDoc now flags the duplicate alert_warning id (same handling pattern as legacyInputVariants).

Note: the validator's surface-compatibility check still surfaces "alert not allowed on message surface" if a user drops one onto the default message surface — that's correct behavior, since Slack only accepts alerts on modals.

Test plan

  • pnpm test — 217 tests pass, including the palette factory schema-validation guard
  • Spot-checked in the demo (pnpm --dir demo exec vite) — Alert section renders with all 5 variants, no console errors
  • pnpm typecheck
  • pnpm lint

🤖 Generated with Claude Code

The Slack alert block was wired through the type system, editor, and
preview but excluded from the default palette to mirror Slack's own
Block Kit Builder sidebar. Add it back as a first-class section
(Bell icon) with all five severity variants (default, info, warning,
error, success) so users can drag it onto the surface without
configuring a custom palette.

`extraAlertVariant` is retained for backward compatibility with
consumers who previously spread it onto a custom palette; its JSDoc
now notes the duplicate `alert_warning` id and that the alert ships
in the default palette.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
block-kitchen 5d855d1 Commit Preview URL

Branch Preview URL
May 19 2026, 10:30 PM

@zhawtof zhawtof merged commit 5d9ea0b into main May 19, 2026
13 checks passed
@zhawtof zhawtof deleted the claude/pensive-easley-d4d852 branch May 19, 2026 22:38
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