-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$1000] Web - User details tooltip in workspace members list is different #22062
Comments
Triggered auto assignment to @dylanexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.user details tooltip in workspace members list is different, display name is not present What is the root cause of that problem?Root cause of the issue is the missing accountID in the icons prop of App/src/pages/workspace/WorkspaceMembersPage.js Lines 323 to 340 in c0ece67
The icons prop is passed to
App/src/components/MultipleAvatars.js Line 83 in c0ece67
So when we don't pass accountID in the icons prop of What changes do you think we should make in order to solve the problem?As explained above, icons prop expects an <OptionRow
boldStyle
isDisabled={disabled}
option={{
text: props.formatPhoneNumber(item.displayName),
alternateText: props.formatPhoneNumber(item.login),
participantsList: [item],
icons: [
{
id: item.accountID,
source: UserUtils.getAvatar(item.avatar, item.accountID),
name: item.login,
type: CONST.ICON_TYPE_AVATAR,
},
],
keyForList: item.accountID,
}}
onSelectRow={() => toggleUser(item.accountID, item.pendingAction)}
/> Resultsbandicam.2023-07-01.15-17-29-480.mp4What alternative solutions did you explore? (Optional)None |
Job added to Upwork: https://www.upwork.com/jobs/~01c11ba48600bf6205 |
Current assignee @dylanexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The tooltip in the What is the root cause of that problem?Coming from the PR #21696, where I explain the PR that introduced this issue. I included the fix of searching by ID in What changes do you think we should make in order to solve the problem?Remove the manual creation of the icons in App/src/pages/workspace/WorkspaceMembersPage.js Lines 323 to 340 in 7e908b1
And reuse the util code in icons: ReportUtils.getIcons(undefined, props.personalDetails, UserUtils.getAvatar(item.avatar, item.accountID), false, item.login, item.accountID), Video of solution working: New.Recording.-.4_7_2023.19_37_59.webmWhat alternative solutions did you explore? (Optional)Just proposing to avoid code duplication no other alternatives explored. |
Update to proposal (can't edit myself) Improvement:
As a further edit, I suggest, EDIT: there's no reports prop for this page and that specific util is meant to be used to get icons from the report as per report type Lines 707 to 708 in 85ce1ed
We don't have individual member's report and neither we have reports array for this page and we just have policy members account ids and their personalDetails object using which we have collected the details for each member here App/src/pages/workspace/WorkspaceMembersPage.js Lines 365 to 378 in 15e547e
This data array is then added to flatlist and we render each item individually after looping over the array. This was implemented this way only because we don't have any util to provide individual report for each member in this page. That is why we can't use this Ideally we should not use this util because sending undefined report would be a bad code practice and it doesnt serve the purpose. What we could actually use is icons: ReportUtils.getIconsForParticipants([item.accountID], props.personalDetails[item.accountID]), There's some JS tweaks required because in Line 750 in 60f4817
Basically this method accepts the personal details object of type {
accountID1: {
login: ....,
avatar: ....,
},
accountID2: {
},
} So we need to pass the correct object while calling this method like this icons: ReportUtils.getIconsForParticipants([item.accountID], {[item.accountID]: props.personalDetails[item.accountID]}), |
Yeah it is actually an old method. I recommend deep diving into similar components for a more valuable proposal, Also I don't think you can just take another proposal and use it as an alternative solution. I'll just let the C+ decide which proposal is better/simpler. |
You did what is called an "expansion on a solution", even c+ members suggest such improvements at the time of PR Also, I've found the other pages too and suggested an update for that overall valuable proposal so your second comment is not valid |
How is it an expansion if it is my own solution from #21696 😂? We even have different RCA. Again, I think it is in the hands of the C+ in charge 😀 |
It's an expansion because you suggested using a util rather than handling it manually in the page itself.
Also RCA is missing accountID and not the absence of this util so your RCA is plain wrong here, read my RCA I've explained it well. (Note this C+) And it's not just about using same util everywhere for the consistency, looks like you said deep dive but didn't do it :) Go see the Let the C+ team decide, thankyou |
That is where you are wrong. Man, check my PR, you were literally one blame away from seeing that I changed the line of If you had really read my proposal you would see that it enters the first if, because here there is no report. And that I mention the migration which is the real root cause. Here is the specific commit ;) if you want more detail. The moment PS: Updated proposal. Due to the confusion decided to include more details in my root cause analysis. |
I saw that and that's why I've proposed the solution for missing accountID.
I can't explain more why these statements are technically wrong, let's wait for the review
Yes you're right about this, but you fail to understand how this change is not making the function generic (what its true purpose is). You are basically passing all the object values in function arguments and returning the formed object on first line.
This line is again very wrong! When there is any change in icon object, can you explain me how your code will handle it in a better way by making the changes on just one place like you mentioned. Say if we add an extra field to icon prop in future or update an existing field, then you will have to pass the same new/updated argument to function call in every place where the icon prop is used and you'll update the icon object in the util too. Reason this util is generic is we are using the report passed to fetch everything we need, and return from the util (go see the function signature). But you cannot do anything from the report because that is undefined in your case. You will have to pass everything that icon {} needs, explicitly in the arguments and changes will be on both the places. You are basically forcing this util here when there's no need to do so I hope you understand how your solution is a bad workaround and not what you are claiming it to be :) |
You are right! @chiragxarora. Including additional parameters isn't the solution if we want to unify it we should send the You are right the idea is to force it so it is clear whenever someone touches again this part of the code. I'm just claiming it is a different solution than yours with different purposes, as you have stated, nothing else. You were right regarding my RCA, it was a mess, that's why I updated it! Thanks for pointing that out. |
@rushatgabhane can we please get reviews? |
friendly bump: @rushatgabhane |
Alright so the App/src/pages/workspace/WorkspaceMembersPage.js Lines 327 to 328 in c0ece67
|
The problem is with App/src/components/OptionRow.js Lines 213 to 216 in c0ece67
On the other side MultipleAvatars only receives the icons prop, which doesn't even contain the displayName and builds the information manually here: App/src/components/MultipleAvatars.js Lines 72 to 87 in c0ece67
We could definitely send the displayName: props.icons[0].displayName || ReportUtils.getDisplayNameForParticipant(props.icons[0].id), For retrocompat Still the main idea is to unify the way icons are built through the different instances of |
Basically |
@amyevans @rushatgabhane @chiragxarora @dylanexpensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
Reviewing today! |
@amyevans the PR that fixed this issue and #22376 is deployed to production now Quoting thread for context |
@amyevans @rushatgabhane @chiragxarora @dylanexpensify this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks! |
@rushatgabhane @chiragxarora mind recapping where we're at here? |
I reported this current bug and #22376 and submitted the proposals along with them, then review process took a long time and like 10 days later we had this PR #20512 by @grgia which did major refactor to the tooltips. This PR kind of aggravated the above two bugs Later, this PR #22500 was raised to solve the regressions caused by the other one but this included some additional fixes which weren't related to the regression caused. These changes solved both of my bugs. I was assigned this issue late because of proposal review process and by the time I was assigned, the regression fixing PR was already open so I was told to hold mine. This slack conversation has additional context |
@chiragxarora what action is pending? Do we still need to fix this bug? |
no, the bugs are fixed as stated above |
@chiragxarora we can pay for the reporting bonus! Have you applied? |
@amyevans @rushatgabhane @chiragxarora @dylanexpensify this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks! |
Current assignee @rushatgabhane is eligible for the Internal assigner, not assigning anyone new. |
bump @chiragxarora |
@dylanexpensify this bug was fixed elsewhere, can you pay the $250 reporting bonus and then we can close this out? |
Hello all, cc @grgia @0xmiroslav |
Also, there are 2 bug reports not one😅 |
Yes! @chiragxarora will pay out for both |
Done! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
Tooltip should show display name in bold and login in gray
Actual Result:
Only login is shown in gray, no display name
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.35-5
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
bandicam.2023-07-01.13-40-56-685.1.mp4
Recording.5285.1.mp4
Expensify/Expensify Issue URL:
Issue reported by: @chiragxarora
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688199036733839
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: