Skip to content

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

Draft
zimeg wants to merge 1 commit into
mainfrom
composition-object-examples
Draft

feat(block-kit): add composition object examples#70
zimeg wants to merge 1 commit into
mainfrom
composition-object-examples

Conversation

@zimeg

@zimeg zimeg commented Aug 28, 2026

Copy link
Copy Markdown
Member

Adds composition object examples to the block-kit showcase, the third Block Kit category after blocks and block elements. Mirrors the block element examples: one exampleNN() per documented reference payload, each returning the full host block or view so the reference JSON round-trips verbatim, with tests asserting the complete serialized payload via GsonFactory.createSnakeCase().

What's on display

Composition object Payloads Implementation
Text 1 (section host) compositionobjects/Text.java
Option 2 (bare option, static select host) compositionobjects/Option.java
Option group 1 (static select host) compositionobjects/OptionGroup.java
Confirmation dialog 1 (button host) compositionobjects/ConfirmationDialog.java
Dispatch action configuration 1 (plain-text input host) compositionobjects/DispatchActionConfiguration.java
Conversation filter 1 (modal view host) compositionobjects/ConversationFilter.java
Slack file 2 (image block by url, by id) compositionobjects/SlackFile.java
Trigger 1 (workflow button host) compositionobjects/Trigger.java
Workflow 1 (workflow button host) compositionobjects/Workflow.java

Every reference payload documented on each page becomes one exampleNN(), and each test asserts the full hosted payload exactly as the docs page shows it. Input-block examples additionally assert the SDK's default-emitted fields (for example optional: false), matching the existing blocks/InputTest convention in this repo.

Deferred

  • Slack icon — this object is a sub-object of the card block, and the card block is not implemented in the Slack Java SDK's com.slack.api.model.block package. Its docs page ships no standalone JSON example, so there is no reference payload to reproduce. Deferred until the card block lands in the SDK.

Testing

Ran the CI gate locally from block-kit/ exactly as .github/workflows/test.yml defines:

  • mvn --batch-mode spotless:check — passes
  • mvn --batch-mode test -Dspotless.apply.skip — passes (39 tests, 0 failures)

Add composition object examples to the block-kit showcase, mirroring the
block element examples: one exampleNN() per documented reference payload,
each returning the full host block/view so the reference JSON round-trips
verbatim, with tests asserting the complete serialized payload.

Ships 9 of the 10 documented composition objects (text, option,
option-group, confirmation-dialog, dispatch-action-configuration,
conversation-filter, slack-file, trigger, workflow). The slack-icon object
is deferred: it is a card-block sub-object and the card block is absent from
the SDK, so no example payload can be produced.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg self-assigned this Aug 28, 2026
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