feat(types): add data_visualization Block Kit block - #2637
Draft
zimeg wants to merge 5 commits into
Draft
Conversation
🦋 Changeset detectedLatest commit: 786019e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2637 +/- ##
=======================================
Coverage 89.12% 89.12%
=======================================
Files 65 65
Lines 10441 10441
Branches 482 481 -1
=======================================
Hits 9306 9306
Misses 1103 1103
Partials 32 32
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Add the DataVisualizationBlock type and its nested chart objects (pie/bar/area/line) to @slack/types, including a tsd type test mirroring the existing block tests. Ref: https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
zimeg
force-pushed
the
chore/block-kit-data-visualization
branch
from
September 8, 2026 21:27
029d0e6 to
a18c693
Compare
The rebase conflict resolution left the import on a single line that exceeds biome's line-length threshold, failing `biome check packages` in CI. Apply biome's own suggested multi-line format. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…visualization # Conflicts: # packages/types/src/block-kit/blocks.ts # packages/types/test/blocks.test-d.ts
…e chart union
The data_visualization block introduced seven exported companion types.
Match the TableBlock precedent (TableBlockColumnSettings is a non-exported
interface): export only DataVisualizationBlock and drop `export` from the
six helper interfaces (still named for readability, referenced via
{@link}). Inline the single-use DataVisualizationChart union directly on
`chart` and remove the alias. No behavior change; narrows the public API.
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…to docs Split the single DataVisualizationSeriesChart (type: 'bar' | 'area' | 'line') into three discriminated interfaces — DataVisualizationBarChart, DataVisualizationAreaChart, DataVisualizationLineChart — each carrying a literal type and the per-type prose the docs give (bar groups; filled areas layered in array order; lines). All three stay unexported and union into DataVisualizationBlock.chart alongside the pie chart. Rewrite every field @description to mirror the data-visualization block reference verbatim, which also corrects the segment/series caps from "maximum 6" to the documented "Min 1, max 12". Add an area-chart happy-path type test (bar and line were already covered). Co-Authored-By: Claude <svc-devxp-claude@slack-corp.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.
Summary
Adds the net-new
data_visualizationBlock Kit block to@slack/types.DataVisualizationBlockinterface (type: 'data_visualization', requiredtitle<=50 chars, requiredchart).DataVisualizationPieChart(segments[], 1-6) andDataVisualizationSeriesChart(bar/area/linewithseries[]1-6 +axis_config), unioned asDataVisualizationChart.DataVisualizationPieSegment,DataVisualizationSeries,DataVisualizationDataPoint,DataVisualizationAxisConfig.DataVisualizationBlockto theKnownBlockunion (alphabetical placement, afterContextActionsBlock).blocks.ts(interface extendingBlock, JSDoc with@description+@seedoc link, literaltypediscriminant).Docs
https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block
Validation
Run in
packages/types:npm run build— pass (tsc clean)npm run test:types(tsd) — pass; added happy/sad-path assertions intest/blocks.test-d.tsmirroring the existingCardBlock/AlertBlock/CarouselBlocktestsAdded a changeset (
@slack/typesminor).🤖 Generated with Claude Code