You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-03-13] MEDIUM: [$500] Drop domain names when searching for users and auto-filling mentions #35532
Version Number: v1.4.35-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): N/A Logs: N/A Expensify/Expensify Issue URL: N/A Issue reported by: N/A Slack conversation: N/A
Action Performed:
Create a room with 4 members: 2 on the same private domain, 1 on another private domain, and 1 on a public domain
Draft a message that includes mentions for each user.
Expected Result:
When mentioning a user on the same private domain, the search result for the mention should not include the domain for the user's email. For example, given a message between two users - nikkiwines@expensify.com and puneet@expensify.com - the search and auto-complete behavior should look like this:
When mentioning a user on a public domain or on a different private domain, the behavior should remain largely as it is, though we will now prepend an @ to the front of the login details (e.g. Nikki Wines nikkiwines@expensifail.com becomes Nikki Wines @nikkiwines@expensifail.com) when showing the mention options in search.
Actual Result:
The search result and mention auto-complete a same-private-domain mention contains the full email domain, even though the domain name gets removed after sending the message.
Screen.Recording.2024-01-31.at.17.31.02.mov
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
What changes do you think we should make in order to solve the problem?
Like already done in the CompanyStep component, the SuggestionMention component should get the user and session object from Onyx to figure out whether the user is a from a public domain. If not, the domain can be extracted with Str.extractEmailDomain from the session object and this value can be used to transform alternateText in suggestionValues.suggestedMentions to hide the private domain before it is passed into MentionSuggestions.
to also strip the private domain when a suggestion has been selected so that the autofilled value matches what is being displayed in the suggestion list.
What alternative solutions did you explore? (Optional)
The above proposal has a little bit of duplicate logic that's spread out in an attempt to lower the risk of regressions, as the underlying data (which may be used in many other places) remains the same. Only alternateText in suggestionValues.suggestedMentions and behavior of insertSelectedMention are changed, both of which are self contained changes that won't propagate too far.
An alternative solution is to modify how the suggestionValues state is set. getMentionOptions can be modified to correctly compute the correct alternateText and login values of a suggestion. This may have a higher chance of causing a regression.
I'm fine with it! I based this issue on what we have currently in product and also what Slack does.
But, since the autocomplete mention in the message draft prepends @, and we see it in the actual mention, I think it'd be fine to display it in the search as well. I'll update the screenshots + details in the OP
Extra Notes regarding payment: There is regression, so I've accounted for that in the payment summary. Closing since everyone who is paid in Upwork has been sent one there.
There is an additional amount for the extra work as discussed here: #35532 (comment)
Activity
melvin-bot commentedon Feb 1, 2024
Triggered auto assignment to @alexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.puneetlath commentedon Feb 1, 2024
@NikkiWines what would you think about including the @ symbol in the auto-selection dialog. So instead of having it be:
To have it be:
So that we really reinforce this idea of the handle
ayoung19 commentedon Feb 1, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Users on the same private domain should have their domain hidden in the list of suggestions.
What is the root cause of that problem?
Currently the suggested mentions computed are displayed as is.
App/src/pages/home/report/ReportActionCompose/SuggestionMention.js
Line 303 in c675857
What changes do you think we should make in order to solve the problem?
Like already done in the
CompanyStepcomponent, theSuggestionMentioncomponent should get the user and session object from Onyx to figure out whether the user is a from a public domain. If not, the domain can be extracted withStr.extractEmailDomainfrom the session object and this value can be used to transformalternateTextinsuggestionValues.suggestedMentionsto hide the private domain before it is passed intoMentionSuggestions.We can then modify
App/src/pages/home/report/ReportActionCompose/SuggestionMention.js
Line 78 in c675857
What alternative solutions did you explore? (Optional)
The above proposal has a little bit of duplicate logic that's spread out in an attempt to lower the risk of regressions, as the underlying data (which may be used in many other places) remains the same. Only
alternateTextinsuggestionValues.suggestedMentionsand behavior ofinsertSelectedMentionare changed, both of which are self contained changes that won't propagate too far.An alternative solution is to modify how the
suggestionValuesstate is set.getMentionOptionscan be modified to correctly compute the correctalternateTextandloginvalues of a suggestion. This may have a higher chance of causing a regression.NikkiWines commentedon Feb 1, 2024
I'm fine with it! I based this issue on what we have currently in product and also what Slack does.
But, since the autocomplete mention in the message draft prepends
@, and we see it in the actual mention, I think it'd be fine to display it in the search as well. I'll update the screenshots + details in the OPNikkiWines commentedon Feb 1, 2024
@puneetlath do you think we should also highlight the
@in the search or do you think it's fine as it is in this screenshotpuneetlath commentedon Feb 2, 2024
I think that screenshot looks good! We can get some design team feedback too if you'd like.
alexpensify commentedon Feb 2, 2024
@NikkiWines - let me know if you want me to run this over to Design and then I can assign
external. Thanks!NikkiWines commentedon Feb 2, 2024
Always get to get a once over by the experts! Let's grab someone from design to give things a look just to be certain
alexpensify commentedon Feb 6, 2024
I asked for feedback here:
https://expensify.slack.com/archives/C03TME82F/p1707179243394239
59 remaining items
alexpensify commentedon Mar 13, 2024
I'm going to work on the payment process tomorrow-- I need to review the payment details here.
alexpensify commentedon Mar 15, 2024
Here is the payment summary:
Upwork Job: https://www.upwork.com/jobs/~01c84c193620b0a5db
Extra Notes regarding payment: There is regression, so I've accounted for that in the payment summary. Closing since everyone who is paid in Upwork has been sent one there.
There is an additional amount for the extra work as discussed here: #35532 (comment)
allroundexperts commentedon Mar 17, 2024
Hi @alexpensify!
I think you forgot to account for #35532 (comment) in the payment summary?
alexpensify commentedon Mar 18, 2024
@allroundexperts - thanks for the reminder. I'll work on this update later today.
alexpensify commentedon Mar 19, 2024
I've updated the payment summary:
#35532 (comment)
alexpensify commentedon Mar 19, 2024
Alright, closing again - the summary and the payment in Upwork has been updated accordingly.
JmillsExpensify commentedon Mar 22, 2024
$375 approved for @allroundexperts based on summary.