feat(block-kit): add data table block example - #82
Draft
zimeg wants to merge 6 commits into
Draft
Conversation
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>
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>
…de SDK" This reverts commit 91e8c16.
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
zimeg
commented
Sep 9, 2026
zimeg
left a comment
Member
Author
There was a problem hiding this comment.
👻 More writings for the readers!
| "type": "text", | ||
| "text": "Blue", | ||
| "style": { | ||
| "bold": true, |
Member
Author
There was a problem hiding this comment.
💰 note: The java SDK serializes this with false values too which is expected and ignored from API.
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
This pull request adds a
data_tableblock example to the Block Kit examples.blocks/DataTable.java— adata_tableblock via theBlocks.dataTable(...)DSL, pairingraw_textlabel cells withraw_numbervalue cells (cells may also berich_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/RawNumberObjectare added in slackapi/java-slack-sdk#1613 and are not yet in a publishedslack-api-modelrelease. Theblock-kitmodule pins the published version (1.51.0), so this example compiles once #1613 lands and releases. Verified locally against a1.51.1-SNAPSHOTbuild of the #1613 branch (all block-kit tests pass, includingDataTableTest).Draft until the SDK support is released.
Testing
java-slack-sdkandinstallslack-api-model+slack-api-clientto your local~/.m2(they build as1.51.1-SNAPSHOT).com.slack.apiversions inblock-kit/pom.xmlto1.51.1-SNAPSHOT.block-kit/, runmvn test— the module compiles theDataTableexample andDataTableTestpasses (round-trips the block to the expecteddata_tableJSON).pom.xmlversion bump before merging (keep the published version).