Skip to content

feat(blocks): add video, plan, and task_card block support#73

Merged
zhawtof merged 1 commit into
mainfrom
claude/hungry-torvalds-5ad639
May 20, 2026
Merged

feat(blocks): add video, plan, and task_card block support#73
zhawtof merged 1 commit into
mainfrom
claude/hungry-torvalds-5ad639

Conversation

@zhawtof
Copy link
Copy Markdown
Contributor

@zhawtof zhawtof commented May 20, 2026

Summary

Adds builder support for the three remaining Slack block types the validator already understands but the palette and editor surface didn't expose: video, plan, and task_card.

Why

The validator schema already accepts video, plan, and task_card, and slack-blocks-to-jsx already renders them, but block-kitchen had no SupportedBlockType entry, palette variant, or editor for any of them. That gap meant users couldn't compose the standard Slack media block (video) or the newer agent-facing blocks (plan, task_card) from the builder — they had to hand-roll the payloads.

This PR closes the gap so the builder covers Slack's full app-sendable surface (everything except file, which Slack only emits when reading messages and apps cannot send outbound).

What changed

  • Types (src/types.ts): new VideoBlock, PlanBlock, TaskCardBlock, TaskCardStatus, and UrlSourceElement interfaces; expanded SupportedBlockType and SupportedBlock unions.
  • Palette (src/lib/default-blocks.ts):
    • Agents section gets Plan, Task card, and Task card with sources variants.
    • New Video section with Basic and With metadata variants.
    • labelForBlockType gets cases for the three new types.
  • Editors: new video-editor.tsx, plan-editor.tsx, task-card-editor.tsx. Plan and task_card use a RadioGroup for status; task_card includes a sources sub-editor (add/remove rows of label + URL).
  • Wiring: block-editor.tsx dispatch cases, block-row.tsx label map, and src/index.ts public type exports.

The rich-text details and output fields on task_card round-trip on the payload but aren't editable inline in v1 — palette variants that include them keep them on save. A TaskCardEditor help line calls this out.

Test plan

  • pnpm typecheck
  • pnpm lint
  • pnpm test — 217/217 pass, including the every default palette factory produces a payload that validates check, which exercises each new factory through toSlackBlocksvalidateBlockKit.
  • Manually verified in pnpm demo:dev:
    • All 5 new palette variants drop into the preview surface.
    • All 3 new editors open with seeded values populated (Plan title + 3 tasks with status radios; Video's 9 fields; Task card title/id/sources/status).
    • The preview renders the blocks via slack-blocks-to-jsx.

Notes for reviewer

slack-blocks-to-jsx's video renderer puts a <p> containing a <div>, which React flags as a hydration warning in the console. The warning originates inside the library's own vl component (not our payload) and the block renders correctly; not addressed here.

🤖 Generated with Claude Code

Adds builder support for the three remaining Slack block types the
validator already understands but the palette and editor surface didn't
expose: `video` (embedded player with provider metadata), `plan` (agent
checklist), and `task_card` (tracked agent step with sources). New
palette variants ship in the Agents and Video sections; the per-block
popover editor dispatches to a typed form for each. All factory variants
round-trip through `toSlackBlocks` and pass `validateBlockKit` in the
existing `public-api` palette test.

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 e26c057 Commit Preview URL

Branch Preview URL
May 20 2026, 04:41 AM

@zhawtof zhawtof merged commit c1eb7a0 into main May 20, 2026
13 checks passed
@zhawtof zhawtof deleted the claude/hungry-torvalds-5ad639 branch May 20, 2026 05:05
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