Skip to content

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

Closed
zimeg wants to merge 2 commits into
mainfrom
mrkdwn-option-description
Closed

zimeg wants to merge 2 commits 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: PlainTextElement → PlainTextElement | 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: 44669cf

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.28%. Comparing base (03e2724) to head (44669cf).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2742      +/-   ##
==========================================
- Coverage   89.35%   89.28%   -0.08%     
==========================================
  Files          65       65              
  Lines       10562    10562              
  Branches      489      489              
==========================================
- Hits         9438     9430       -8     
- Misses       1092     1100       +8     
  Partials       32       32              
Flag Coverage Δ
cli-hooks 89.21% <ø> (ø)
cli-test 89.21% <ø> (ø)
logger 89.21% <ø> (ø)
oauth 89.21% <ø> (ø)
socket-mode 89.21% <ø> (ø)
web-api 89.21% <ø> (ø)
webhook 89.21% <ø> (ø)

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.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@zimeg

zimeg commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

🧹 Closing in favor of #2825, which also allows a plain_text option text with a mrkdwn description, as the checkboxes docs payload uses. It closes #1765 now.

@zimeg zimeg closed this Nov 6, 2026
@zimeg
zimeg deleted the mrkdwn-option-description branch November 6, 2026 01:01
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