feat(types): allow mrkdwn descriptions on checkbox and radio button options - #2742
Draft
zimeg wants to merge 1 commit into
Draft
feat(types): allow mrkdwn descriptions on checkbox and radio button options#2742zimeg wants to merge 1 commit into
zimeg wants to merge 1 commit into
Conversation
…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 detectedLatest commit: 964f37b 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 #2742 +/- ##
=======================================
Coverage 89.12% 89.12%
=======================================
Files 65 65
Lines 10441 10441
Branches 482 482
=======================================
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:
|
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
OptionDescriptor.descriptionwas typedPlainTextElement, so a checkbox or radio button option could not carry amrkdwndescription — even though the option-object docs allowmrkdwndescriptions 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 amrkdwndescription.PlainTextOption.description: narrowed back toPlainTextElement— overflow, select, and multi-select options remainplain_text-only, matching the docs.@descriptionJSDoc on both to reflect the plain-vs-mrkdwn split.tsdtype tests incomposition-objects.test-d.tscovering both branches (aMrkdwnOptionaccepts either description type; aPlainTextOptionrejects amrkdwndescription).@slack/typesminor.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