typeahead: Show pronouns in @-mention and New DM lists#2165
typeahead: Show pronouns in @-mention and New DM lists#2165yash-agarwa-l wants to merge 1 commit intozulip:mainfrom
Conversation
0586c93 to
61f3dd4
Compare
|
Hi! Just checking in, this PR is ready for review whenever you have a moment. Thanks! |
|
Those screenshots only show the @-mention UI; they don't show the user selector in the "New DM" UI (reachable by tapping "New DM" from the DMs tab). |
|
Thank you! I have updated the screenshots. |
|
Following the web app, I think the typeahead styling should be:
|
|
Parens seem fine in the user list; I don't think we've got a web app equivalent for that. |
61f3dd4 to
35984d7
Compare
|
Thank you for pointing that out, I have updated that to follow the web app for @-typeaheads and updated the screenshots |
6a5741d to
81373a0
Compare
lib/model/realm.dart
Outdated
| for (final field in customProfileFields) { | ||
| if (field.type != CustomProfileFieldType.pronouns) continue; | ||
| if (bestField == null || field.order < bestField.order) { | ||
| bestField = field; |
There was a problem hiding this comment.
Is this with .order the right semantics to have? See the comment in RealmStoreImpl._sortCustomProfileFields.
There was a problem hiding this comment.
Understood, when I am using customProfileFields, its already in order and I can take the first field with type pronouns as my primary pronoun.
Fixes zulip#313. Implement logic to display user pronouns in the compose box typeahead and the New DM search sheet. For @-mentions, Pronouns are displayed after the status emoji but before the email. To determine which pronouns to show, we select the primary pronoun field which comes first in the `customProfileFields` list after sorting with type pronouns.
81373a0 to
4e5b39e
Compare
Fixes #313
Implement logic to display user pronouns in the compose box typeahead and the New DM search sheet.
To determine which pronouns to show, we select the primary pronoun field (type 8) with the lowest 'order' value in the realm. This ensures consistency across the organization.
This commit adds
primaryPronounFieldIdandprimaryPronounsForto RealmStore to handle this retrieval. Pronouns are displayed after the status emoji but before the email.Includes unit tests for the RealmStore sorting logic and the updated widget rendering in autocomplete and the New DM sheet.