| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Add a Python Block Kit example for the carousel block, mirroring the official docs example: a carousel of three cards, each with an icon, title, subtitle, hero image, body, and an action button. Includes a test asserting the produced block matches the expected payload, and a README bullet linking the reference and implementation. Ref: https://docs.slack.dev/reference/block-kit/blocks/carousel-block Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
CardBlock.icon and hero_image take Block Kit image element objects per the card block reference (type/image_url/alt_text), but slack_sdk types them as str | None, so ImageElement args trip mypy [arg-type]. Add # type: ignore[arg-type] on each, matching the card example. (slack_sdk typing bug — tracked separately.) Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Examples should not carry type-checker suppressions. Remove the # type: ignore[arg-type] added for 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.
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
| Back | FazBrowse Home | New Git URL |
Summary
Adds a Python Block Kit example for the carousel block, mirroring the official docs example.
example01() builds a carousel of three cards, each with an icon, title, subtitle, hero image, body, and an action button — matching the reference JSON exactly.
Docs: https://docs.slack.dev/reference/block-kit/blocks/carousel-block
Validation
Run in block-kit/ against the pinned slack_sdk==3.42.0 / pytest==9.1.1 / ruff==0.15.20:
Note: this is a sample app repo with no .changeset/, so no changeset was added.
Co-Authored-By: Claude svc-devxp-claude@slack-corp.com
🤖 Generated with Claude Code