-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[ON HOLD FOR #40565 ][$250] Group chat - User mention is not copied when copying "made an admin" whisper to clipboard #40477
Comments
Triggered auto assignment to @francoisl ( |
Triggered auto assignment to @isabelastisser ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
@isabelastisser FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors. |
We think this bug might be related to #vip-vsb |
I feel like this has to do more with how we copy text from mentions specifically, because the message is in the format Not sure it needs to be a blocker as it doesn't stop you from doing anything critical though. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Group chat - User mention is not copied when copying "made an admin" whisper to clipboard What is the root cause of that problem?Mentioned user come from backend with different format unlike what we handle it now when get message text to copy it to clipboard. App/src/pages/home/report/ContextMenu/ContextMenuActions.tsx Lines 395 to 398 in 9b839f4
<mention-user accountID=123></mention-user> // formate in this issue
<mention-user>@login</mention-user> // current formate we handle it in copy to clipboard now What changes do you think we should make in order to solve the problem?We need to handle this format by edit this // content.replace(/(<mention-user>)(.*?)(<\/mention-user>)/gi, (match, openTag, innerContent, closeTag): string => {
content.replace(/(<mention-user(?:\s+accountID=(\d*))?>)(.*?)(<\/mention-user>)/gi, (match, openTag, accountID, innerContent, closeTag): string => {
// const modifiedContent = Str.removeSMSDomain(innerContent) || '';
let modifiedContent = Str.removeSMSDomain(innerContent) || '';
if (accountID && !modifiedContent){
// get mentionDisplayText by accountID
// I explained below how to get mentionDisplayText
const modifiedContent = `@${mentionDisplayText};
}
return openTag + modifiedContent + closeTag || '';
})
how to get App/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx Lines 62 to 63 in 9b839f4
const currentUserAccountID = getCurrentUserAccountID();
const [user, currentUser] = getPersonalDetailsByIDs([accountID, currentUserAccountID]);
let mentionDisplayText = LocalePhoneNumber.formatPhoneNumber(user?.login ?? '') || PersonalDetailsUtils.getDisplayNameOrDefault(user);
if (LoginUtils.areEmailsFromSamePrivateDomain(mentionDisplayText, currentUser.login ?? '')) {
mentionDisplayText = mentionDisplayText.split('@')[0];
} We can improve the code logic in the PR, I just keep it simple for explanation. What alternative solutions did you explore? (Optional)we can pass the second parameter and these are the full changes
function getAccountIDToName(currentUserAccountID: number): Record<string, string> | undefined {
const accountIDToName: Record<string, string> = {};
const [currentUser] = getPersonalDetailsByIDs([currentUserAccountID], currentUserAccountID);
Object.values(personalDetails ?? {}).forEach((detail: OnyxEntry<PersonalDetails>) => {
if (detail?.accountID){
let mentionDisplayText = LocalePhoneNumber.formatPhoneNumber(detail?.login ?? '') || getDisplayNameOrDefault(detail);
if (LoginUtils.areEmailsFromSamePrivateDomain(mentionDisplayText, currentUser.login ?? '')) {
mentionDisplayText = mentionDisplayText.split('@')[0];
}
accountIDToName[detail?.accountID] = mentionDisplayText;
}
});
return accountIDToName;
}
function setClipboardMessage(content: string) {
const parser = new ExpensiMark();
const accountIDToName = PersonalDetailsUtils.getAccountIDToName(getCurrentUserAccountID());
if (!Clipboard.canSetHtml()) {
Clipboard.setString(parser.htmlToMarkdown(content, {accountIDToName}));
} else {
const plainText = parser.htmlToText(content, {accountIDToName});
Clipboard.setHtml(content, plainText);
}
}
also result Screen.Recording.2024-05-06.at.7.28.41.AM.mov |
I don't think this worth blocking deploy over so gonna demote. Also can we check to see if the behavior works for Rooms? If not, then it's more or less something we haven't built out yet. @francoisl if you want me to grab this I can as it's related to Group Chats. |
@marcaaron if you have the bandwidth, yes feel free to grab this one 🙏 I'm still catching up on some overdue issues from OOO. |
I'm guessing it's something we just haven't built yet for accountID-based mentions. |
@marcaaron, are you able to work on this? |
Yeah, let's put an |
@ahmedGaber93 's proposal looks good to me. I think we should go with the alternative solution to fix this issue in Though the solution of #40403 is similar to this one, they don't share same code - they're handled case by case according to the pattern of 🎀👀🎀 C+ reviewed |
Current assignee @marcaaron is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
Curious to get @puneetlath's input here on that proposal.
I'm not sure if I agree with this statement. We should be trying to write solutions that are holistic wherever possible. Having two separate implementations doing very similar stuff feels like we can come up with one proposal. We can still treat them like two separate bugs (and get paid for both) - but let's work on the solution a bit more. @ahmedGaber93 What do you think about that? |
@marcaaron Yes I agree, the holistic plan makes the development process easier, as the both fixes have the same fix pattern (but not the same code), so I agree to fixing them in one PR in expensify-common and expensify repo. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
I also agree to fix them together in one PR. Let me summarise a bit on what the similar fix pattern looks like.
Currently, I think it looks fine to handle the two mentions in two different tags, @marcaaron What do you think? |
Yeah that's the general approach I'd take. But I'd like to get @puneetlath's feedback before moving forward. They implemented this feature originally so I think they should have the best context and final say. I don't think this is particularly urgent so let's give it a bit of time. |
Not overdue, we're waiting for @puneetlath 's input. |
That makes sense to me. @robertKozik @rlinoz have we done similar elsewhere? |
I think we haven't used the |
Yes, I've introduced |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@marcaaron Should we put this issue and #40403 on hold for #40565? |
@isabelastisser @marcaaron @eh2077 this issue is now 4 weeks old, please consider:
Thanks! |
@marcaaron, can I put this on hold based on the comments above? |
cc @eh2077 |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
2 similar comments
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.63-0
Reproducible in staging?: y
Reproducible in production?: No
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):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:
Action Performed:
Expected Result:
The user mention in the whisper is copied.
Actual Result:
The user mention in the whisper is not copied.
The user mention is also missing in LHN.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6453668_1713448661144.20240418_215156.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: