-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat: ordered mention suggestions #42553
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should proceed with this PR
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.
@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 |
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.
LGTM!
detail | ||
? { | ||
...detail, | ||
weight: getPersonalDetailsWeight(detail, policyEmployeeAccountIDs), |
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.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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