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-03-16] [$2000] Web - Emoji - There is no tooltip for the category picker #15108

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

Comments

@kbecciv
Copy link

kbecciv commented Feb 13, 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!


Issue found when executing PR #14532

Action Performed:

  1. Go to staging.new.expensify.com
  2. Log in with any account
  3. Go to any conversation
  4. Select emoji option
  5. Hovering on one of the option

Expected Result:

When hovering over one of the category pickers, a tooltip containing the name of the category should appear.

Actual Result:

There is no tooltip for the category picker

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

Reproducible in staging?: Yes

Reproducible in production?: No - New feature

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

image

Recording.2152.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010a0b351e969622b9
  • Upwork Job ID: 1625929024649732096
  • Last Price Increase: 2023-02-22
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 13, 2023
@melvin-bot melvin-bot bot locked and limited conversation to collaborators Feb 13, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Feb 13, 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

@trjExpensify
Copy link
Contributor

This is a recent feature we released here, asking in this thread on the expected behaviour.

@JmillsExpensify
Copy link

Great catch, I agree with Applause that we just overlooked this and should close the gap.

@trjExpensify
Copy link
Contributor

Alrighty, moving it on. CC: @stitesExpensify for vis

@trjExpensify trjExpensify added the External Added to denote the issue can be worked on by a contributor label Feb 15, 2023
@melvin-bot melvin-bot bot unlocked this conversation Feb 15, 2023
@melvin-bot melvin-bot bot changed the title Web - Emoji - There is no tooltip for the category picker [$1000] Web - Emoji - There is no tooltip for the category picker Feb 15, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~010a0b351e969622b9

@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

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

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

@daraksha-dk
Copy link
Contributor

daraksha-dk commented Feb 15, 2023

Proposal

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

There is no tooltip present for category shortcut icons

What is the root cause of that problem?

This is happening because we were not using Tooltip initially for these icons. (This is more like a feature request or improvement)

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

To fix this we need to first pass the translation key for all the category headers here.
We can get the values similar to how we're getting headerIndices - by creating a utility function in EmojiUtils to get all the headerCodes from emojis.js

// Example Code for EmojiUtils.js
function getHeaderCodes(emojis, headerIndices = []) {
    return _.map(!_.isEmpty(headerIndices) ? headerIndices : getHeaderIndices(emojis), headerIndex => emojis[headerIndex].code);
}

We'll be using the above function inside EmojiPickerMenu/index.js & the same can be used inside native as well

// Example code
       this.headerIndices = EmojiUtils.getHeaderIndices(allEmojis);
       this.headerCodes = EmojiUtils.getHeaderCodes(allEmojis, this.headerIndices);

After that we need to use Tooltip component in CategoryShortcutButton with the required props.

Result

demo-emoji-tooltip.mp4

@PrashantMangukiya
Copy link
Contributor

Proposal

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

Within web we have to show tooltip when mouse over on emoji picker category icon.

What is the root cause of that problem?

Tooltip not used within <CategoryShortcutButton> so it will not show tooltip whenever mouse over the cateogry icon.

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

I think solution is pretty simple and clean as explained below:

Within src/components/EmojiPicker/CategoryShortcutBar.js file we already have an array of category icons as shown below.

const icons = [Smiley, AnimalsAndNature, FoodAndDrink, TravelAndPlaces, Activities, Objects, Symbols, Flags];
// If the user has frequently used emojis, there will be 9 headers, otherwise there will be 8
if (props.headerIndices.length === 9) {
icons.unshift(FrequentlyUsed);
}

So within src/components/EmojiPicker/CategoryShortcutBar.js file we have to create 1) Another array that consist translation keys corresponding to category icons and 2) Add translation key for "Frequently used" section if exist and 3) pass new prop named tooltipText to <CategoryShortcutButton> component as shown code below:

const CategoryShortcutBar = (props) => {
     const icons = [Smiley, AnimalsAndNature, FoodAndDrink, TravelAndPlaces, Activities, Objects, Symbols, Flags];
    
    // *** Add this code ***
    // Prepare array of translation keys to show as tooltip for each category icon
    const tooltipTextKeys = _.map([
        'smileysAndEmotion',
        'animalsAndNature',
        'foodAndDrink',
        'travelAndPlaces',
        'activities',
        'objects',
        'symbols',
        'flags',
    ], item => `emojiPicker.headers.${item}`);

    // If the user has frequently used emojis, there will be 9 headers, otherwise there will be 8
    if (props.headerIndices.length === 9) {
        icons.unshift(FrequentlyUsed);
        tooltipTextKeys.unshift('emojiPicker.headers.frequentlyUsed');    // *** Add this code ***
    }

    return (
        <View style={[styles.pt2, styles.ph4, styles.flexRow]}>
            {_.map(props.headerIndices, (headerIndex, i) => (
                <CategoryShortcutButton
                    icon={icons[i]}
                    onPress={() => props.onPress(headerIndex)}
                    key={`categoryShortcut${i}`}
                    tooltipText={props.translate(tooltipTextKeys[i])}.  // *** Add this code ***
                />
            ))}
        </View>
    );

}

Within src/components/EmojiPicker/CategoryShortcutButton.js file we have view with icon as shown below:

<View style={styles.alignSelfCenter}>
<Icon
fill={themeColors.icon}
src={this.props.icon}
height={variables.iconSizeNormal}
width={variables.iconSizeNormal}
/>
</View>

So within src/components/EmojiPicker/CategoryShortcutButton.js file we have to define new prop named tooltipText and wrap View with tooltip as shown code below:

const propTypes = {

    /** Tooltip text to show when mouse over (Add this code) */
    tooltipText: PropTypes.string.isRequired,
};

                <Tooltip
                    text={this.props.tooltipText}
                    shiftVertical={-7}
                >
                    <View style={styles.alignSelfCenter}>
                        <Icon
                            fill={themeColors.icon}
                            src={this.props.icon}
                            height={variables.iconSizeNormal}
                            width={variables.iconSizeNormal}
                        />
                    </View>
                </Tooltip>

So this solution is efficient and requires minimum code changes.

It will also take care to show tooltip in corresponding language when language changed as shown in result video below. Also it will keep button size consistent in all platform as other platform does not show tooltip.

What alternative solutions did you explore? (Optional)

None

Result video:

Web
Web.mp4
iOS
iOS.mov
Android
Android.mov

@melvin-bot melvin-bot bot added the Overdue label Feb 17, 2023
@trjExpensify
Copy link
Contributor

@aimane-chnaif what do you think of this proposal?

@melvin-bot melvin-bot bot removed the Overdue label Feb 20, 2023
@JmillsExpensify JmillsExpensify self-assigned this Feb 20, 2023
@JmillsExpensify
Copy link

Assigning myself as well so I can keep track of this one as part of the tracking issue.

@melvin-bot melvin-bot bot changed the title [$1000] Web - Emoji - There is no tooltip for the category picker [$2000] Web - Emoji - There is no tooltip for the category picker Feb 22, 2023
@aimane-chnaif
Copy link
Contributor

@shawnborton which one is preferred?

no space:
0px

2px:
2px

4px:
4px

@akshayasalvi
Copy link
Contributor

@aimane-chnaif Based on this comment and this response, should we go ahead with 2px? And complete the checklist ?

Or do you recommend waiting more?

@aimane-chnaif
Copy link
Contributor

Let's wait a bit more until design confirmation.
Btw, I like 2px too

@akshayasalvi
Copy link
Contributor

@aimane-chnaif I've update the change to have 2px. Because it was somewhat agreed earlier and you're also okay with it. Just to ensure that if I am offline later (and we get confirmation), it shouldn't block you from testing. If changes are requested, for 0px or 4px, I'll try to do them asap.

Meanwhile, is there any other change/feedback that needs to be worked upon? I am online for a few hours, so I can close them. Thank you very much for your time.

@aimane-chnaif
Copy link
Contributor

@aimane-chnaif I've update the change to have 2px. Because it was somewhat agreed earlier and you're also okay with it. Just to ensure that if I am offline later (and we get confirmation), it shouldn't block you from testing. If changes are requested, for 0px or 4px, I'll try to do them asap.

Meanwhile, is there any other change/feedback that needs to be worked upon? I am online for a few hours, so I can close them. Thank you very much for your time.

I've already done reviewing and testing and after design confirmation, ready to fill checklist and approve on my side immediately.
But there might be suggested changes from @stitesExpensify

@akshayasalvi
Copy link
Contributor

@aimane-chnaif Can you add @stitesExpensify as a reviewer? When I requested your review again I don't know how it removed them. I can't seem to be able to add anybody.

@aimane-chnaif
Copy link
Contributor

@aimane-chnaif Can you add @stitesExpensify as a reviewer? When I requested your review again I don't know how it removed them. I can't seem to be able to add anybody.

I also don't have permission. It's not your mistake. It often happens so seems github automation bug.

@shawnborton
Copy link
Contributor

I think I like 4px since that is a standard spacing unit for us.

@akshayasalvi
Copy link
Contributor

@shawnborton Okay I've updated the spacing to 4px.

Screenshot 2023-03-02 at 7 05 31 PM

cc - @aimane-chnaif if you want to test again.

@stitesExpensify
Copy link
Contributor

For clarity for the bugZero assignee (@trjExpensify) we had this on hold, and then I was OOO and delayed the merging of this. This issue should be eligible for the speed bonus

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Mar 9, 2023
@melvin-bot melvin-bot bot changed the title [$2000] Web - Emoji - There is no tooltip for the category picker [HOLD for payment 2023-03-16] [$2000] Web - Emoji - There is no tooltip for the category picker Mar 9, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 9, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Mar 9, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.80-2 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-03-16. 🎊

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

@MelvinBot
Copy link

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:

@MelvinBot
Copy link

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.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 15, 2023
@akshayasalvi
Copy link
Contributor

@trjExpensify @aimane-chnaif While this is ready for payout today, is there anything that you want me to do? I am not sure if we would treat this as a bug. This was like a feature request, and we added the category picker in this PR #14532

@stitesExpensify
Copy link
Contributor

I agree this is a feature request, not a bug

@trjExpensify
Copy link
Contributor

Yep, makes sense.

Okay, so can I confirm these are the amounts due?

@akshayasalvi
Copy link
Contributor

Yes @trjExpensify I think so :)

@trjExpensify
Copy link
Contributor

Cool, thanks. I've sent you both offers!

@akshayasalvi
Copy link
Contributor

Accepted @trjExpensify thank you.

@trjExpensify
Copy link
Contributor

Excellent, settled up!

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests