Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Jan 13, 2026

Summary

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

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

Testing

The following snippet shows a task_card block:

from slack_sdk.models.blocks import (
    PlanBlock,
    RichTextBlock,
    RichTextElementParts,
    RichTextSectionElement,
    TaskCardBlock,
    UrlSourceElement,
)
...
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"),
                        ],
                    ),
                ],
            ),
            sources=[
                UrlSourceElement(
                    text="An online encyclopedia",
                    url="https://wikipedia.org",
                ),
            ],
            output=RichTextBlock(
                elements=[
                    RichTextSectionElement(
                        elements=[
                            RichTextElementParts.Text(text="Good things once happened"),
                        ],
                    ),
                ],
            ),
        ),
    ],
)

And this one shows a plan block:

client.chat_postMessage(
    channel="C0123456789",
    blocks=[
        PlanBlock(
            plan_id="000",
            title="Thinking completed",
            tasks=[
                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"
                                    ),
                                ],
                            ),
                        ],
                    ),
                ),
                TaskCardBlock(
                    task_id="001",
                    title="Resting afterwards...",
                    status="complete",
                    details=RichTextBlock(
                        elements=[
                            RichTextSectionElement(
                                elements=[
                                    RichTextElementParts.Text(
                                        text="Sleeping with dreams well"
                                    ),
                                ],
                            ),
                        ],
                    ),
                ),
            ],
        ),
    ],
)

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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.96%. Comparing base (92c93e0) to head (bd9886c).
⚠️ Report is 1 commits behind head on zimeg-feat-ai-apps-chunks-streamer.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                          Coverage Diff                           @@
##           zimeg-feat-ai-apps-chunks-streamer    #1819      +/-   ##
======================================================================
+ Coverage                               83.93%   83.96%   +0.03%     
======================================================================
  Files                                     116      116              
  Lines                                   13192    13212      +20     
======================================================================
+ Hits                                    11073    11094      +21     
+ Misses                                   2119     2118       -1     

☔ 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