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.
⚠️ Please upload report for BASE (feat-ai-apps-thinking-steps@f4c0182). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                      Coverage Diff                       @@
##             feat-ai-apps-thinking-steps    #1819   +/-   ##
==============================================================
  Coverage                               ?   83.96%           
==============================================================
  Files                                  ?      116           
  Lines                                  ?    13212           
  Branches                               ?        0           
==============================================================
  Hits                                   ?    11094           
  Misses                                 ?     2118           
  Partials                               ?        0           

☔ 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
@zimeg zimeg marked this pull request as ready for review January 14, 2026 20:08
@zimeg zimeg requested a review from a team as a code owner January 14, 2026 20:08
Copy link
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

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

Nice job!

Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

✅ Nice, thanks for adding the task_card and plan block.

🧪 Manually testing works well for both. Thanks for the example code!

Base automatically changed from zimeg-feat-ai-apps-chunks-streamer to feat-ai-apps-thinking-steps January 16, 2026 23:25
@zimeg
Copy link
Member Author

zimeg commented Jan 16, 2026

@srtaalej @WilliamBergamin @mwbrooks Woo! I was getting caught up on merging base branches but once these tests are passing let's merge this! 🚢 💨

Some follow up remains for these blocks: icon_url ought not exist for URL sources. This is noted here and elsewhere so let's save it for another PR.

@zimeg zimeg merged commit b031148 into feat-ai-apps-thinking-steps Jan 16, 2026
16 checks passed
@zimeg zimeg deleted the zimeg-feat-ai-apps-task-card-block branch January 16, 2026 23:50
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.

5 participants