Skip to content

feat(block-kit): add context actions block example#43

Draft
zimeg wants to merge 1 commit into
mainfrom
feat/block-kit-context-actions-example
Draft

feat(block-kit): add context actions block example#43
zimeg wants to merge 1 commit into
mainfrom
feat/block-kit-context-actions-example

Conversation

@zimeg

@zimeg zimeg commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

Adds a Context Actions block example to the block-kit showcase, mirroring the official Block Kit reference. The context_actions block displays interactive elements at the message level.

  • example01() — feedback buttons (thumbs up / down)
  • example02() — an icon button (delete)

Both examples construct the SDK-provided ContextActionsBlock via Blocks.contextActions(...), using FeedbackButtonsElement and IconButtonElement (imported from com.slack.api.model.block / ...block.element). No block types are redefined in this example repo.

Docs

https://docs.slack.dev/reference/block-kit/blocks/context-actions-block

Files

  • block-kit/src/main/java/blocks/ContextActions.java — the example
  • block-kit/src/test/java/blocks/ContextActionsTest.java — deep-equality tests against the expected JSON literal
  • block-kit/README.md — alphabetical entry with docs + implementation links

SDK dependency

The context_actions, feedback_buttons, and icon_button types are already present in the released slack-api-model:1.49.0 that this module pins, so no SDK bump is required — the build resolves and compiles against the existing dependency.

Validation

Run from block-kit/ (Maven, Java 17 target):

  • mvn --batch-mode test -Dspotless.apply.skipPASS (30 tests, 0 failures, including the 2 new ContextActionsTest cases)
  • mvn --batch-mode spotless:checkPASS (after spotless:apply formatting)

Co-Authored-By: Claude svc-devxp-claude@slack-corp.com

Add a Context Actions block example mirroring the official Block Kit
docs, demonstrating feedback buttons (example01) and an icon button
(example02), with a matching deep-equality test and README entry.

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