feat(block-kit): add block element examples - #227
Draft
zimeg wants to merge 2 commits into
Draft
Conversation
zimeg
force-pushed
the
block-element-examples
branch
2 times, most recently
from
August 28, 2026 05:20
156b8aa to
e41731b
Compare
Add examples for the block elements that the SDK already implements, each in its own file under block-kit/src/block_elements/ with a matching test. Every example mirrors the JSON payload(s) from the element's docs.slack.dev reference page verbatim -- hosted in a valid block (or input) where the element requires one -- so each is a runnable payload rather than a bare element that cannot be sent on its own. Where a reference page documents several payloads, every one is exemplified (for instance the select and multi-select menus each cover all five source variants, and the image element covers image_url and both slack_file forms). Tests assert the complete reference JSON. Covered: button, checkboxes, date picker, datetime picker, email input, file input, image, multi-select menu, number input, overflow menu, plain-text input, radio button group, select menu, time picker, URL input, and workflow button. Descriptions match the docs copy verbatim, following the existing blocks/ convention. The button page also documents an agent_prompt variant (Slackbot hand-off) that the SDK does not yet implement -- deferred here. This PR is the home for block elements the SDK implements; elements not yet implemented in the SDK are a separate follow-up. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
zimeg
force-pushed
the
block-element-examples
branch
from
August 28, 2026 05:36
e41731b to
099fd69
Compare
Adds examples for documented block elements the palette was missing: the rich-text sub-elements (emoji, broadcast, color, date, link, text, channel, user, usergroup, team), the rich-text containers (section, list, quote, preformatted), the rich-text input, the context_actions elements (feedback buttons, icon button), and the URL source. Each ships a matching test asserting the complete reference JSON from docs.slack.dev, plus an alphabetical README entry. Also reformats every existing block_elements test's expected payload to one key per line with a magic trailing comma so ruff format keeps them exploded. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds dedicated block element examples under
block-kit/, one file per element insrc/block_elements/with a matching test intests/block_elements/.Each example mirrors the JSON payload(s) from the element's docs.slack.dev reference page verbatim — hosted in a valid block (or input) where the element requires one, so each is a runnable payload rather than a bare element that can't be sent on its own. Where a reference page documents multiple payloads, every one is exemplified, and each test asserts the complete reference JSON.
This PR is the home for block elements the SDK implements; elements not yet implemented in the SDK are a separate follow-up.
Elements covered
image_url,slack_fileby url,slack_fileby id)Deferred
The button reference page also documents an
agent_promptvariant (Slackbot hand-off), which the SDK does not yet implement — deferred here rather than shipping an example whose serialized payload wouldn't include the field.Testing
ruff check,ruff format --check,mypy, andpytestall pass inblock-kit/(63 tests).