Refactor task preview for hidden case#35027
Conversation
|
@hoangzinh 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] |
|
@hoangzinh I have some problems with my iOS and Android simulator. Will update the screenshot for this soon. |
| const user = lodashGet(personalDetails, htmlAttribAccountID); | ||
| accountID = parseInt(htmlAttribAccountID, 10); | ||
| displayNameOrLogin = LocalePhoneNumber.formatPhoneNumber(lodashGet(user, 'login', '')) || lodashGet(user, 'displayName', '') || translate('common.hidden'); | ||
| displayNameOrLogin = lodashGet(user, 'displayName', '') || LocalePhoneNumber.formatPhoneNumber(lodashGet(user, 'login', '')) || translate('common.hidden'); |
There was a problem hiding this comment.
Do you think we can replace this line by ReportUtils.getDisplayNameForParticipant
There was a problem hiding this comment.
Looked at getDisplayNameForParticipant function and yeah we can use this as well.
There was a problem hiding this comment.
TLDR; we tried to use getDisplayNameForParticipant but we found a bug here, so we decided to keep it as it is for now.
#35027 (comment)
| taskAssignee && taskAssigneeAccountID !== 0 | ||
| ? `<comment><mention-user accountid="${taskAssigneeAccountID}">@${taskAssignee}</mention-user> ${taskTitle}</comment>` | ||
| : `<comment>${taskTitle}</comment>`; | ||
| taskAssigneeAccountID !== 0 ? `<comment><mention-user accountid="${taskAssigneeAccountID}"></mention-user> ${taskTitle}</comment>` : `<comment>${taskTitle}</comment>`; |
There was a problem hiding this comment.
Is there any linter warning if we keep 3 lines as before instead of 1 line of code, it's hard to read code for me atm?
There was a problem hiding this comment.
It's displayed after I run prettier.
|
|
Bump @dukenv0307 just in case you missed this PR. |
I updated android vide, my IOS simulator is failing. |
It's a known bug here #31746. |
|
Oh no @dukenv0307 Lint code is failed |
|
@hoangzinh I updated, missed to remove us-use import. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-02-06.at.21.35.06.android.movAndroid: mWeb ChromeScreen.Recording.2024-02-06.at.21.29.19.android.chrome.moviOS: NativeScreen.Recording.2024-02-06.at.21.30.42.ios.moviOS: mWeb SafariScreen.Recording.2024-02-06.at.21.33.57.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-02-06.at.21.24.13.web.movMacOS: DesktopScreen.Recording.2024-02-06.at.21.25.01.desktop.mov |
|
@dukenv0307 are you able to reproduce this bug now? |
|
@hoangzinh Still able to reproduce this bug on the latest main. |
|
@hoangzinh The screenshot here. Not sure how BE implements the logic now. For some account it returns personal detail but sometimes it not. Screen.Recording.2024-01-30.at.18.03.46.mov |
| const user = lodashGet(personalDetails, htmlAttributeAccountID); | ||
| accountID = parseInt(htmlAttributeAccountID, 10); | ||
| displayNameOrLogin = LocalePhoneNumber.formatPhoneNumber(lodashGet(user, 'login', '')) || lodashGet(user, 'displayName', '') || translate('common.hidden'); | ||
| displayNameOrLogin = ReportUtils.getDisplayNameForParticipant(accountID); |
There was a problem hiding this comment.
it looks like we need to revert this change. I tested a case that:
We have 3 users, UserA, UserB and UserC. UserA and UserB already chatted. But they haven't chatted with UserC
- UserA open chat with UserB
- UserA create a task, assign to UserC and shared in chat with UserB
- Login in UserB and open chat with UserA
But if I visit a task, and then back, it displays "Hidden"

I think it's because of this logic
Lines 1615 to 1621 in d5eba65
There was a problem hiding this comment.
@hoangzinh Thanks for your testing, I reverted.
There was a problem hiding this comment.
There are lint errors here. Could you help to recheck? Thanks
hoangzinh
left a comment
There was a problem hiding this comment.
LGTM, I still reproduce this issue with the email in the GH issue description yonghongkok2+03011@gmail.com
|
🚀 Deployed to staging by https://github.com/grgia in version: 1.4.38-0 🚀
|
|
🚀 Deployed to staging by https://github.com/grgia in version: 1.4.38-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.38-6 🚀
|
|
@dukenv0307 @hoangzinh I think this may have caused a regression in #36443. Could you take a look? Thanks! |
|
@jjcoffee No, I don't think so. I think it's a regression from https://github.com/Expensify/App/pull/35462/files#diff-a4fc8bbb64960d70ffb3c3d2b6dae62c6881855d6e3c66d9e3b5976441832b3dR42, this PR changed the order |


Details
Refactor task preview for hidden case
Fixed Issues
$ #34052
PROPOSAL: #34052 (comment)
Tests
Offline tests
None
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.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 so 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
Screen.Recording.2024-01-28.at.20.08.44.mov
Android: mWeb Chrome
Screen.Recording.2024-01-24.at.11.17.38.mov
iOS: Native
iOS: mWeb Safari
Screen.Recording.2024-01-24.at.11.10.58.mov
MacOS: Chrome / Safari
Screen.Recording.2024-01-24.at.11.05.50.mov
MacOS: Desktop
Screen.Recording.2024-01-24.at.11.28.37.mov