feat: ordered mention suggestions#42553
Conversation
|
@alitoshmatov Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@gijoe0295 Can you check this in groups, in my case suggestion is not showing report members first
|
|
@alitoshmatov could you add me to that group? |
|
@gijoe0295 Can't add to an existing group |
|
Looks like this is happening only with old groups. I couldn't reproduce the issue when creating a new croup even choosing the same members |
This sounds a problem. Let me investigate it. |
…at-ordered-mention-suggestions
|
Hi @alitoshmatov I couldn't reproduce your issue with old groups. Could you please log the
|
| if (!ReportUtils.isGroupChat(currentReport) && !ReportUtils.doesReportBelongToWorkspace(currentReport, policyEmployeeAccountIDs, policyID)) { | ||
| return personalDetails; | ||
| } |
There was a problem hiding this comment.
Looks like this condition is met in my case, that is why weighted ordering didn't work. Removing it helped and showed group members first. I think we don't need this condition. Can we remove it safely?
@gijoe0295
There was a problem hiding this comment.
As per OP:
when in a group chat or a chat connected to a workspace
Removing this condition would introduce unnecessary computation of weightedPersonalDetails for normal reports.
I think there's some incorrect data with your currentReport. If it was a group chat, the condition would work properly. Maybe let's log out then log in to see if it got the correct data?
There was a problem hiding this comment.
Sorry, I confused the cases in the condition, that's why my conclusion was wrong
I see that for a report to be a group chat it should have chatType=group but it is empty for this case. Maybe it is a thing with older groups. I checked this with multiple old groups in two accounts and the same true for all
Below is currentReport, policyEmployeeAccountIDs, policyID
{
"reportID": "1164088907436698",
"reportName": "Chat Report",
"type": "chat",
"chatType": "",
"ownerAccountID": 0,
"managerID": 0,
"policyID": "_FAKE_",
"participants": {
"14579716": {
"hidden": false
},
"14582230": {
"hidden": false
},
"14640187": {
"hidden": false
},
"14640366": {
"hidden": false
},
"14640421": {
"hidden": false
}
},
"participantAccountIDs": [
14582230,
14640187,
14640366,
14640421
],
"visibleChatMemberAccountIDs": [
14582230,
14640187,
14640366,
14640421
],
"isPinned": false,
"lastReadTime": "2024-04-12 15:49:29.672",
"lastReadSequenceNumber": 0,
"lastVisibleActionCreated": "2024-04-12 15:49:29.672",
"lastVisibleActionLastModified": "2024-04-12 15:49:29.672",
"lastMessageText": "@alitoshmatov2001+test@gmail.com Hello world, new @alitoshmatov2001+android@gm…",
"lastActionType": "ADDCOMMENT",
"lastActorAccountID": "14579716",
"notificationPreference": "always",
"stateNum": 0,
"statusNum": 0,
"oldPolicyName": "",
"isOwnPolicyExpenseChat": false,
"lastMessageHtml": "<mention-user>@alitoshmatov2001+test@gmail.com</mention-user> Hello world, new <mention-user>@alitoshmatov2001+android@gmail.com</mention-user>",
"hasOutstandingChildRequest": false,
"writeCapability": "all",
"description": "",
"total": 0,
"unheldTotal": 0,
"currency": "USD",
"isWaitingOnBankAccount": false,
"nonReimbursableTotal": 0,
"isCancelledIOU": false,
"permissions": [
"read",
"write"
],
"submitterPayPalMeAddress": "",
"welcomeMessage": "",
"errorFields": {}
}
There was a problem hiding this comment.
I see that for a report to be a group chat it should have chatType=group but it is empty for this case.
I think this is another bug and not related to this PR. Before group chats, we had group DMs. Maybe the migration from group DMs had some problems.
cc @yuwenmemon We found several group chats with empty chatType (should be group), do you have any clue on this? Should we ignore it since it is not related to this PR?
There was a problem hiding this comment.
I think we should proceed with this PR
There was a problem hiding this comment.
@gijoe0295 Yeah maybe let's raise in expensify-bugs: https://expensify.enterprise.slack.com/archives/C049HHMV9SM
…at-ordered-mention-suggestions
|
@alitoshmatov Do you have any other feedbacks? |
|
I will complete the checklist |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb Chromeordered-mentions-mweb.moviOS: Nativemembers-ios.mp4iOS: mWeb Safariordered-mentions-safari.mp4MacOS: Chrome / Safariordered-mentions-web.movMacOS: Desktopordered-mentions-desktop.mov |
| detail | ||
| ? { | ||
| ...detail, | ||
| weight: getPersonalDetailsWeight(detail, policyEmployeeAccountIDs), |
There was a problem hiding this comment.
NAB: A more apt name could be maybe something like orderWeight
|
🚀 Deployed to staging by https://github.com/yuwenmemon in version: 1.4.84-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.84-3 🚀
|



Details
Implement mention suggestions with order of relevancy when in a group chat or a chat connected to a workspace:
Fixed Issues
$ #42009
PROPOSAL: #42009 (comment)
Tests
@in a group chat with several participants@in a Workspace room, where only a fraction of the workspace members are in the roomOffline tests
NA
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
Screen.Recording.2024-05-24.at.02.14.42-source.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Group chat
Workspace room
MacOS: Desktop