Skip to content

MM Blocks Documentation#1508

Open
larkox wants to merge 6 commits into
masterfrom
interactiveMessages
Open

MM Blocks Documentation#1508
larkox wants to merge 6 commits into
masterfrom
interactiveMessages

Conversation

@larkox

@larkox larkox commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: bb6a25b3-73df-454d-9dec-9e719f2a2649

📥 Commits

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

📒 Files selected for processing (3)
  • site/content/integrate/plugins/interactive-messages/_index.md
  • site/content/integrate/reference/markdown-actions/_index.md
  • site/content/integrate/reference/mm-blocks/_index.md
💤 Files with no reviewable changes (1)
  • site/content/integrate/plugins/interactive-messages/_index.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • site/content/integrate/reference/markdown-actions/_index.md
  • site/content/integrate/reference/mm-blocks/_index.md

📝 Walkthrough

Walkthrough

This pull request adds MM Blocks reference documentation and updates related integration guides to describe MM Blocks, markdown actions, legacy attachments, webhooks, and slash command payload fields.

Changes

MM Blocks Integration Framework Documentation

Layer / File(s) Summary
MM Blocks Core Reference Documentation
site/content/integrate/reference/mm-blocks/_index.md
New reference covering props.mm_blocks and props.mm_blocks_actions, supported block types, action registry schema, dispatch flow, callback payloads, legacy compatibility, security constraints, and links.
Interactive Messages Overview and MM Blocks Guidance
site/content/integrate/plugins/interactive-messages/_index.md
Updates the page description to include MM Blocks, rewrites the MM Blocks, markdown action, and legacy attachment sections, adjusts error wording, updates parameters guidance, and adds MM Blocks-specific update.Props notes.
Markdown Actions Reference Framework Integration
site/content/integrate/reference/markdown-actions/_index.md
Repositions markdown action buttons within Interactive Messages, expands mmaction:// validation, updates callback references, adds the dispatch-flow diagram, and refreshes security and related links.
Legacy Attachments and MM Blocks Migration Path
site/content/integrate/reference/message-attachments/_index.md, site/content/integrate/faq/_index.md
Adds MM Blocks preference guidance for legacy attachment content and updates FAQ/API instructions to point new interactive content to props.mm_blocks and props.mm_blocks_actions.
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 documentation in webhook and slash command guides to include MM Blocks keys and updates advanced-formatting guidance.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change as MM Blocks documentation and matches the changeset.
Description check ✅ Passed The description is directly about MM Blocks documentation and relevant linked specs and tickets.
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.
✨ 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.

@coderabbitai coderabbitai Bot 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.

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

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

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

Copilot AI 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.

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

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

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

Copilot AI 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.

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

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

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
@larkox larkox changed the title Initial draft for MM Blocks MM Blocks Documentation Jun 9, 2026

@hanzei hanzei 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.

One totally non-blocking thought: Should we export an LLM focused version of the docs, similar to what https://readmellm.github.io/ and other project recommend? Given that MM-blocks is new, most models don't know about it yet.

Comment on lines +28 to +50
```json
{
"text": "Deployment #42 finished.",
"props": {
"mm_blocks": [
{"type": "text", "text": "Deployed `main` to **staging**."},
{
"type": "button",
"text": "View logs",
"style": "primary",
"action_id": "view_logs"
}
],
"mm_blocks_actions": {
"view_logs": {
"type": "external",
"url": "https://integration.example.com/actions/view-logs",
"context": {"deployment_id": "42"}
}
}
}
}
```

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.

I wonder if we even need the example. We want to redirect the dev to the MM blocks page anyway, right?

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.

I would love to see some screenshots here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They will come later 😄

Comment on lines 196 to 202
| --- | --- |
| Maximum entries in `mm_blocks_actions` | 50 |
| Maximum length of an action ID (map key) | 64 characters |
| Action ID character set | `[A-Za-z0-9]+` |
| Action ID character set | `[A-Za-z0-9_-]+` |
| Maximum entries in `query` (link or registry) | 50 |
| Maximum length of a query key | 128 characters |
| Maximum length of a query value | 2048 characters |

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.

Nit: this seems like a technical detail not worth documenting in a table. Maybe add some of the limits to corresponding sections.

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.

I would also love some screenshot here 😉


MM Blocks are the recommended way to build [interactive messages]({{< ref "/integrate/plugins/interactive-messages" >}}). Instead of placing buttons and menus inside legacy [message attachments]({{< ref "/integrate/reference/message-attachments" >}}), integrations send a block tree in `props.mm_blocks` and register action handlers in `props.mm_blocks_actions`.

Legacy attachment arrays (top-level `attachments` on webhooks and slash-command responses, or `props.attachments` on REST API posts), Slack Block Kit (`props.blocks`), and Microsoft Adaptive Cards (`props.cards`) are still accepted. Mattermost translates them into MM Blocks at render time, but new integrations should use native MM Blocks directly.

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.

Should we move this more to the bottom? I think the docs should first talk about what MM-Blocks are and not point in other directions.


### Submit from a plugin

```go

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.

Nit: code highlighting seems broken. Maybe golang?

Image

| `container` | Groups blocks with optional border, accent bar, background, and layout flow |
| `collapsible` | Expandable section with separate header and content block arrays |
| `column_set` | Horizontal row of columns |
| `column` | Column inside a `column_set` (not valid as a top-level block) |

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.

Should we have clickable links here that take to the sections?


Additional action types may be introduced in future releases. Entries with an unknown `type` value are rejected at post-create time.

## Action dispatch flow

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.

Nit: Maybe add a diagram

Comment on lines +460 to +473
## Validation limits

Posts that exceed any of the following limits are rejected at create or update time.

| Limit | Value |
| --- | --- |
| Maximum entries in `mm_blocks_actions` | 50 |
| Maximum length of an action ID (map key) | 64 characters |
| Action ID character set | `[A-Za-z0-9_-]+` |
| Maximum entries in `query` (link, registry, or block) | 50 |
| Maximum length of a query key | 128 characters |
| Maximum length of a query value | 2048 characters |
| Maximum entries in `context` per action | 50 |
| Maximum length of a context key | 128 characters |

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.

same comment as on the other files. this wrongly placed.

@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

@larkox

larkox commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@hanzei Re: LLM

Sounds like a great idea, but I don't know exactly where that should live. Whether in this repo, in the main repo, or where exactly 😅

@larkox larkox requested a review from hanzei June 26, 2026 13:48
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.

3 participants