Repository navigation
feat: add the Slack data_table block - #241
Merged
Merged
Conversation
Adds Slack's Block Kit `data_table` block, the paginated, sortable sibling of `table`, per ENG-6351 and the Slack docs: https://docs.slack.dev/reference/block-kit/blocks/data-table-block - types: DataTableBlock, DataTableCell, DataTableRawNumberCell and DataTableActionCell (names match slack-web-api-client#110), added to the SupportedBlock / SupportedBlockType unions and exported. The raw text cell is now a named TableRawTextCell, shared with `table`. - palette: a "Data table" variant in the Table section, built from Slack's documented example. No action_cell column, since validator 0.1.18 rejects action cells. - editor: DataTableEditor edits the caption, rows per page (1-100), the row header column (kept on the same column as columns are removed), and the cell grid. The header row can't be removed, so a data row with rich text never becomes the header. Data cells toggle between raw_text and raw_number (value plus optional display text). rich_text cells are kept until typed over, and action_cell cells are shown read-only and kept as-is. Add row stops at 201 rows, add column at 20. - shared: the table editor's grid moves into CellGrid / CellTextInput, and the data visualization editor's NumberInput into its own module, so both table editors share them. The table editor's behavior is unchanged. - labels, dispatch, stories (with play functions) and unit tests; the surface test now covers data_table on App Home and modals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
block-kitchen | 0141743 | Commit Preview URL Branch Preview URL |
Oct 13 2026, 03:57 PM |
It renders two ~200-row grids, which took 7.5s on the Node 22 runner against vitest's 5s default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bumps slack-blocks-to-jsx ^1.1.2 -> ^1.2.0, the first release with the data_table renderer, and adds a DataTable preview story whose play test pages and sorts the rendered table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Cloudflare preview✅ Deployed |
… 0.1.19 Bumps the validator ^0.1.18 -> ^0.1.19, which accepts action_cell cells and up to 200 data rows, and tests both on message and home. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Part of ENG-6351
Support the Slack
data_tableblock in slack-web-api-client, slack-blocks-to-jsx (and downstream)Note
Dependencies bumped:
slack-blocks-to-jsx^1.2.0 (first release that rendersdata_table, themashcodee/slack-blocks-to-jsx#124) and@tightknitai/slack-block-kit-validator^0.1.19 (acceptsaction_cellcells and up to 200 data rows, TightknitAI/slack-block-kit-validator#114).slack-web-api-clientstays at 1.1.14: block-kitchen declares its own data_table types, so slack-edge/slack-web-api-client#110 isn't needed here.Summary
Adds Slack's
data_tableblock, the paginated, sortable sibling oftable, to the builder: types, a palette preset, and an editor. It mirrors how #115 addedcontainer.DataTableBlock,DataTableCell,DataTableRawNumberCellandDataTableActionCell, named to match Add support for the data_table block slack-edge/slack-web-api-client#110 and declared locally becauseslack-web-api-client1.1.14 doesn't have them. They're added to theSupportedBlock/SupportedBlockTypeunions and exported. The raw text cell is now a namedTableRawTextCell, shared withtable, as upstream does.raw_textandrich_textcells). It has noaction_cellcolumn, matching Slack's example. The palette-validates test covers the new preset.DataTableEditor):page_size, so Slack uses its default of 5.row_header_column_index. Removing a column keeps the index on the same column, or resets it to the default when that column is the one removed.#toggle turns a data cell betweenraw_textandraw_number. A number cell edits itsvalueplus optional displaytext. Turning"1,200"into a number givesvalue: 1200and keeps"1,200"as the display text. Text that isn't a number becomes the display text over a0, so nothing typed is lost.rich_textcells are kept until typed over, like the table editor.action_cellcells show their button label read-only and are kept as-is (edit them via View JSON).CellGrid/CellTextInput(editors/cell-grid.tsx), and the data visualization editor'sNumberInputintoeditors/number-input.tsx, so neither is duplicated. The table editor's behavior is unchanged. Its inputs gainRow N, column Maccessible names, which they had none of before.data_tableon messages and App Home and rejects it in modals;test/surface-compatibility.test.tsnow covers it.Why
Slack added
data_tablefor rich tables with pagination, sorting, numeric cells and button cells. ENG-6351 brings it to every layer of the stack. Here, that means users can drop one into a message or Home tab and edit it without hand-writing JSON.Test plan
pnpm typecheckpnpm lintpnpm test: 705 tests, unit and Storybook, all passingpnpm run build:clean,pnpm run demo:build,pnpm run build-storybook, andpnpm audit --audit-level=high(root and demo)slack-blocks-to-jsxbumped to ^1.2.0. Before the release, spot-checked in the demo against a local build of slack-blocks-to-jsx#124 (swapped in for screenshots only, then reverted). The preset renders, araw_numbercolumn sorts numerically,page_sizepaginates, and action cells render as buttons.New tests:
test/data-table-editor.test.tsx:test/table-editor.test.tsx: guards the grid refactor. Column add and remove keepcolumn_settingsaligned, alignment still sets, the first row is still removable, and the 100-row cap holds.DataTable,DataTableNumbersAndButtons, aSlackBlockPreview/DataTablepreview whose play test pages and sorts the rendered table, and two editor play tests: toggling a cell to a number, and adding and filling a row. Both assert the result validates.Screenshots
Captured; waiting to be uploaded.
Notes for reviewer
updateArgsmerges arrays element by element, so a removed row, or a key dropped from a cell, would come back. The data table stories keep the block in local state instead.action_cellcells from the editor (only kept and shown). That can follow once validator 0.1.19 ships. The 20,000-character table limit is left to the validator.#toggle, not changed here: the unlayered.bk-root * { border-color }reset instyles.src.cssbeats the layeredborder-*color utilities, so classes likeborder-transparentandborder-primaryhave no effect anywhere in the package. The toggle uses background color only.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.