fix(composer): move attribution line outside of blockquote so @mention triggers notification#172
fix(composer): move attribution line outside of blockquote so @mention triggers notification#172ClickAndGoScript wants to merge 1 commit into
Conversation
When quoting a post, the "@user wrote:" attribution line was prefixed with `> `, placing it inside the blockquote block. This caused the @mention to go unrecognized by the mention parser, so the quoted user never received a notification. Remove the leading `> ` from `quoteKey` so the attribution line renders above the blockquote, allowing the @mention to trigger a notification.
|
The reason why the There are some utility classeson the notification.bodyLong parent to hide blockquotes pre and the first line break to show the relevant part of the content. If mentions plugins adds a class on the element than we can hide that in notification body as well with a class like |
|
Now that I think about it that won't work as it would just hide the |
|
Fair enough, I didn't realize the blockquote placement was intentional. What about fixing this on the mentions plugin side instead? Right now and before notifying, verify that the author of is actually the My main question is whether this check is reliable enough to separate If this sounds reasonable I'll close this PR and open one against |
|
I think closing this PR is probably a good idea regardless because I don't see us moving back to the mention outside the blockquote. My question is whether this is necessary at all. If you quote someone, the mention may not get captured, but if they're already posting in the thread they'd probably be notified anyway because they would already be watching the topic (per user setting of course.) I just personally don't like adding even more logic to mentions.clean. It's confusing enough already! |
|
One could further make the argument that if you are merely quoted, it's not a "mention", per se. 🙂 |
Summary
When using the Quote button, the
@user [wrote](/post/123):attributionline was rendered inside the blockquote block due to a leading
>inquoteKey. Because the@mentionwas inside a blockquote, the mentionparser did not recognize it, and the quoted user never received a
notification.
This fix removes the leading
>so the attribution line appears abovethe blockquote, restoring expected mention notification behavior.
Before:
(no notification sent to @user)
After:
@user wrote:
(notification sent to @user)
Changes
static/lib/composer.js— removed>prefix fromquoteKeyinboth the
useTopicLinkand default branches ofcomposer.addQuoteTest plan