New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connect: Highlight @ mentions to logged in user #10216
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! One change request.
| @@ -38,4 +39,22 @@ describe('<Message />', () => { | |||
|
|
|||
| expect(profileLink.parentElement).toHaveStyle({ color: msg.color }); | |||
| }); | |||
|
|
|||
| it('should highlight @mentions to the logged in user', () => { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (non-blocking): Change the wording a bit.
| it('should highlight @mentions to the logged in user', () => { | |
| it('should highlight @mentions for the logged on user', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logged on??? 🧐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for the PR @timorthi! 🚀
* Wrap with <mark> tags if mentioning current user
* Add test for @mention highlight
* Match @{username} mention
* Remove default param
What type of PR is this? (check all applicable)
Description
This PR distinguishes between mentions to the logged in user and mentions to other users by wrapping @-mentions to the logged in user with
<mark>.Based on my understanding, it's not possible to wrap
<mark>tags at the time the message's HTML is generated inmodels/message.rb. Because of this, we'll have to highlight the @-mentions on the client side.The implementation in this PR makes this feature quite obscure but it happens to be the implementation with the fewest lines of changed code, so I just rolled with it.
Related Tickets & Documents
#9472
QA Instructions, Screenshots, Recordings
<mark>Added tests?
Added to documentation?