Skip to content

feat(chunter): render chat markdown and tracker links#10888

Open
ignatremizov wants to merge 1 commit into
hcengineering:developfrom
ignatremizov:feat/chunter-chat-markdown-issue-links
Open

feat(chunter): render chat markdown and tracker links#10888
ignatremizov wants to merge 1 commit into
hcengineering:developfrom
ignatremizov:feat/chunter-chat-markdown-issue-links

Conversation

@ignatremizov
Copy link
Copy Markdown
Contributor

@ignatremizov ignatremizov commented May 25, 2026

Summary

This PR updates chat message display so plain-text messages with markdown-like content render with the existing markdown parser instead of showing raw syntax. The conversion is limited to plain markup; existing rich editor markup is returned unchanged so stored formatting remains compatible.

It also linkifies standalone tracker issue identifiers such as APP-123 to the current workspace tracker route. The linkification preserves the text users typed, normalizes the identifier only for the link target/title, and skips existing links, inline code, branch-name fragments, and full URLs to avoid noisy false positives.

Testing

  • node common/scripts/install-run-rush.js update --recheck
  • ./node_modules/.bin/jest src/__tests__/markdown.test.ts --config jest.config.js --runInBand from plugins/chunter-resources
  • ./node_modules/.bin/eslint src/markdown.ts src/__tests__/markdown.test.ts from plugins/chunter-resources
  • git diff --check
  • node common/scripts/install-run-rush.js build --to @hcengineering/chunter-resources

Notes

  • Existing rich editor markup is not reparsed, which avoids changing already-structured chat content.
  • Plain text without markdown-like syntax or tracker issue identifiers remains unchanged.
  • Checklist markdown is normalized into ordinary list items with visible [x] or [ ] markers because the message viewer does not render task-list nodes in this display path.
  • Tracker links are generated from the browser location for the current workspace. In non-browser contexts, identifiers remain unlinked.
  • The new direct dependency is limited to @hcengineering/text-markdown for @hcengineering/chunter-resources, with matching Rush lockfile metadata.

Parse plain-text chat messages through the existing markdown parser when they contain markdown-like syntax, then link standalone tracker issue identifiers to the current workspace tracker route. Existing rich editor markup remains unchanged so stored formatting is preserved.

Changes:
- Add a chunter-resources display-markup helper that detects plain markup, parses markdown-like content, and normalizes checklist nodes into visible list markers for message display.
- Link standalone tracker issue identifiers with dynamic prefixes while preserving typed text and normalizing link targets.
- Avoid linkification inside existing links, inline code, branch-name fragments, and full URLs to reduce false positives.
- Apply the helper in ChatMessagePresenter for original and translated messages.
- Add focused Jest coverage for markdown parsing, rich-markup passthrough, checklist preservation, tracker links, and false-positive suppression.
- Add @hcengineering/text-markdown as a direct chunter-resources workspace dependency with matching Rush lockfile metadata.

Validation:
- ./node_modules/.bin/jest src/__tests__/markdown.test.ts --config jest.config.js --runInBand
- ./node_modules/.bin/eslint src/markdown.ts src/__tests__/markdown.test.ts
- git diff --check
- node common/scripts/install-run-rush.js build --to @hcengineering/chunter-resources

Signed-off-by: Ignat Remizov <ignat@ignatremizov.com>
@huly-github-staging
Copy link
Copy Markdown

Connected to Huly®: UBERF-16478

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.

1 participant