| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Add a Block Kit card block example mirroring the official docs example, constructed with the slack_sdk CardBlock type (icon, title, subtitle, hero image, body, and an action button). Includes a test asserting the produced block matches the expected JSON and a README bullet. Docs: https://docs.slack.dev/reference/block-kit/blocks/card-block Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Examples should not carry type-checker suppressions. Remove the # type: ignore[arg-type] on the ImageElement icon/hero_image args. Until slackapi/python-slack-sdk#1937 lands (widening CardBlock.icon / hero_image to accept an image element), mypy reports [arg-type] here by design — the honest signal that slack_sdk mis-types these fields as str. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
|
⚠️ mypy is intentionally red on this PR (icon/hero_image [arg-type]). The example builds icon/hero_image with ImageElement — the docs-correct image-element object (carries alt_text for accessibility). slack_sdk currently mis-types CardBlock.icon/hero_image as str | None, so mypy flags the object form. Rather than ship a # type: ignore in an example, the suppression was removed and the fix is upstream: → slackapi/python-slack-sdk#1937 widens those params to accept an image element. Once #1937 lands and releases, this PR's mypy step goes green with no code change here. Tracking so it's not merged/forgotten in the red state. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Adds a Block Kit card block example to the block-kit showcase, mirroring the official docs example. The example is constructed using the SDK-provided CardBlock type (imported from slack_sdk.models.blocks) with an icon, title, subtitle, hero image, body, and an action button.
Docs
https://docs.slack.dev/reference/block-kit/blocks/card-block
The example JSON mirrors the docs page (icon, title "Lumon Industries", subtitle, hero image, body, single action button).
Notes
Validation
Ran the repo's CI-equivalent checks for the block-kit showcase (Python 3.13, slack_sdk 3.42.0):
Co-Authored-By: Claude svc-devxp-claude@slack-corp.com
🤖 Generated with Claude Code