Skip to content

[$1000] Web - User details tooltip in workspace members list is different #22062

Closed

Description

@kbecciv

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to any workspace
  2. Go to members
  3. Hover over the members icon

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?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

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
  • Upwork Job URL: https://www.upwork.com/jobs/~01c11ba48600bf6205
  • Upwork Job ID: 1676186298947235840
  • Last Price Increase: 2023-07-04

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 2, 2023
  2. melvin-bot commented on Jul 2, 2023

    @melvin-bot

    Triggered auto assignment to @dylanexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. melvin-bot commented on Jul 2, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. kbecciv commented on Jul 2, 2023

    @kbecciv
    Author

    Proposal

    Please 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 <OptionRow/> here

    <OptionRow
    boldStyle
    isDisabled={disabled}
    option={{
    text: props.formatPhoneNumber(item.displayName),
    alternateText: props.formatPhoneNumber(item.login),
    participantsList: [item],
    icons: [
    {
    source: UserUtils.getAvatar(item.avatar, item.accountID),
    name: item.login,
    type: CONST.ICON_TYPE_AVATAR,
    },
    ],
    keyForList: item.accountID,
    }}
    onSelectRow={() => toggleUser(item.accountID, item.pendingAction)}
    />

    The icons prop is passed to <OptionRow/> which passes the data in icons prop to <MultipleAvatar/> component which finally renders the <UserDetailsTooltip/>

    <UserDetaisTooltip/> fetches the display name using the accountID which it expects in its icons prop.

    displayName: ReportUtils.getDisplayNameForParticipant(props.icons[0].id),

    So when we don't pass accountID in the icons prop of <OptionRow/>, missing id field finally lands in <UserDetailsTooltip/> because of which it fails to render the display name.

    What changes do you think we should make in order to solve the problem?

    As explained above, icons prop expects an id field which carries accountID for that member, so we need to provide that.
    We are using item object to render details of each member which already has the accountID stored in it. We are also using that accountID to fetch the avatar of that member. So along with that, we can pass it to icons prop too to solve our issue.

    <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)}
    />
    Results
    bandicam.2023-07-01.15-17-29-480.mp4

    What alternative solutions did you explore? (Optional)

    None

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 4, 2023
  6. changed the title [-]Web - User details tooltip in workspace members list is different[/-] [+][$1000] Web - User details tooltip in workspace members list is different[/+] on Jul 4, 2023
  7. melvin-bot commented on Jul 4, 2023

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 4, 2023
  9. melvin-bot commented on Jul 4, 2023

    @melvin-bot

    Current assignee @dylanexpensify is eligible for the External assigner, not assigning anyone new.

  10. melvin-bot commented on Jul 4, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External)

  11. daordonez11 commented on Jul 5, 2023

    @daordonez11
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    The tooltip in the WorkspaceMembersPage is missing displayName

    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 MultipleAvatars in my previous PR, but the actual issue is not sending the id, the real issue here is the inconsistency between different pages and components and duplicated code. My original issue was in the search page. Even though sending the id is a workaround, the problem is not reusing the code that already exists for solving this: getIcons in the ReportUtils class, in the future someone could change the code and cause a side effect like this again. Hence, avoiding the anti-pattern of duplicating code is my suggestion. In the future if we want to change how the icon information is loaded we only have to change a single place for easier refactors. The root cause is this commit where getDisplayNameForParticipant was updated to depend on accountID instead of login, that change introduced this issue.

    What changes do you think we should make in order to solve the problem?

    Remove the manual creation of the icons in WorkspaceMembersPage

    <OptionRow
    boldStyle
    isDisabled={disabled}
    option={{
    text: props.formatPhoneNumber(item.displayName),
    alternateText: props.formatPhoneNumber(item.login),
    participantsList: [item],
    icons: [
    {
    source: UserUtils.getAvatar(item.avatar, item.accountID),
    name: item.login,
    type: CONST.ICON_TYPE_AVATAR,
    },
    ],
    keyForList: item.accountID,
    }}
    onSelectRow={() => toggleUser(item.accountID, item.pendingAction)}
    />

    And reuse the util code in ReportUtils

    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.webm

    What alternative solutions did you explore? (Optional)

    Just proposing to avoid code duplication no other alternatives explored.

  12. 53 remaining items

  13. melvin-bot commented on Jul 30, 2023

    @melvin-bot

    @amyevans @rushatgabhane @chiragxarora @dylanexpensify this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:

    • Decide whether any proposals currently meet our guidelines and can be approved as-is today
    • If no proposals meet that standard, please take this issue internal and treat it as one of your highest priorities
    • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

    Thanks!

  14. added
    InternalRequires API changes or must be handled by Expensify staff
    and removed
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 30, 2023
  15. melvin-bot commented on Jul 30, 2023

    @melvin-bot

    Current assignee @rushatgabhane is eligible for the Internal assigner, not assigning anyone new.

  16. dylanexpensify commented on Jul 31, 2023

    @dylanexpensify
    Contributor
  17. amyevans commented on Jul 31, 2023

    @amyevans
    Contributor

    @dylanexpensify this bug was fixed elsewhere, can you pay the $250 reporting bonus and then we can close this out?

  18. chiragxarora commented on Jul 31, 2023

    @chiragxarora
    Contributor

    Hello all,
    These bugs were fixed by another pr but I proposed the solutions weeks before, also I was assigned the issue too?
    And delay was due to proposal review process.

    cc @grgia @0xmiroslav

  19. chiragxarora commented on Jul 31, 2023

    @chiragxarora
    Contributor

    Also, there are 2 bug reports not one😅
    This and #22376
    Both of these were present before any of the tool tip refactoring happened

  20. dylanexpensify commented on Aug 3, 2023

    @dylanexpensify
    Contributor

    Yes! @chiragxarora will pay out for both

  21. dylanexpensify commented on Aug 3, 2023

    @dylanexpensify
    Contributor

    Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringInternalRequires API changes or must be handled by Expensify staff

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions