Skip to content

Replace rigid wiki message template with markdown content arrays#69

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/enable-markdown-bot-messages
Draft

Replace rigid wiki message template with markdown content arrays#69
Copilot wants to merge 5 commits intomainfrom
copilot/enable-markdown-bot-messages

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Wiki messages used a rigid 5-field template (label, description, value, href, preamble) that forced all messages into a single-line "preamble + hyperlinked description" format. This prevented multi-line messages and flexible markdown formatting.

Changes

Data Format

  • Retain description field for clean dropdown menu descriptions
  • Replace href and preamble fields with content: string[]
  • Each array element is a markdown string, joined with newlines for display
  • Retain value field as unique identifier for Discord select menu matching
  • Updated emoji: Use 👉 (:point_right:) instead of ☝️
  • Wrap URLs in angle brackets <URL> to prevent Discord embeds

Code Updates (wiki.js)

  • Extracted createDescription helper function for reusable markdown stripping logic
  • Use description field directly for dropdown menu descriptions
  • Fallback to generate description from content[0] only if missing (with markdown/emoji stripping)
  • Message assembly: content.join('\n')
  • Removed backward compatibility code for old format (no longer needed)
  • Removed unused hyperlink and hideLinkEmbed imports

Data Migration
Converted all 8 wiki items to new format:

{
  "label": "Honeycomb Bravo",
  "description": "Using the selector knob on a Honeycomb Bravo",
  "value": "honeycombbravo",
  "content": [
    "👉 **Check out this wiki page** for information on using the selector knob with the Honeycomb Bravo:",
    "[Using the selector knob on a Honeycomb Bravo](<https://github.com/MobiFlight/MobiFlight-Connector/wiki/...>)"
  ]
}

Enables arbitrary markdown formatting (bold, italic, links, emojis, multi-line) while maintaining clean dropdown descriptions and preventing unwanted link previews in Discord.

Original prompt

This section details on the original issue you should resolve

<issue_title>Enable markdown based bot messages</issue_title>
<issue_description>Right now, we are using a very strict template for the wiki message:

{
    "label": "Honeycomb Bravo",
    "description": "Using the selector knob on a Honeycomb Bravo",
    "value": "honeycombbravo",
    "href": "https://github.com/MobiFlight/MobiFlight-Connector/wiki/Using-the-selector-knob-on-a-Honeycomb-Bravo",
    "preamble": "Check out this wiki page for information on using the selector knob with the Honeycomb Bravo:"
  },

we want to have more flexibility and simply use markdown insteadl
we want to allow for multiple lines.

An example looks like:

{
	"label": "Honeycomb Bravo",
	"value": "honeycombbravo",
	"content": [
		"☝️ **Check out this wiki page** for information on using the selector knob with the Honeycomb Bravo:",
		"[Using the selector knob on a Honeycomb Bravo](https://github.com/MobiFlight/MobiFlight-Connector/wiki/Using-the-selector-knob-on-a-Honeycomb-Bravo)"
	]
}

This will provide more flexibility for the formatting of the messages.
The old content can be converted to the new markdown based format.

I am not sure why we are needing the "value" field. If the value field is some kind of key, we could check if it can be generated on the fly using the label. it might have to be unique.

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 13, 2026 11:48
Co-authored-by: DocMoebiuz <86157512+DocMoebiuz@users.noreply.github.com>
…e markdown stripping

Co-authored-by: DocMoebiuz <86157512+DocMoebiuz@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable markdown based bot messages for flexibility Replace rigid wiki message template with markdown content arrays Feb 13, 2026
Copilot AI requested a review from DocMoebiuz February 13, 2026 11:54
Copy link

@DocMoebiuz DocMoebiuz left a comment

Choose a reason for hiding this comment

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

See all my comments.

"href": "https://github.com/MobiFlight/MobiFlight-Connector/wiki/Using-the-selector-knob-on-a-Honeycomb-Bravo",
"preamble": "Check out this wiki page for information on using the selector knob with the Honeycomb Bravo:"
"content": [
"☝️ **Check out this wiki page** for information on using the selector knob with the Honeycomb Bravo:",

Choose a reason for hiding this comment

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

☝️ Check out this wiki page
Replace all occurences with a 👉 emoji

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in commit c656bb4. Replaced all ☝️ emojis with 👉 (:point_right:) emoji across all wiki items.

…tibility

Co-authored-by: DocMoebiuz <86157512+DocMoebiuz@users.noreply.github.com>
if (item.description) {
option.setDescription(item.description);
}
else if (item.content && item.content.length > 0) {

Choose a reason for hiding this comment

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

Extract code to function createDescription

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in commit fe1b647. Extracted the description generation logic to a createDescription helper function that strips markdown formatting from content lines.

Comment on lines 119 to 121
.setName('topic')
.setDescription('The name of the wiki topic to send')
.setRequired(false),

Choose a reason for hiding this comment

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

why are we changing all strings to single quote? I am not aware of any style guide about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The eslint config (.eslint.json) specifies "quotes": ["error", "single"] which automatically converts double quotes to single quotes when running eslint --fix. However, I've now reverted to the original file and kept the double quotes to match the existing codebase style.

Comment on lines 7 to 9
"👉 **Check out this wiki page** for information on using the selector knob with the Honeycomb Bravo:",
"[Using the selector knob on a Honeycomb Bravo](https://github.com/MobiFlight/MobiFlight-Connector/wiki/Using-the-selector-knob-on-a-Honeycomb-Bravo)"
]

Choose a reason for hiding this comment

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

for all the links here in this json, use angle brackets for preventing the embed, e.g.

Using the selector knob on a Honeycomb Bravo

Using the selector knob on a Honeycomb Bravo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in commit fe1b647. Added angle brackets around all URLs in markdown links (e.g., [text](<URL>)) to prevent Discord from showing link embeds.

Copy link

@DocMoebiuz DocMoebiuz left a comment

Choose a reason for hiding this comment

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

Take a look at my comments.

Also revert the whitespace changes. In the existing code base one tab was 2 spaces. It seems you changed to 4 which creates a lot of tracked changes

…2-space indentation

Co-authored-by: DocMoebiuz <86157512+DocMoebiuz@users.noreply.github.com>
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.

Enable markdown based bot messages

2 participants