feat: highlight @mentions in dialog comments (#138)#380
Open
akash2017sky wants to merge 4 commits into
Open
Conversation
The full ticket page already styles @mentions, but the work item dialog's CommentSection was rendering comment content without running it through highlightMentions, so the dropdown-inserted mentions stayed plain text. Wire up the same helper here, and update the placeholder so the @ trigger is discoverable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR brings dialog comment rendering in line with the full ticket page by applying mention highlighting to comments shown through CommentSection, and updates reply placeholders to advertise the @ mention trigger.
Changes:
- Imports and applies
highlightMentionswhen rendering dialog/work-item comments. - Updates compact and full
CommentSectionplaceholders to mention the@trigger.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| className={`user-content ${compact ? 'prose prose-sm prose-invert max-w-none text-sm' : 'text-sm'}`} | ||
| style={{ color: 'var(--text-secondary)' }} | ||
| dangerouslySetInnerHTML={{ __html: comment.content }} | ||
| dangerouslySetInnerHTML={{ __html: highlightMentions(comment.content) }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TicketDetail) already styles@mentionsviahighlightMentions, but the work-item dialog'sCommentSectionwas renderingcomment.contentraw — so the same dropdown-inserted mentions stayed plain text in the dialog.comment.contentthroughhighlightMentionsinCommentSectionso the dialog matches the full page.@trigger, matching the hint already inTicketDetail.The autocomplete itself (the
MentionInputcomponent,/api/devops/usersendpoint, debouncing, keyboard nav, plain-text storage) was already in place — this PR closes the visible gap so #138's "highlighted in the comment" behavior is consistent everywhere comments render.Fixes #138.
Test plan
@, pick a user from the dropdown, submit. Verify the rendered comment shows the mention highlighted in green./tickets/[id]page — confirm highlighting still works there (no regression).🤖 Generated with Claude Code