Skip to content

Update docs to include collapsible elements#1516

Open
krd311 wants to merge 5 commits into
masterfrom
kyledoliente_updateDocs_interactiveDialog
Open

Update docs to include collapsible elements#1516
krd311 wants to merge 5 commits into
masterfrom
kyledoliente_updateDocs_interactiveDialog

Conversation

@krd311

@krd311 krd311 commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Adds in documentation and instructions regarding the new collapsible elements in interactive dialogs.

Ticket Link

https://mattermost.atlassian.net/browse/MM-69315

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

This PR updates the Interactive Dialogs documentation to cover the new collapsible dialog element, including its purpose, configuration fields, and an example payload for integrations.

Changes:

  • Adds collapsible to the list of supported dialog element types.
  • Introduces a new “Collapsible elements” section with usage notes, a JSON example, and a field reference table.

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

Comment thread site/content/integrate/plugins/interactive-dialogs/_index.md Outdated
Comment thread site/content/integrate/plugins/interactive-dialogs/_index.md Outdated
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds collapsible dialog documentation and updates plugin JSDoc parsing to handle arrow-function parameters whether they are destructured or not.

Changes

Collapsible Element Documentation

Layer / File(s) Summary
Document collapsible element type and usage
site/content/integrate/plugins/interactive-dialogs/_index.md
Adds collapsible to the Elements list and a new "Collapsible elements" section covering behaviour, nesting, validation, an example payload, and supported fields.

Plugin JSDoc Parameter Extraction

Layer / File(s) Summary
Extract arrow-function parameters
scripts/plugin-jsdocs.js
Updates arrow-function parameter extraction to gather destructured property names when available and otherwise use the parameter name directly.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding collapsible elements documentation.
Description check ✅ Passed The description directly matches the documented collapsible elements update in interactive dialogs.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kyledoliente_updateDocs_interactiveDialog

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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.

🧹 Nitpick comments (1)
site/content/integrate/plugins/interactive-dialogs/_index.md (1)

625-626: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep the heading hierarchy contiguous. ##### skips a level after ###, which trips markdownlint and makes the section structure harder to scan.

♻️ Suggested fix
-##### Minimum Server Version: 11.10.0
+#### Minimum Server Version: 11.10.0
🤖 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/plugins/interactive-dialogs/_index.md` around lines
625 - 626, The heading hierarchy in the Collapsible elements section is skipping
a level, which breaks contiguous markdown structure. Update the markdown under
the Collapsible elements section so the heading used with “Minimum Server
Version: 11.10.0” matches the expected next level after the preceding `###`
heading, and keep the section consistent with the surrounding headings in this
document.

Source: Linters/SAST tools

🤖 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.

Nitpick comments:
In `@site/content/integrate/plugins/interactive-dialogs/_index.md`:
- Around line 625-626: The heading hierarchy in the Collapsible elements section
is skipping a level, which breaks contiguous markdown structure. Update the
markdown under the Collapsible elements section so the heading used with
“Minimum Server Version: 11.10.0” matches the expected next level after the
preceding `###` heading, and keep the section consistent with the surrounding
headings in this document.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 72c8a727-8a20-4f30-85f7-c9480f0fa2ac

📥 Commits

Reviewing files that changed from the base of the PR and between 99e258f and 64d2bfc.

📒 Files selected for processing (1)
  • site/content/integrate/plugins/interactive-dialogs/_index.md

krd311 and others added 2 commits July 8, 2026 10:34
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot finished work on behalf of krd311 July 8, 2026 17:38

@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: 3

🤖 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 `@scripts/plugin-jsdocs.js`:
- Around line 57-62: The parameter extraction in the docs generation logic is
assuming every destructured property has prop.key.name, which breaks on
ObjectPattern entries like RestElement and misses other non-Identifier params.
Update the funcExpr[0].params.flatMap handling to explicitly branch on
param.type and safely handle destructured object/array patterns, defaults, and
rest elements without reading key.name blindly. Use the existing params
extraction block in the JSDoc script to keep all parameter shapes supported
while avoiding crashes on { ...rest }.

In `@site/content/integrate/plugins/interactive-dialogs/_index.md`:
- Around line 625-626: The heading hierarchy in the Collapsible elements section
is skipping a level, so update the heading after the `### Collapsible elements`
entry to use the next level heading instead of jumping to a deeper one. Adjust
the Markdown in `_index.md` so this section stays consistent with the
surrounding structure and satisfies the linter, using the same section labels
already present.
- Line 73: The sentence in the interactive dialogs docs reads awkwardly around
the “otherwise” clause and the “if” comma, so rewrite the copy in place for
clarity. Update the wording in the content block that mentions optional elements
so it flows more naturally, keeps the same meaning about client errors and help
text placement, and remains easy to scan.
🪄 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: 1fabb27a-c9ce-442b-a490-0173f6d29cbc

📥 Commits

Reviewing files that changed from the base of the PR and between 64d2bfc and d1bc059.

📒 Files selected for processing (2)
  • scripts/plugin-jsdocs.js
  • site/content/integrate/plugins/interactive-dialogs/_index.md

Comment thread scripts/plugin-jsdocs.js
Comment on lines +57 to 62
params = funcExpr[0].params.flatMap(param => {
if (param.properties) {
return param.properties.map(prop => prop.key.name);
}
return param.name ? [param.name] : [];
});

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm RestElement and other pattern node structures in the parser output.
# Requires the package installed in scripts/ (Makefile runs `cd scripts && npm install`).
node -e "
const { parse } = require('./scripts/node_modules/@typescript-eslint/typescript-estree');
const code = 'const fn = ({ a, ...rest }, [b], c = 1, ...args) => {};';
const ast = parse(code, { comment: true, loc: true });
const arrow = ast.body[0].declarations[0].init;
arrow.params.forEach(p => {
  console.log(p.type, '→ properties:', !!p.properties, '| name:', p.name || '(none)', '| key:', p.key || '(none)');
  if (p.properties) {
    p.properties.forEach(prop => {
      console.log('  prop:', prop.type, '| key:', prop.key?.name || '(none)', '| argument:', prop.argument?.name || '(none)');
    });
  }
});
"

Repository: mattermost/mattermost-developer-documentation

Length of output: 1088


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== scripts/plugin-jsdocs.js ==\n'
cat -n scripts/plugin-jsdocs.js | sed -n '1,140p'

printf '\n== scripts/package.json (if present) ==\n'
if [ -f scripts/package.json ]; then
  cat -n scripts/package.json | sed -n '1,220p'
fi

printf '\n== dependency references ==\n'
rg -n "`@typescript-eslint/typescript-estree`|typescript-estree" -S . --glob '!**/node_modules/**'

Repository: mattermost/mattermost-developer-documentation

Length of output: 4542


Handle destructured params before reading prop.key.name ObjectPattern.properties can include RestElement nodes, so this branch can throw on { ...rest } and stop docs generation. The fallback also drops non-Identifier params like array patterns and defaults.

🤖 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 `@scripts/plugin-jsdocs.js` around lines 57 - 62, The parameter extraction in
the docs generation logic is assuming every destructured property has
prop.key.name, which breaks on ObjectPattern entries like RestElement and misses
other non-Identifier params. Update the funcExpr[0].params.flatMap handling to
explicitly branch on param.type and safely handle destructured object/array
patterns, defaults, and rest elements without reading key.name blindly. Use the
existing params extraction block in the JSDoc script to keep all parameter
shapes supported while avoiding crashes on { ...rest }.

- `collapsible`: A section that groups child elements under a toggleable header. Use this to organize long forms; sections can be nested and can start expanded or collapsed.

Each element is required by default, otherwise the client will return an error as shown below. Note that the error message will appear below the help text, if one is specified. To make an element optional, set the field `"optional": "true"`.
Each element is required by default, otherwise the client will return an error as shown below. Note that the error message will appear below the help text, if one is specified. To make an element optional, set the field `"optional": true`.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Reword this sentence for clarity.

The otherwise clause reads awkwardly, and the comma before if is unnecessary. A small rewrite will make the requirement easier to scan.

♻️ Proposed fix
-Each element is required by default, otherwise the client will return an error as shown below. Note that the error message will appear below the help text, if one is specified. To make an element optional, set the field `"optional": true`.
+Each element is required by default; otherwise, the client will return an error as shown below. Note that the error message will appear below the help text if one is specified. To make an element optional, set the field `"optional": true`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Each element is required by default, otherwise the client will return an error as shown below. Note that the error message will appear below the help text, if one is specified. To make an element optional, set the field `"optional": true`.
Each element is required by default; otherwise, the client will return an error as shown below. Note that the error message will appear below the help text if one is specified. To make an element optional, set the field `"optional": true`.
🧰 Tools
🪛 LanguageTool

[typographical] ~73-~73: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...collapsed. Each element is required by default, otherwise the client will return an error as show...

(THUS_SENTENCE)


[typographical] ~73-~73: Usually, there’s no comma before “if”.
Context: ... message will appear below the help text, if one is specified. To make an element op...

(IF_NO_COMMA)

🤖 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/plugins/interactive-dialogs/_index.md` at line 73, The
sentence in the interactive dialogs docs reads awkwardly around the “otherwise”
clause and the “if” comma, so rewrite the copy in place for clarity. Update the
wording in the content block that mentions optional elements so it flows more
naturally, keeps the same meaning about client errors and help text placement,
and remains easy to scan.

Source: Linters/SAST tools

Comment on lines +625 to +626
### Collapsible elements
##### Minimum Server Version: 11.10

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the next heading level here.

This jumps from ### to #####, which breaks the Markdown hierarchy. #### keeps the section structure consistent and satisfies the linter.

♻️ Proposed fix
-##### Minimum Server Version: 11.10
+#### Minimum Server Version: 11.10
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Collapsible elements
##### Minimum Server Version: 11.10
### Collapsible elements
#### Minimum Server Version: 11.10
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 626-626: Heading levels should only increment by one level at a time
Expected: h4; Actual: h5

(MD001, heading-increment)

🤖 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/plugins/interactive-dialogs/_index.md` around lines
625 - 626, The heading hierarchy in the Collapsible elements section is skipping
a level, so update the heading after the `### Collapsible elements` entry to use
the next level heading instead of jumping to a deeper one. Adjust the Markdown
in `_index.md` so this section stays consistent with the surrounding structure
and satisfies the linter, using the same section labels already present.

Source: Linters/SAST tools

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants