-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
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. |
@@ -41,7 +41,7 @@ function MentionUserRenderer(props) { | |||
if (!_.isEmpty(htmlAttribAccountID)) { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we can replace this line by ReportUtils.getDisplayNameForParticipant
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.
Looked at getDisplayNameForParticipant
function and yeah we can use this as well.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -60,7 +57,7 @@ function MentionUserRenderer(props) { | |||
if (!_.isEmpty(htmlAttributeAccountID)) { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
const formattedLogin = LocalePhoneNumber.formatPhoneNumber(personalDetails.login || ''); | |
// This is to check if account is an invite/optimistically created one | |
// and prevent from falling back to 'Hidden', so a correct value is shown | |
// when searching for a new user | |
if (personalDetails.isOptimisticPersonalDetail === true) { | |
return formattedLogin; | |
} |
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.
@hoangzinh Thanks for your testing, I reverted.
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.
There are lint errors here. Could you help to recheck? Thanks
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.
@hoangzinh I fixed.
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, I still reproduce this issue with the email in the GH issue description [email protected]
🚀 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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 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
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