Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.36k stars 2.78k forks source link

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

Closed kbecciv closed 1 year ago

kbecciv commented 1 year ago

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?

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

https://github.com/Expensify/App/assets/93399543/896c10f0-52e0-49b5-9cb5-3e5fd401cf9e

https://github.com/Expensify/App/assets/93399543/b20c580c-b334-4d28-8dd0-487f95ad4d10

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
melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

esh-g commented 1 year ago

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 https://github.com/Expensify/App/blob/8acc63040d8257859f988ff7b9804fea3acffc15/src/components/MoneyRequestConfirmationList.js#L321-L335

  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). https://github.com/Expensify/App/blob/8acc63040d8257859f988ff7b9804fea3acffc15/src/components/MoneyRequestConfirmationList.js#L209

  4. Modify the displayNamesWithTooltips variable in OptionRow.js to take this.props.option if this.props.option.participantList is undefined https://github.com/Expensify/App/blob/8acc63040d8257859f988ff7b9804fea3acffc15/src/components/OptionRow.js#L134-L136 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.

  5. (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

https://github.com/Expensify/App/assets/77237602/724471be-da39-440c-b33c-f257140a02ae

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[bot] commented 1 year ago

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 commented 1 year ago

I think this is the same as - https://github.com/Expensify/App/issues/20086 - asking

esh-g commented 1 year ago

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

Christinadobrzyn commented 1 year ago

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

I can reproduce - adding external label

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

Christinadobrzyn commented 1 year ago

waiting on proposals

esh-g commented 1 year ago

https://github.com/Expensify/App/issues/20052#issuecomment-1573716590

@eVoloshchak @Christinadobrzyn bump on proposal review πŸ˜‡

jeet-dhandha commented 1 year ago

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:

https://github.com/Expensify/App/assets/78416198/4ed9c46f-445b-496e-8a3c-a6f02e95d38b

After Fix:

https://github.com/Expensify/App/assets/78416198/4785ae10-0d69-4341-9d51-785ee74421b9

What alternative solutions did you explore? (Optional)

N/A

cristipaval commented 1 year ago

@eVoloshchak has to review the proposals

melvin-bot[bot] commented 1 year ago

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

Christinadobrzyn commented 1 year ago

@eVoloshchak let us know if you'd like to see more proposals! Thanks!

eVoloshchak commented 1 year ago

@esh-g's proposal looks good to me!

MoneyRequestConfirmationList.js was recently refactored, so exact prop names in proposal are outdated, but I agree with the general approach

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed! cc: @cristipaval

jeet-dhandha commented 1 year ago

@eVoloshchak Please atleast look at my review even if you don't accept it πŸ‘ .

melvin-bot[bot] commented 1 year ago

πŸ“£ @esh-g You have been assigned to this job by @cristipaval! Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

esh-g commented 1 year ago

@cristipaval @eVoloshchak PR is here: https://github.com/Expensify/App/pull/20746

jeet-dhandha commented 1 year ago

@eVoloshchak https://github.com/Expensify/App/issues/20052#issuecomment-1585568107 - Please review and comment on my proposal as where the code is going wrong or right. So that i know how to give my proposals better next time.

melvin-bot[bot] commented 1 year ago

🎯 ⚑️ 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 πŸŽ‰

On to the next one πŸš€

eVoloshchak commented 1 year ago

@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 commented 1 year ago

moving to weekly while PR is reviewed

eVoloshchak commented 1 year ago

PR was merged yesterday, will be deployed to staging soon

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

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

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.

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

melvin-bot[bot] commented 1 year ago

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 commented 1 year ago

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

esh-g commented 1 year ago

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

Nathan-Mulugeta commented 1 year ago

Bumping to remind about payment @Christinadobrzyn

Christinadobrzyn commented 1 year ago

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 commented 1 year ago

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

Christinadobrzyn commented 1 year ago

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 commented 1 year ago

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

eVoloshchak commented 1 year ago

Requested the payment via NewDot

Christinadobrzyn commented 1 year ago

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?

eVoloshchak commented 1 year ago

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 commented 1 year ago

Paid @eVoloshchak