Skip to content

feat: add task_card and plan blocks - #1819

Merged
zimeg merged 20 commits into
feat-ai-apps-thinking-stepsfrom
zimeg-feat-ai-apps-task-card-block
Jan 16, 2026
Merged

feat: add task_card and plan blocks#1819
zimeg merged 20 commits into
feat-ai-apps-thinking-stepsfrom
zimeg-feat-ai-apps-task-card-block

Conversation

@zimeg

@zimegzimeg commented Jan 13, 2026

Copy link
Copy Markdown
Member

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:

fromslack_sdk.models.blocksimport (
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.

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

@zimegzimeg left a comment

Copy link
Copy Markdown
MemberAuthor

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!

Comment threadslack_sdk/models/blocks/blocks.py Outdated

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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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

codecovBot commented Jan 13, 2026

Copy link
Copy Markdown

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.

@zimegzimeg changed the title feat: add task_card blockfeat: add task_card and plan blocksJan 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 ownerJanuary 14, 2026 20:08

@WilliamBergaminWilliamBergamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice job!

@mwbrooksmwbrooks left a comment

Copy link
Copy Markdown
Member

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-stepsJanuary 16, 2026 23:25
@zimeg

Copy link
Copy Markdown
MemberAuthor

@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-stepsJan 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementM-T: A feature request for new functionalitysemver:minorVersion: 3x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@zimeg@mwbrooks@WilliamBergamin@srtaalej