feat(models): add AttachmentMention rich text element - #1948
Draft
zimeg wants to merge 3 commits into
Draft
Conversation
zimeg
force-pushed
the
attachment-mention-element
branch
from
August 28, 2026 03:36
03dcfc6 to
497a1b8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1948 +/- ##
==========================================
+ Coverage 84.06% 84.08% +0.02%
==========================================
Files 118 118
Lines 13506 13526 +20
==========================================
+ Hits 11354 11374 +20
Misses 2152 2152 ☔ View full report in Codecov by Harness. |
zimeg
force-pushed
the
attachment-mention-element
branch
from
August 28, 2026 03:44
497a1b8 to
22b5df2
Compare
Add a typed `RichTextElementParts.AttachmentMention` builder for the `attachment_mention` rich text element, which renders as a rich app attachment or entity reference within a `rich_text` block. Fields follow the reference documentation: https://docs.slack.dev/reference/block-kit/block-elements/attachment-mention-element/ Adds `test_document` (the url-only payload shown in the docs) and `test_all_fields` (every optional field) asserting `to_dict()` output. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
zimeg
force-pushed
the
attachment-mention-element
branch
from
August 28, 2026 03:49
22b5df2 to
a720785
Compare
…elements Place the AttachmentMention test section as the first concrete-element section — right after the abstract base test classes (BlockElementTests, InteractiveElementTests), before ButtonElementTests — rather than buried mid-file. Deterministic anchor: insert after the last base/abstract test class, before the first concrete element section. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…n test The file banners head groups of related classes; standalone concrete classes (ButtonElementTests, LinkButtonElementTests, …) sit bare. A one-member "Rich text element parts" banner over-promised a group and named the SDK container rather than the element, so drop it — the class sits bare like its neighbors. A banner earns its place once the group has ≥2 members. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a typed
RichTextElementParts.AttachmentMentionbuilder for theattachment_mentionrich text element — it renders as a rich app attachment or entity reference and is used within arich_textblock (inside arich_text_section,rich_text_list, orrich_text_quote).Fields mirror the reference docs field-for-field: required
url, plus optionaltext,app_id,entity_id,icon_url,channel_id,ts,full_size_preview_enabled,icon_name,reference_object_type,product_name, andstyle.Testing
Adds two tests to
tests/slack_sdk/models/test_elements.py:test_document— asserts the url-only payload shown in the docs example emits exactly{"type": "attachment_mention", "url": "..."}.test_all_fields— every optional field set, assertingto_dict().Both use
assertDictEqualon.to_dict().Related
block-kit/src/block_elements/attachment_mention.pydemonstrating this builder. Its test intentionally goes red against the released SDK until this builder ships — the example asserts the expected released shape.Draft until this and the example land together.
Co-Authored-By: Claude svc-devxp-claude@slack-corp.com