Skip to content

feat: Add @mention formatting for comments and checklists #20#43

Merged
steveclarke merged 1 commit intomasterfrom
feat/mention-formatting
Feb 24, 2026
Merged

feat: Add @mention formatting for comments and checklists #20#43
steveclarke merged 1 commit intomasterfrom
feat/mention-formatting

Conversation

@steveclarke
Copy link
Copy Markdown
Owner

Summary

  • Adds MentionFormatter class that converts {{@Username}} syntax to Superthread's <user-mention> HTML tags
  • Integrates at the resource layer so both CLI and library consumers get automatic mention support
  • Applies to comments (create/update), replies (create/update), and checklist items (add/update)

Ports the existing implementation from the TypeScript MCP server (mcp-superthread-plus/src/utils.ts).

Closes #20

Details

  • Three-pass algorithm: escape protected mentions, replace matches, restore escaped text
  • Case-insensitive name matching against workspace members
  • HTML-escapes attribute values for XSS defense
  • Graceful degradation: returns content unchanged if member fetch fails
  • Unmatched names stay as literal {{@Name}} text

Test plan

  • 15 unit tests covering all behaviors (match, no match, escaping, XSS, error handling)
  • Full suite passes (724 examples, 0 failures)
  • StandardRB clean
  • YARD docs clean
  • Manual verification: created a comment with {{@Steve Clarke}} on MCP Testing board, confirmed <user-mention> tag in API response

Port the {{@Username}} mention syntax from the MCP server to the
Ruby gem. Converts mention templates to Superthread's HTML
<user-mention> tags by looking up workspace members.

Applied automatically at the resource layer so both CLI and library
consumers get mention support in comments, replies, and checklist
item titles.
@steveclarke steveclarke merged commit 84b88b7 into master Feb 24, 2026
1 check passed
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.

Feature: Support @mentions and HTML formatting

1 participant