[Mentions v2] Support mentions in editing comments#40565
[Mentions v2] Support mentions in editing comments#40565rlinoz merged 21 commits intoExpensify:mainfrom
Conversation
| return; | ||
| } | ||
|
|
||
| reportIDToNameMap[report.reportID] = report.reportName ?? report.displayName ?? report.reportID; |
There was a problem hiding this comment.
Not sure if we should fallback to id, but we did it before so should be fine
There was a problem hiding this comment.
Yes, I think it makes sense to fallback to reportID. And if we would prefer reportID to empty string "", then we can use logical OR || and add comment to disable lint check
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
There was a problem hiding this comment.
Out of curiosity, do you know when displayName is filled?
There was a problem hiding this comment.
tbh I don't know 😅 It's useful for the users but I'm not sure about the rooms
# Conflicts: # src/libs/ReportUtils.ts
|
@abdulrahuman5196 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] |
# Conflicts: # src/pages/tasks/NewTaskDetailsPage.tsx
|
I am assuming this PR is on hold. Do let me know otherwise or once it comes to review |
# Conflicts: # src/libs/ReportUtils.ts
# Conflicts: # src/libs/ReportUtils.ts # src/pages/tasks/TaskDescriptionPage.tsx
@abdulrahuman5196 PR is ready for review :) |
# Conflicts: # src/components/LHNOptionsList/OptionRowLHN.tsx # src/hooks/useCopySelectionHelper.ts # src/hooks/useHtmlPaste/index.ts # src/pages/PrivateNotes/PrivateNotesEditPage.tsx # src/pages/RoomDescriptionPage.tsx # src/pages/home/report/ContextMenu/ContextMenuActions.tsx # src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx # src/pages/home/report/ReportActionItemMessageEdit.tsx # src/pages/tasks/TaskDescriptionPage.tsx # src/pages/workspace/taxes/NamePage.tsx
|
@eh2077 I've just merged the main and all issues should be fixed 🎉 It's ready for review now :) |
|
I'm working on the checklist |
Reviewer Checklist
Screenshots/VideosAndroid: Native0-android.mp4Android: mWeb Chrome0-mobile-chrome.mp4iOS: Native0-ios.mp4iOS: mWeb Safari0-mobile-safari.mp4MacOS: Chrome / Safari0-web.mp4MacOS: Desktop0-desktop.mp4 |
|
I was doing some tests and it looks like we re=render everything that uses Am I missing something? |
|
@rlinoz That's a good question but I think we have to connect Onyx this way. Do you maybe have an idea of passing arguments which will not cause rerenders? |
|
Yeah, I played with this a lot today and didn't get to a good solution. Anyway, I believe that a user don't get new reports frequently enough for this to matter, so I think we should be good. The other option is to fetch only the personal details and reports for a particular message, but that is costly as well and we will have to fetch for ever parsed message, even if we got the same data for a previous one. |
Yes, I also agree to move the first version of this feature forward.
Just continue to brainstorm on @rlinoz 's idea about improving the potential performance issue. I'm not sure if we have considered just saving the text needed in the <mention-report reportID="1234" text="#room-name" />So, we won't need to pass the map. But then we'll need to update |
I think the mention with ID was an idea from the design doc. Probably @rlinoz could give more details on it. |
# Conflicts: # src/libs/ReportUtils.ts
As the text can be changed by the user over time, we'll need to check and map it to the correct text by ID. That being said, saving the text in the tag doesn’t seem to offer any advantages. |
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 1.4.84-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.84-3 🚀
|
| return; | ||
| } | ||
|
|
||
| accountIDToNameMap[personalDetails.accountID] = personalDetails.login ?? String(personalDetails.accountID); |
There was a problem hiding this comment.
It doesn't make sense to use accountID as fallback.
Later, it caused #45259.
We fixed it by setting it as empty string as fallback to show "Hidden"
Details
Fixed Issues
$ #39550
PROPOSAL:
Tests
Edit commentPrivate notesand verify that editing mentions works correctlyOffline tests
QA Steps
Edit commentPrivate notesand verify that editing mentions works correctlyPR 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.-.native.mov
Android: mWeb Chrome
Screen.Recording.Apr.22.mov
iOS: Native
ios.-.native.mov
iOS: mWeb Safari
ios.-.web.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov