-
Notifications
You must be signed in to change notification settings - Fork 109
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
Mention #404
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.
For my taste, the vertical padding of the mention box is a bit too large. Maybe we could reduce it a bit? Maybe 3px 5px
?
src/filters.ts
Outdated
let identity = possibleMention.substr(2, 8); | ||
if (identity === '@@@@@@@@') { | ||
text = text.replace( | ||
new RegExp(possibleMention.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'), 'g'), |
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.
Whoa, I don't understand this RegEx. What does it do?
Couldn't we simply do text.replace('@[@@@@@@@@]', <span class="mention all">' + $translate.instant('messenger.ALL') + '</span>')
first, and only then search for contact mentions?
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.
this saves one iteration, replace will be only called if one or more mentions (including the all
mention) are found
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.
check my new commit
it('mention - all', () => { | ||
this.testPatterns([ | ||
['@[@@@@@@@@]', '<span class="mention all">messenger.ALL</span>'], | ||
['@[@@@@@@@@] your base are belong to us', '<span class="mention all">messenger.ALL</span> your base are belong to us'], |
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.
I approve of this test case!
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.
👍
padding changed to |
When having mentions on two lines directly above each other, they partially overlap. But that's not too terrible, so it can still be fixed later :) |
IMHO you should always still display the |
Better create an issue :D |
The @ char looks pretty awkward. IMHO the grey frame is prominent enough. |
But the @ character is pretty much the universal character used for mentioning someone. I agree with @rugk on showing the '@' char at the beginning of every mention. |
It might indeed be helpful to new users. But on the other hand, displaying the @ character at the beginning of a mention is redundant and doesn't look good. |
It is done like that in every chat application I know. So it confuses me a bit that this is not shown, even if I am not a beginner. 😄 |
Don't think so. Check out Telegram for instance. And even if it was, we don't have to do it same way. |
No, it's not redundant in my opinion as it clearly shows that someone is being mentioned. Just the highlighting of the text could lead to confusion as all names might be highlighted or it could be some formatting option. And as you can see in my reply above github shows the '@' character as well. I think it'd be better if it's done like everywhere else.
True Telegram doesn't show the '@'. But I still think that it's better to keep the '@' in. |
|
In MyBB it also allows spaces... But you already did the parsing work, so there is nothing to worry, it is just a visual change (i.e., it can even be accomplished with a CSS pseudo-class Maybe Threema can do an A/B test... 😄 |
Right, Threema IDs are used internally. The whole point of having an |
It wouldn't preserve the mention when the text is copied back into Threema or when the text is copied elsewhere?
I don't think it looks awkward. The highlighting makes the block |
No, because internally it is |
Support the new mention feature (Display Only)
will be