Skip to content

feat(models): add AttachmentMention rich text element - #1948

Draft
zimeg wants to merge 3 commits into
mainfrom
attachment-mention-element
Draft

feat(models): add AttachmentMention rich text element#1948
zimeg wants to merge 3 commits into
mainfrom
attachment-mention-element

Conversation

@zimeg

@zimeg zimeg commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

Adds a typed RichTextElementParts.AttachmentMention builder for the attachment_mention rich text element — it renders as a rich app attachment or entity reference and is used within a rich_text block (inside a rich_text_section, rich_text_list, or rich_text_quote).

Fields mirror the reference docs field-for-field: required url, plus optional text, app_id, entity_id, icon_url, channel_id, ts, full_size_preview_enabled, icon_name, reference_object_type, product_name, and style.

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, asserting to_dict().

Both use assertDictEqual on .to_dict().

Related

Draft until this and the example land together.

Co-Authored-By: Claude svc-devxp-claude@slack-corp.com

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.08%. Comparing base (49101ef) to head (5af76e6).
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@zimeg
zimeg force-pushed the attachment-mention-element branch from 497a1b8 to 22b5df2 Compare August 28, 2026 03:44
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
zimeg force-pushed the attachment-mention-element branch from 22b5df2 to a720785 Compare August 28, 2026 03:49
@zimeg zimeg added enhancement M-T: A feature request for new functionality semver:minor Version: 3x labels Aug 28, 2026
@zimeg zimeg self-assigned this Aug 28, 2026
zimeg and others added 2 commits August 27, 2026 21:10
…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>
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.

1 participant