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?

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 40.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.87%. Comparing base (92c93e0) to head (8745c7b).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
slack_sdk/models/blocks/blocks.py 40.00% 12 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                           @@
##           zimeg-feat-ai-apps-chunks-streamer    #1819      +/-   ##
======================================================================
- Coverage                               83.93%   83.87%   -0.07%     
======================================================================
  Files                                     116      116              
  Lines                                   13192    13212      +20     
======================================================================
+ Hits                                    11073    11081       +8     
- Misses                                   2119     2131      +12     

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

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