discourse/plugins/chat/assets
David Battersby 9335e71f81
FIX: dynamic highlighting of self mentions (#37321)
## Issue

When we open a chat channel we can see that any mentions of our own
username is highlighted, but any new mentions of our username after that
point is not highlighted.

This is due to how user mentions are upserted as part of a background
job when a message is sent, but we return the message bus response
straight away, meaning that we don't have the mentioned user info to
apply the `--current-user` class for styling for self mentions.

## The Solution

This change adds dynamic styling of the current user mentions by adding
the style rules to the page header based on their username. So the
dynamic style will look like:

```js
.mention[href="/u/johndoe"] { background: var(--tertiary-400); }
```

This works for both mentions in posts/topics and chat. Now we no longer
rely on applying a `--current-user` class.

Internal ref - /t/173085
2026-01-28 14:59:48 +04:00
..
javascripts UX: Make chat drawer shortcut (-) toggle instead of open-only 2026-01-26 18:16:20 +00:00
stylesheets FIX: dynamic highlighting of self mentions (#37321) 2026-01-28 14:59:48 +04:00