-
Notifications
You must be signed in to change notification settings - Fork 407
content: Add GroupMention to render user group mentions dynamically
#2119
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
base: main
Are you sure you want to change the base?
Conversation
rajveermalviya
left a comment
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
a3ebdd1 to
77f3ce7
Compare
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.
|
I have addressed all the feedback. @gnprice PTAL. |
Fixes #1259.
Changes Made:
Doubts: