Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Jan 13, 2026

Summary

This PR adds the task_card block for usage in standalone messages.

⚠️ This is experimental and requires a toggle to preview!

Testing

from slack_sdk.models.blocks import (
    RichTextBlock,
    RichTextElementParts,
    RichTextSectionElement,
    TaskCardBlock,
)
...
client.chat_postMessage(
    channel="C0123456789",
    blocks=[
        TaskCardBlock(
            task_id="000",
            title="Living life well...",
            status="error",
            details=RichTextBlock(
                elements=[
                    RichTextSectionElement(
                        elements=[
                            RichTextElementParts.Text(text="Dreamt of touching grass"),
                        ],
                    ),
                ],
            ),
            output=RichTextBlock(
                elements=[
                    RichTextSectionElement(
                        elements=[
                            RichTextElementParts.Text(text="Good things once happened"),
                        ],
                    ),
                ],
            ),
        ),
    ],
)

Category

  • slack_sdk.models (UI component builders)
  • /docs (Documents)
  • tests/integration_tests (Automated tests for this library)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

@zimeg zimeg self-assigned this Jan 13, 2026
@zimeg zimeg added enhancement M-T: A feature request for new functionality semver:minor Version: 3x labels Jan 13, 2026
Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📣 Leaving a quick note of thoughts occurred in development!


from slack_sdk.models import show_unknown_key_warning
from slack_sdk.models.basic_objects import JsonObject, JsonValidator
from slack_sdk.models.messages.chunk import URLSource
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 thought: This is introduced in #1806 but I'm not certain if it's best kept with the "messages" model or if it should be included as a block element?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗣️ note: In 6073ffe it's moved to the block elements - the url source can be used in standalone messages as well as in chunks.

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 56.52174% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.81%. Comparing base (92c93e0) to head (7a61bbf).
⚠️ Report is 1 commits behind head on zimeg-feat-ai-apps-chunks-streamer.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
slack_sdk/models/blocks/blocks.py 37.50% 20 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                           @@
##           zimeg-feat-ai-apps-chunks-streamer    #1819      +/-   ##
======================================================================
- Coverage                               83.93%   83.81%   -0.12%     
======================================================================
  Files                                     116      116              
  Lines                                   13192    13212      +20     
======================================================================
+ Hits                                    11073    11074       +1     
- Misses                                   2119     2138      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zimeg zimeg changed the title feat: add task_card block feat: add task_card and plan blocks Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality semver:minor Version: 3x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants