Skip to content

feat(types): add data_visualization Block Kit block - #2637

Draft
zimeg wants to merge 5 commits into
mainfrom
chore/block-kit-data-visualization
Draft

feat(types): add data_visualization Block Kit block#2637
zimeg wants to merge 5 commits into
mainfrom
chore/block-kit-data-visualization

Conversation

@zimeg

@zimeg zimeg commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds the net-new data_visualization Block Kit block to @slack/types.

  • New DataVisualizationBlock interface (type: 'data_visualization', required title <=50 chars, required chart).
  • Nested chart types: DataVisualizationPieChart (segments[], 1-6) and DataVisualizationSeriesChart (bar/area/line with series[] 1-6 + axis_config), unioned as DataVisualizationChart.
  • Supporting object types: DataVisualizationPieSegment, DataVisualizationSeries, DataVisualizationDataPoint, DataVisualizationAxisConfig.
  • Added DataVisualizationBlock to the KnownBlock union (alphabetical placement, after ContextActionsBlock).
  • Follows existing conventions in blocks.ts (interface extending Block, JSDoc with @description + @see doc link, literal type discriminant).

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 in test/blocks.test-d.ts mirroring the existing CardBlock/AlertBlock/CarouselBlock tests
  • biome lint/format (pre-commit hook) — pass

Added a changeset (@slack/types minor).

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 786019e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@slack/types Minor

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

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.12%. Comparing base (abf184e) to head (786019e).
✅ All tests successful. No failed tests found.

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           
Flag Coverage Δ
cli-hooks 89.12% <ø> (ø)
cli-test 89.12% <ø> (ø)
logger 89.12% <ø> (ø)
oauth 89.12% <ø> (ø)
socket-mode 89.12% <ø> (ø)
web-api 89.12% <ø> (ø)
webhook 89.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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
zimeg force-pushed the chore/block-kit-data-visualization branch from 029d0e6 to a18c693 Compare September 8, 2026 21:27
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>
@zimeg zimeg added semver:minor enhancement M-T: A feature request for new functionality pkg:types applies to `@slack/types` labels Sep 9, 2026
@zimeg zimeg self-assigned this Sep 9, 2026
zimeg and others added 3 commits September 9, 2026 16:21
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality pkg:types applies to `@slack/types` semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant