content: Add GroupMention to render user group mentions dynamically#2119
content: Add GroupMention to render user group mentions dynamically#2119gnprice merged 6 commits intozulip:mainfrom
GroupMention to render user group mentions dynamically#2119Conversation
rajveermalviya
left a comment
There was a problem hiding this comment.
Thanks for working on this @Ruhdee! Overall looks good, some small comments below.
71538c1 to
b2408e8
Compare
|
@rajveermalviya Thank you for the review! I have addressed the feedback. PTAL. |
rajveermalviya
left a comment
There was a problem hiding this comment.
Thanks for the revision @Ruhdee! All looks good, modulo one nit.
Moving over to Greg's review.
|
I have made the latest requested change. |
gnprice
left a comment
There was a problem hiding this comment.
Thanks @Ruhdee for taking care of this, and thanks @rajveermalviya for the previous reviews!
Generally this looks great. Various small comments below, mostly nits.
lib/model/content.dart
Outdated
| final userId = switch (element.attributes['data-user-id']) { | ||
| // For legacy or wildcard mentions. | ||
| null || '*' => null, | ||
| final userIdString => int.tryParse(userIdString), |
There was a problem hiding this comment.
Ah, and I see this existing call is missing radix: 10. So that would be good to fix as a separate prep commit.
There was a problem hiding this comment.
Since this change affects the behaviour of the function in case 'data-user-id' is a hexadecimal, this change technically counts as a functional change, right?
There was a problem hiding this comment.
That's right, it's not an NFC commit. It's nearly NFC, in that it's NFC on the assumption of a well-behaved server.
77f3ce7 to
66a7186
Compare
|
I have addressed all the feedback. @gnprice PTAL. |
|
CI is now passing |
gnprice
left a comment
There was a problem hiding this comment.
Thanks for the revision! Just a handful of comments below. Also replied to a question above: #2119 (comment)
|
I have addressed the feedback. PTAL. |
|
Thanks! Looks great; merging. |
Deleted enum 'UserMentionType' and outdated comments. Refactored 'parseUserMention' and changed it's return type to 'MentionNode'. Renamed '_userMentionClassNameRegexp'.
…cally Fixes zulip#1259. Look up current user group name from PerAccountStore when rendering mentions, while respecting 'isSilent' flag. This ensures mentions display correctly even if the user group name has been changed since the message was sent. Falls back to original HTML text when user group not found. Added 'user group mention dynamic name resolution' tests group.
Fixes #1259.
Changes Made:
Doubts: