Skip to content

feat(block-kit): add composition object examples - #228

Draft
zimeg wants to merge 2 commits into
mainfrom
composition-object-examples
Draft

feat(block-kit): add composition object examples#228
zimeg wants to merge 2 commits into
mainfrom
composition-object-examples

Conversation

@zimeg

@zimeg zimeg commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

Adds example projects for the Block Kit composition objects documented at docs.slack.dev. Composition objects never appear on their own, so each example reproduces the object's full reference payload hosted inside a valid block, element, or view — exactly as the docs page shows it. Every example ships a test asserting the complete serialized JSON.

Mirrors the conventions of the block element examples PR (#227): one exampleNN() per docs reference payload under src/composition_objects/, matched by a test under tests/composition_objects/ comparing to_dict() against the complete expected object.

Coverage

Composition object Examples Notes
Text 1 mrkdwn text hosted in a section
Option 2 the single option object, and options in a select menu
Option group 1 option groups in a select menu
Confirmation dialog 1 a button's confirm dialog
Dispatch action configuration 1 on a multiline plain-text input
Conversation filter 1 a conversations select filter in a modal view
Slack file 2 image block by file URL, and by file ID
Trigger 1 a workflow button trigger
Workflow 1 a workflow button workflow

slack_icon is documented but has no standalone reference payload (it is a sub-object of the card block, which the SDK does not yet expose), so it is not exemplified here.

Checks

Run from block-kit/, matching the pytest@python3.14 CI job:

  • ruff check — passed
  • ruff format --diff --check — passed (57 files)
  • mypy . — passed (56 source files)
  • pytest — 45 passed

Add example projects for the Block Kit composition objects documented on
docs.slack.dev, each demonstrating the full reference payload for its object
hosted inside a valid block, element, or view. Every example ships a test that
asserts the complete serialized JSON.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg self-assigned this Aug 28, 2026
Rewrite each existing example test's `expected` reference payload so every nested dict is exploded one key:value per line with a magic trailing comma, mirroring the docs' vertical layout and keeping ruff format from re-collapsing short dicts. Values stay native `dict`/`list` literals and the `json.dumps(..., sort_keys=True)` comparison is unchanged.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.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.

1 participant