Skip to content

feat(block-kit): add data table block example - #82

Draft
zimeg wants to merge 6 commits into
mainfrom
feat-block-kit-data-table
Draft

feat(block-kit): add data table block example#82
zimeg wants to merge 6 commits into
mainfrom
feat-block-kit-data-table

Conversation

@zimeg

@zimeg zimeg commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

This pull request adds a data_table block example to the Block Kit examples.

  • blocks/DataTable.java — a data_table block via the Blocks.dataTable(...) DSL, pairing raw_text label cells with raw_number value cells (cells may also be rich_text).
  • blocks/DataTableTest.java — a serialization round-trip test asserting the expected JSON, matching the pattern of the sibling block examples.
  • block-kit/README.md — a "Data table" entry, alphabetically between Context and Divider.

Depends on the SDK: DataTableBlock / TableCell / RawTextObject / RawNumberObject are added in slackapi/java-slack-sdk#1613 and are not yet in a published slack-api-model release. The block-kit module pins the published version (1.51.0), so this example compiles once #1613 lands and releases. Verified locally against a 1.51.1-SNAPSHOT build of the #1613 branch (all block-kit tests pass, including DataTableTest).

Draft until the SDK support is released.

Testing

  • Build the #1613 branch of java-slack-sdk and install slack-api-model + slack-api-client to your local ~/.m2 (they build as 1.51.1-SNAPSHOT).
  • Temporarily bump the two com.slack.api versions in block-kit/pom.xml to 1.51.1-SNAPSHOT.
  • From block-kit/, run mvn test — the module compiles the DataTable example and DataTableTest passes (round-trips the block to the expected data_table JSON).
  • Revert the pom.xml version bump before merging (keep the published version).

Add a DataTable block-kit example (blocks/DataTable.java) demonstrating a
data_table block with raw_text, raw_number, and rich_text-capable cells,
plus a DataTableTest round-trip test and a README entry.

Depends on the DataTableBlock / TableCell model added in
slackapi/java-slack-sdk#1613 (not yet released); the block-kit module
pins the published slack-api-model, so this compiles once that lands.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg self-assigned this Sep 9, 2026
@zimeg zimeg added enhancement New feature or request update PR only - an update or maintenance is being made to an existing app java Pull requests that update java code labels Sep 9, 2026
zimeg and others added 5 commits September 8, 2026 20:51
The initial example was an invented Widgets/Gadgets table. Replace it
with the docs reference example verbatim — the Name/Department/Badge
table with raw_text cells and rich_text badge cells (Blue bold, Green +
italic review, Limited bold) — matching how the sibling examples mirror
docs.slack.dev. Expand the test's expected JSON one field per line with
full rich_text style objects, matching RichTextTest.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…Text

Use the BlockCompositions.rawText(...) helper for the raw_text cells
instead of RawTextObject.builder(), per the block-kit AGENTS.md guidance
to build composition objects through BlockCompositions.* rather than raw
builders. Depends on the rawText/rawNumber helpers added in
slackapi/java-slack-sdk#1613.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Use the node @slack/types data_table example (slackapi/node-slack-sdk#2638)
— caption "A list of fruit and their quantities", a Fruit/Quantity header
with an Apples/raw_number(12) data row — so the SDKs demonstrate the same
payload. This also exercises the raw_number cell (and BlockCompositions.
rawNumber), which the prior docs-derived example did not.

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

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👻 More writings for the readers!

"type": "text",
"text": "Blue",
"style": {
"bold": true,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💰 note: The java SDK serializes this with false values too which is expected and ignored from API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java Pull requests that update java code update PR only - an update or maintenance is being made to an existing app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant