Skip to content

feat(types): allow mrkdwn descriptions on checkbox and radio button options - #2742

Draft
zimeg wants to merge 1 commit into
mainfrom
mrkdwn-option-description
Draft

feat(types): allow mrkdwn descriptions on checkbox and radio button options#2742
zimeg wants to merge 1 commit into
mainfrom
mrkdwn-option-description

Conversation

@zimeg

@zimeg zimeg commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

OptionDescriptor.description was typed PlainTextElement, so a checkbox or radio button option could not carry a mrkdwn description — even though the option-object docs allow mrkdwn descriptions for those two element types.

Closes #1765.

What changed

  • OptionDescriptor.description: PlainTextElementPlainTextElement | MrkdwnElement, so checkbox group and radio button group options (MrkdwnOption) can use a mrkdwn description.
  • PlainTextOption.description: narrowed back to PlainTextElement — overflow, select, and multi-select options remain plain_text-only, matching the docs.
  • Updated the @description JSDoc on both to reflect the plain-vs-mrkdwn split.
  • Added tsd type tests in composition-objects.test-d.ts covering both branches (a MrkdwnOption accepts either description type; a PlainTextOption rejects a mrkdwn description).
  • Changeset: @slack/types minor.

Testing

npm run --workspace=packages/types test (build + tsd) passes; verified the new assertions fail if the widening is reverted. Biome clean.

🤖 Generated with Claude Code

…ptions

`OptionDescriptor.description` was typed `PlainTextElement`, so a checkbox
or radio button option could not carry a `mrkdwn` description even though
the option-object docs allow it for those two element types.

Widen the base `description` to `PlainTextElement | MrkdwnElement` and
narrow it back to `PlainTextElement` on `PlainTextOption` (overflow,
select, and multi-select options remain plain_text-only). Add tsd type
tests covering both branches.

Ref: https://docs.slack.dev/reference/block-kit/composition-objects/option-object

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

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 964f37b

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

@zimeg zimeg added pkg:types applies to `@slack/types` enhancement M-T: A feature request for new functionality semver:minor area:typescript issues that specifically impact using the package from typescript projects labels Sep 10, 2026
@zimeg zimeg self-assigned this Sep 10, 2026
@zimeg zimeg added this to the types@3.x milestone Sep 10, 2026
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.12%. Comparing base (d420d00) to head (964f37b).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2742   +/-   ##
=======================================
  Coverage   89.12%   89.12%           
=======================================
  Files          65       65           
  Lines       10441    10441           
  Branches      482      482           
=======================================
  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.

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

Labels

area:typescript issues that specifically impact using the package from typescript projects 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.

Document inconsistency: checkboxes block element's description can have both plain_text and mrkdwn

1 participant