Skip to content
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

[HOLD for payment 2023-06-28] [$1000] Web - Details - Tooltip not present on split bill details side panel #20052

Closed
6 tasks done
kbecciv opened this issue Jun 2, 2023 · 40 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jun 2, 2023

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. Split a bill with multiple accounts
  2. Open the split bill group
  3. Click on the header to open the details side panel showing the group members
  4. Hover over the accounts and the avatars and observe there is a tooltip
  5. Go back and click on the split bill IOU card to open the details side panel
  6. Hover over the accounts and their avatars

Expected Result:

Tooltip should show up with their emails

Actual Result:

Tooltip not present on split bill details side panel

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

Reproducible in staging?: yes

Reproducible in production?: yes

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

Recording.2933.mp4
2023-05-31.09.05.43.mp4

Expensify/Expensify Issue URL:

Issue reported by: @Nathan-Mulugeta

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1685513538554379

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017795e0b76d1faee5
  • Upwork Job ID: 1665798844286881792
  • Last Price Increase: 2023-06-12
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

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

@esh-g
Copy link
Contributor

esh-g commented Jun 2, 2023

Proposal

Please re-state the problem that we are trying to solve

There are no tooltips in SplitBillDetailsPage

What is the root cause of that problem?

We have not enabled tooltips there, moreover instead of getting a list of reports, OptionsSelector is getting user details so it will not be able to generate tooltips.

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

We should make the following changes:

  1. Set showTitleTooltip prop to true in OptionsSelector in MoneyRequestConformationList.js

    <OptionsSelector
    sections={this.getSections()}
    value=""
    onSelectRow={canModifyParticipants ? this.toggleOption : undefined}
    onConfirmSelection={this.confirm}
    selectedOptions={this.getSelectedOptions()}
    canSelectMultipleOptions={canModifyParticipants}
    disableArrowKeysActions={!canModifyParticipants}
    isDisabled={!canModifyParticipants}
    boldStyle
    shouldTextInputAppearBelowOptions
    shouldShowTextInput={false}
    shouldUseStyleForChildren={false}
    optionHoveredStyle={canModifyParticipants ? styles.hoveredComponentBG : {}}
    footerContent={this.getFooterContent()}

  2. Remove isDisabled prop altogether (delete line 329) so that we can actually hover and tooltip can show.

  3. Remove isDisabled from the getSections method as well (delete line 209) for the same reason as (2).

  4. Modify the displayNamesWithTooltips variable in OptionRow.js to take this.props.option if this.props.option.participantList is undefined

    // We only create tooltips for the first 10 users or so since some reports have hundreds of users, causing performance to degrade.
    const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips((this.props.option.participantsList || []).slice(0, 10), isMultipleParticipant);
    let subscriptColor = themeColors.appBG;

    Change line 134 to the following:

const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips((this.props.option.participantsList || this.props.option.login ? [this.props.option] : []).slice(0, 10), isMultipleParticipant);

This change will make sure that the tooltips are rendered even when the option passed is not a report and is PersonalUserDetail.

  1. (Optional Change) We can modify the onSelectRow prop on line 324 in MoneyRequestConformationList to the following code, which will make us able to navigate to the details page of any user that is clicked
onSelectRow={canModifyParticipants ? this.toggleOption : option => Navigation.navigate(ROUTES.getDetailsRoute(option.login))}

After Applying these changes + optional change

Screen.Recording.2023-06-02.at.2.50.38.PM-1.mov

What alternative solutions did you explore? (Optional)

Alternatively, we can refactor the entire SplitBillDetailsPage not to use MoneyRequestConformationList and render the details like we do on DetailsPage

@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

@Christinadobrzyn
Copy link
Contributor

I think this is the same as - #20086 - asking

@esh-g
Copy link
Contributor

esh-g commented Jun 3, 2023

@Christinadobrzyn I think these are different.. This one relates to tooltip not being present and the other one is a modification for tooltip format

@melvin-bot melvin-bot bot added the Overdue label Jun 5, 2023
@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Jun 5, 2023

@esh-g you're right - these are different! Thanks for clarifying!

I can reproduce - adding external label

@melvin-bot melvin-bot bot removed the Overdue label Jun 5, 2023
@Christinadobrzyn Christinadobrzyn added the External Added to denote the issue can be worked on by a contributor label Jun 5, 2023
@melvin-bot melvin-bot bot changed the title Web - Details - Tooltip not present on split bill details side panel [$1000] Web - Details - Tooltip not present on split bill details side panel Jun 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

Job added to Upwork: https://www.upwork.com/jobs/~017795e0b76d1faee5

@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

Triggered auto assignment to @cristipaval (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot added the Overdue label Jun 7, 2023
@Christinadobrzyn
Copy link
Contributor

waiting on proposals

@melvin-bot melvin-bot bot removed the Overdue label Jun 7, 2023
@esh-g
Copy link
Contributor

esh-g commented Jun 10, 2023

#20052 (comment)

@eVoloshchak @Christinadobrzyn bump on proposal review 😇

@melvin-bot melvin-bot bot added the Overdue label Jun 10, 2023
@jeet-dhandha
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve

There are no tooltips in SplitBillDetailsPage

What is the root cause of that problem?

  1. Tooltips are not enabled. So have to fix that.
  2. There is inconsistency in the return details of participants.
  3. Numbers show @expensify.sms at the end.

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

Solution:

  1. Add showTitleTooltip prop to OptionsSelector in MoneyRequestConformationList.js.
  2. We will make few updates in OptionsListUtils.js.
    • This updates make sures that code has same common params.
import * as PersonalDetails from './actions/PersonalDetails'; // + Added

... rest code

/**
 * Get the participant options for a report.
 * @param {Object} report
 * @param {Array<Object>} personalDetails
 * @returns {Array}
 */
function getParticipantsOptions(report, personalDetails) {
    const participants = lodashGet(report, 'participants', []);
    return _.map(getPersonalDetailsForLogins(participants, personalDetails), (details) => ({
        keyForList: details.login,
        login: details.login,
        text: details.displayName,
        firstName: lodashGet(details, 'firstName', ''),
        lastName: lodashGet(details, 'lastName', ''),
        alternateText: Str.isSMSLogin(details.login || '') ? LocalePhoneNumber.formatPhoneNumber(details.login) : details.login,
        icons: [UserUtils.getUserAvatarIconObject(details.avatar, details.login)], // + Changed to a common function getUserAvatarIconObject
        payPalMeAddress: lodashGet(details, 'payPalMeAddress', ''),
        phoneNumber: lodashGet(details, 'phoneNumber', ''),
    }));
}

...rest code

// + Added Function
/**
 * @param {Object} personalDetail - personalDetail of the user
 * @return {Object} commonParams - amount of the IOU
 */
function getCommonPersonalDetails(personalDetail) {
    const displayName = PersonalDetails.getDisplayName(personalDetail.login, personalDetail);
    return {
        text: displayName,
        login: personalDetail.login,
        displayName,
        participantsList: [{login: personalDetail.login, displayName}],
        icons: [UserUtils.getUserAvatarIconObject(personalDetail.avatar, personalDetail.login)], // Used a common function getUserAvatarIconObject
    }
}

/**
 * Build the IOUConfirmation options for showing the payee personalDetail
 *
 * @param {Object} personalDetail
 * @param {String} amountText
 * @returns {Object}
 */
function getIOUConfirmationOptionsFromPayeePersonalDetail(personalDetail, amountText) {
    return {
        alternateText: personalDetail.login,
        descriptiveText: amountText,
        ...getCommonPersonalDetails(personalDetail)
    };
}

/**
 * Build the IOUConfirmationOptions for showing participants
 *
 * @param {Array} participants
 * @param {String} amountText
 * @returns {Array}
 */
function getIOUConfirmationOptionsFromParticipants(participants, amountText) {
    return _.map(participants, (participant) => ({
        ...participant,
        ...getCommonPersonalDetails(participant),
        descriptiveText: amountText,
    }));
}

...rest code
  1. We will update UserUtils.js to make sure that we have a common function to get the avatar icon object.
import * as LocalePhoneNumber from './LocalePhoneNumber'; // + Added

...rest code

/**
 * Provided a source URL, if source is a default avatar, return the associated SVG.
 * Otherwise, return the URL pointing to a user-uploaded avatar.
 *
 * @param {String} avatarURL - the avatar source from user's personalDetails
 * @param {String} login - the email of the user
 * @returns {String|Function}
 */
function getUserAvatarIconObject(avatarURL, login) {
    return {
        source: getAvatar(avatarURL, login),
        name: LocalePhoneNumber.formatPhoneNumber(login),
        type: CONST.ICON_TYPE_AVATAR,
    };
}

...rest code

export {

    ...rest code

    getUserAvatarIconObject, // + Added
};
  1. Updating ReportParticipantsPage.js to fix the @expensify.sms displaying for numbers.
// import CONST from '../CONST'; - Removed as not used

... rest code

/**
 * Returns all the participants in the active report
 *
 * @param {Object} report The active report object
 * @param {Object} personalDetails The personal details of the users
 * @return {Array}
 */
const getAllParticipants = (report, personalDetails) => {
    const {participants} = report;

    return _.chain(participants)
        .map((login) => {
            const userLogin = Str.removeSMSDomain(login);
            const userPersonalDetail = lodashGet(personalDetails, login, {displayName: userLogin, avatar: ''});

            return {
                alternateText: userLogin,
                displayName: userPersonalDetail.displayName,
                accountID: userPersonalDetail.accountID,
                icons: [UserUtils.getUserAvatarIconObject(userPersonalDetail.avatar, login)], // + Used a common function getUserAvatarIconObject
                keyForList: userLogin,
                login,
                text: userPersonalDetail.displayName,
                tooltipText: userLogin,
                participantsList: [{login, displayName: userPersonalDetail.displayName}],
            };
        })
        .sortBy((participant) => participant.displayName.toLowerCase())
        .value();
};

...rest code

Before Fix:

BeforeFix-min.mp4

After Fix:

AfterFix-min.mp4

What alternative solutions did you explore? (Optional)

N/A

@cristipaval
Copy link
Contributor

@eVoloshchak has to review the proposals

@melvin-bot melvin-bot bot removed the Overdue label Jun 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

🎯 ⚡️ Woah @eVoloshchak / @esh-g, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @esh-g got assigned: 2023-06-13 19:05:06 Z
  • when the PR got merged: 2023-06-15 16:31:45 UTC

On to the next one 🚀

@eVoloshchak
Copy link
Contributor

@jeet-dhandha, your proposal is quite similar to @esh-g's proposal, with the exception of different changes to OptionsListUtils. Generally, the first proposal to correctly identify a root cause and to propose a fix for it - is a winning proposal. In this case time was the deciding factor, since both proposals are similar and both do resolve the issue

Nonetheless, thank you for the proposal, and excited to work with you on other issues in the future!

@Christinadobrzyn Christinadobrzyn added Weekly KSv2 and removed Daily KSv2 labels Jun 16, 2023
@Christinadobrzyn
Copy link
Contributor

moving to weekly while PR is reviewed

@eVoloshchak
Copy link
Contributor

PR was merged yesterday, will be deployed to staging soon

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 21, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Details - Tooltip not present on split bill details side panel [HOLD for payment 2023-06-28] [$1000] Web - Details - Tooltip not present on split bill details side panel Jun 21, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.29-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-06-28. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@eVoloshchak] The PR that introduced the bug has been identified. Link to the PR:
  • [@eVoloshchak] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@eVoloshchak] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@eVoloshchak] Determine if we should create a regression test for this bug.
  • [@eVoloshchak] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@Christinadobrzyn] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 27, 2023
@eVoloshchak
Copy link
Contributor

I don't think the BZ checklist is applicable here, this was a feature request, not a bug

@esh-g
Copy link
Contributor

esh-g commented Jun 29, 2023

@Christinadobrzyn I have sent a proposal on upwork. Here is my profile link: https://www.upwork.com/freelancers/~0186b1d7cc69656f22

@Nathan-Mulugeta
Copy link

Nathan-Mulugeta commented Jun 29, 2023

Bumping to remind about payment @Christinadobrzyn

@Christinadobrzyn
Copy link
Contributor

So sorry for the delay on this, i don't know how I missed this payment.

Paid @esh-g for contributor + 50% speed bonus
Paid @Nathan-Mulugeta $250 as reporter

Pending hire for @eVoloshchak - you'll also have the speed bonus.

Internal job posting - https://www.upwork.com/ab/applicants/1665798844286881792/job-details
External job posting - https://www.upwork.com/ab/applicants/1665798844286881792/job-details

@eVoloshchak feel free to accept the offer when you can and I'll pay this out! Sorry again for the delay

@eVoloshchak
Copy link
Contributor

@Christinadobrzyn, no worries, thanks!
I'll request the payment via NewDot instead, in a day or two

@Christinadobrzyn
Copy link
Contributor

hey @eVoloshchak I don't think I have the ability to pay you with a company card via NewDot... is that a new thing?

@Christinadobrzyn
Copy link
Contributor

Ah, found this - https://expensify.slack.com/archives/C02NK2DQWUX/p1686871517189609 - let me know when you reach out for payment @eVoloshchak

@eVoloshchak
Copy link
Contributor

Requested the payment via NewDot

@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Jul 6, 2023

Awesome @eVoloshchak! I think this GH can be closed because I think the payment happens outside my control and through our accounting team. Do you want to confirm when you get paid and I'll keep tracking this?

Or I can close you can DM me if you don't get payment?

@Christinadobrzyn Christinadobrzyn added Weekly KSv2 and removed Daily KSv2 labels Jul 6, 2023
@eVoloshchak
Copy link
Contributor

I think this GH can be closed because I think the payment happens outside my control and through our accounting team

Yeah, this can be closed, payment has been released, we can always open if there's a problem

@anmurali
Copy link

anmurali commented Jul 7, 2023

Paid @eVoloshchak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants