Skip to content

Initial draft for MM Blocks#1508

Open
larkox wants to merge 4 commits into
masterfrom
interactiveMessages
Open

Initial draft for MM Blocks#1508
larkox wants to merge 4 commits into
masterfrom
interactiveMessages

Conversation

@larkox
Copy link
Copy Markdown
Contributor

@larkox larkox commented Jun 6, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 6, 2026

Newest code from mattermost has been published to preview environment for Git SHA 8a38941

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 6, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 151fd079-cb92-42d9-856f-ab37c5a33d9f

📥 Commits

Reviewing files that changed from the base of the PR and between 3932294 and be582f8.

📒 Files selected for processing (1)
  • site/content/integrate/slash-commands/custom/_index.md
✅ Files skipped from review due to trivial changes (1)
  • site/content/integrate/slash-commands/custom/_index.md

📝 Walkthrough

Walkthrough

This pull request introduces MM Blocks as the primary framework for interactive content in Mattermost integrations. It adds comprehensive reference documentation, updates integration guides to recommend MM Blocks over legacy attachments, and clarifies the relationships between MM Blocks, markdown actions, and legacy formats.

Changes

MM Blocks Integration Framework Documentation

Layer / File(s) Summary
MM Blocks Core Reference Documentation
site/content/integrate/reference/mm-blocks/_index.md
New comprehensive reference defining the MM Blocks feature with data structure (props.mm_blocks and props.mm_blocks_actions), supported block types, action registry schema with external and openURL action types, end-to-end action dispatch flow, HTTP POST callback payload shapes for action responses, legacy format compatibility (attachments, blocks, cards translation), validation limits for action IDs and context, security considerations, and cross-references.
Interactive Messages Overview and MM Blocks Guidance
site/content/integrate/plugins/interactive-messages/_index.md
Updates the page description to explicitly enumerate MM Blocks, markdown action buttons, and legacy message attachments. Adds "MM Blocks (recommended)" guidance using props.mm_blocks / props.mm_blocks_actions. Rewrites "Markdown action buttons" and "Legacy message attachment buttons and menus" sections to clarify relationships and direct new integrations to MM Blocks. Updates error message wording to "below the interactive content" and adds FAQ guidance to include updated mm_blocks and mm_blocks_actions in update.props.
Markdown Actions Reference Framework Integration
site/content/integrate/reference/markdown-actions/_index.md
Repositions markdown action buttons within the Interactive Messages framework and ties them to the shared mm_blocks_actions registry. Expands mmaction:// action ID character set to [A-Za-z0-9_-]+. Updates callbacks to reference the MM Blocks PostActionIntegrationRequest shape and refreshes security/see-also entries.
Legacy Attachments and MM Blocks Migration Path
site/content/integrate/reference/message-attachments/_index.md, site/content/integrate/faq/_index.md
Adds a "Legacy interactive content" note recommending MM Blocks over legacy attachment actions while clarifying legacy attachments remain supported via runtime translation. Updates FAQ guidance and API instructions to prefer props.mm_blocks and props.mm_blocks_actions for new interactive content alongside existing attachments usage.
Webhook and Slash Command MM Blocks Support
site/content/integrate/webhooks/outgoing/_index.md, site/content/integrate/webhooks/incoming/_index.md, site/content/integrate/slash-commands/custom/_index.md
Expands props parameter descriptions in webhook and slash command docs to include reserved key names and instructions for props.mm_blocks and props.mm_blocks_actions. Updates "advanced formatting" text to explicitly mention MM Blocks as an option.

Sequence Diagram(s)

(omitted — changes are documentation-only and the sequence conditions are not met)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Initial draft for MM Blocks' directly relates to the changeset, which adds comprehensive documentation for the MM Blocks feature across multiple integration documentation pages.
Description check ✅ Passed The description is directly related to the changeset, explaining that this PR adds documentation for the MM Blocks feature with references to technical and design specifications, related PRs, and the associated ticket.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch interactiveMessages

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
site/content/integrate/reference/markdown-actions/_index.md (1)

215-220: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the security bullet to match the new action ID charset.

This section still says action IDs are “alphanumeric strings”, but this page now documents [A-Za-z0-9_-]+. Please align the wording to avoid conflicting guidance.

Suggested doc fix
-- Action IDs are validated as alphanumeric strings and matched case-sensitively.
+- Action IDs are validated against `[A-Za-z0-9_-]+` and matched case-sensitively.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@site/content/integrate/reference/markdown-actions/_index.md` around lines 215
- 220, The security bullet that currently says Action IDs are “alphanumeric
strings” is out of date; change the wording for the Action ID bullet (the line
describing action ID validation) to state the new allowed charset (e.g. "Action
IDs must match the pattern [A-Za-z0-9_-]+ — alphanumerics, underscore and hyphen
— and are matched case-sensitively") so the documentation for Action IDs and
their validation matches the current behavior.
site/content/integrate/slash-commands/custom/_index.md (1)

104-104: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Complete the slash-command props contract for MM Blocks.

This row still omits the explicit MM Blocks keys, which now creates inconsistency with the incoming/outgoing webhook parameter docs and the cohort objective for response props coverage.

Suggested doc fix
-| `props`              | Sets the post `props`, a JSON property bag for storing extra or meta data on the post. Mainly used by other integrations accessing posts through the {{< newtabref title="REST API" href="https://api.mattermost.com" >}}.<br/>The following keys are reserved: `from_webhook`, `override_username`, `override_icon_url` and `attachments`.          | No                               |
+| `props`              | Sets the post `props`, a JSON property bag for storing extra or meta data on the post. Mainly used by other integrations accessing posts through the {{< newtabref title="REST API" href="https://api.mattermost.com" >}}.<br/>The following keys are reserved: `from_webhook`, `override_username`, `override_icon_url` and `attachments`.<br/>Use `props.mm_blocks` and `props.mm_blocks_actions` for [MM Blocks]({{< ref "/integrate/reference/mm-blocks" >}}) interactive content.          | No                               |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@site/content/integrate/slash-commands/custom/_index.md` at line 104, The
props row for the slash-command docs omits explicit MM Blocks keys; update the
`props` description to enumerate the reserved MM Blocks-related keys (in
addition to the already-listed `from_webhook`, `override_username`,
`override_icon_url`, `attachments`), briefly describe each key's purpose/format
(e.g., the key that carries block payloads and any block-action/context
identifiers), and make the wording consistent with the incoming/outgoing webhook
parameter docs and the response `props` coverage. Locate the `props` table row
(the cell that currently starts "Sets the post `props`") and expand its content
to list the MM Blocks keys and short definitions so the contract is explicit and
aligned with webhook docs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@site/content/integrate/reference/mm-blocks/_index.md`:
- Line 265: The table row for the `options` field uses the phrase "depends" in
the Required column; change that wording to "depends on" so the entry reads:
`Array of {text, value} pairs. Required unless data_source is set.` Update the
text associated with the `options` field (the string shown in the table) to
replace "depends" with "depends on" so the schema wording is accurate and
consistent.
- Line 446: The doc line uses incorrect casing `update.Props`; change it to
`update.props` so it matches the rest of the examples and the response contract;
update the occurrence in the text (reference to `update.Props`) to
`update.props` in the mm-blocks reference content to ensure consistent casing
across examples and semantics.

---

Outside diff comments:
In `@site/content/integrate/reference/markdown-actions/_index.md`:
- Around line 215-220: The security bullet that currently says Action IDs are
“alphanumeric strings” is out of date; change the wording for the Action ID
bullet (the line describing action ID validation) to state the new allowed
charset (e.g. "Action IDs must match the pattern [A-Za-z0-9_-]+ — alphanumerics,
underscore and hyphen — and are matched case-sensitively") so the documentation
for Action IDs and their validation matches the current behavior.

In `@site/content/integrate/slash-commands/custom/_index.md`:
- Line 104: The props row for the slash-command docs omits explicit MM Blocks
keys; update the `props` description to enumerate the reserved MM Blocks-related
keys (in addition to the already-listed `from_webhook`, `override_username`,
`override_icon_url`, `attachments`), briefly describe each key's purpose/format
(e.g., the key that carries block payloads and any block-action/context
identifiers), and make the wording consistent with the incoming/outgoing webhook
parameter docs and the response `props` coverage. Locate the `props` table row
(the cell that currently starts "Sets the post `props`") and expand its content
to list the MM Blocks keys and short definitions so the contract is explicit and
aligned with webhook docs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a96b0d41-5231-415e-a57b-19fcc9703993

📥 Commits

Reviewing files that changed from the base of the PR and between 1ce44f1 and 8a38941.

📒 Files selected for processing (8)
  • site/content/integrate/faq/_index.md
  • site/content/integrate/plugins/interactive-messages/_index.md
  • site/content/integrate/reference/markdown-actions/_index.md
  • site/content/integrate/reference/message-attachments/_index.md
  • site/content/integrate/reference/mm-blocks/_index.md
  • site/content/integrate/slash-commands/custom/_index.md
  • site/content/integrate/webhooks/incoming/_index.md
  • site/content/integrate/webhooks/outgoing/_index.md

Comment thread site/content/integrate/reference/mm-blocks/_index.md Outdated
Comment thread site/content/integrate/reference/mm-blocks/_index.md Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2026

Newest code from mattermost has been published to preview environment for Git SHA 9571324

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds initial developer documentation for the new MM Blocks integration format, and updates existing integration docs to reference MM Blocks as the recommended approach for structured/interactive content.

Changes:

  • Introduces a new MM Blocks reference page describing payload structure, block types, and action dispatch.
  • Updates webhook and slash command docs to point readers to props.mm_blocks / props.mm_blocks_actions.
  • Reframes legacy interactive attachments/buttons docs as supported but not recommended for new integrations.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
site/content/integrate/webhooks/outgoing/_index.md Adds MM Blocks guidance under props and in advanced formatting note.
site/content/integrate/webhooks/incoming/_index.md Adds MM Blocks guidance under props.
site/content/integrate/slash-commands/custom/_index.md Adds MM Blocks references in response guidance and props parameter docs.
site/content/integrate/reference/mm-blocks/_index.md New comprehensive MM Blocks reference page (schema, examples, actions, limits).
site/content/integrate/reference/message-attachments/_index.md Marks attachment actions as legacy and points to MM Blocks.
site/content/integrate/reference/markdown-actions/_index.md Aligns markdown actions docs with MM Blocks / shared action registry.
site/content/integrate/plugins/interactive-messages/_index.md Adds MM Blocks section and reframes legacy attachment actions.
site/content/integrate/faq/_index.md Adds MM Blocks guidance in attachments FAQ section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread site/content/integrate/reference/mm-blocks/_index.md Outdated
Comment thread site/content/integrate/reference/mm-blocks/_index.md Outdated
Comment thread site/content/integrate/plugins/interactive-messages/_index.md Outdated
Comment thread site/content/integrate/webhooks/outgoing/_index.md Outdated
Comment thread site/content/integrate/webhooks/outgoing/_index.md Outdated
Comment thread site/content/integrate/webhooks/incoming/_index.md Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2026

Newest code from mattermost has been published to preview environment for Git SHA 3932294

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

6. To have your application post a message back to `town-square`, it can respond to the HTTP `POST` or `GET` request with a JSON payload.

Mattermost supports several [parameters](#response-parameters) in the response to fine-tune the user's experience. For instance, you can override the username and profile picture the messages post as, or specify a custom post type when sending a webhook message for use by [plugins]({{< ref "/integrate/plugins" >}}). Messages with advanced formatting can be created by including an [attachment array]({{< ref "/integrate/reference/message-attachments" >}}) and [interactive message buttons]({{< ref "/integrate/plugins/interactive-messages" >}}) in the response payload.
Mattermost supports several [parameters](#response-parameters) in the response to fine-tune the user's experience. For instance, you can override the username and profile picture the messages post as, or specify a custom post type when sending a webhook message for use by [plugins]({{< ref "/integrate/plugins" >}}). Messages with advanced formatting can be created by including [MM Blocks]({{< ref "/integrate/reference/mm-blocks" >}}), an [attachment array]({{< ref "/integrate/reference/message-attachments" >}}), or [interactive message buttons]({{< ref "/integrate/plugins/interactive-messages" >}}) in the response payload.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2026

Newest code from mattermost has been published to preview environment for Git SHA be582f8

@larkox larkox requested review from hanzei and svelle June 8, 2026 13:25
@larkox larkox added the 1: Dev Review Requires review by a core commiter label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1: Dev Review Requires review by a core commiter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants