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.48k stars 2.84k forks source link

[HOLD for payment 2024-03-14] [$500] Emoji picker - Highlight is removed from emoji when scrolling up with up key #36883

Closed kbecciv closed 6 months ago

kbecciv commented 8 months 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!


Version Number: v1.4.43-0 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4168711 Issue reported by: Applause - Internal Team

Action Performed:

  1. Open emoji picker
  2. Press down key till the first two rows of 'Smileys & Emotions' emoji section is hidden
  3. Then press up key till you reach the first two rows that were hidden from view

Expected Result:

Highlight should be applied on emoji that the user has navigated too

Actual Result:

Highlight is not applied on emoji that the user has navigated too

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/93399543/cb0142e7-6c11-43c5-8db8-2035d3043830

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b2c7f05245fc734a
  • Upwork Job ID: 1760053354078916608
  • Last Price Increase: 2024-02-20
  • Automatic offers:
    • Pujan92 | Contributor | 0
    • shubham1206agra | Contributor | 0
melvin-bot[bot] commented 8 months ago

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

kbecciv commented 8 months ago

We think that this bug might be related to #vip-vsb CC @quinthar

kbecciv commented 8 months ago

@puneetlath I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

Krishna2323 commented 8 months ago

Proposal

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

Emoji picker - Highlight is removed from emoji when scrolling up with up key

What is the root cause of that problem?

We pass block: 'nearest' to scrollIntoView function, we also have header for each emojis section, due to the header the emoji is not visible.

https://github.com/Expensify/App/blob/7430c5f93df630ed20c80caffcd5a7f05289c98c/src/components/EmojiPicker/EmojiPickerMenuItem/index.js#L71

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

Pass block: 'center' or block: 'end' to scrollIntoView function.

this.ref.scrollIntoView({block: 'center'});

Result

Use flatListRef.scrollToIndex({index, animated: true});

    useEffect(() => {
        if (focusedIndex < 0 || !emojiListRef.current) {
            return;
        }
        const calculatedOffset = Math.floor(focusedIndex / CONST.EMOJI_NUM_PER_ROW) * CONST.EMOJI_PICKER_HEADER_HEIGHT;
        scrollTo(emojiListRef, 0, calculatedOffset - CONST.EMOJI_PICKER_HEADER_HEIGHT, false);
    }, [focusedIndex, emojiListRef]);

PS: Minor edits can be made through PR phase.

melvin-bot[bot] commented 8 months ago

Job added to Upwork: https://www.upwork.com/jobs/~01b2c7f05245fc734a

melvin-bot[bot] commented 8 months ago

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

mananjadhav commented 8 months ago

@Krishna2323 I did not understand what you mean by Result Use flatListRef.scrollToIndex({index, animated: true});. But overall your proposal looks good. I tested and it worked fine.

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed.

melvin-bot[bot] commented 8 months ago

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

Pujan92 commented 8 months ago

Proposal

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

Highlighted emoji isn't scrolled when we go up

What is the root cause of that problem?

Earlier with the FlatList it was working as scrollPaddingTop added to the style of it in this PR at this place. After migrating to the FlashList it isn't working as that style(scrollPaddingTop) has been given to the parent View instead of FlashList. PR cc: @TMisiukiewicz

https://github.com/Expensify/App/blob/786b7abfeb8ffa8a7a7a691c642d332e05fa2db9/src/components/EmojiPicker/EmojiPickerMenu/index.js#L337-L342

https://github.com/Expensify/App/blob/786b7abfeb8ffa8a7a7a691c642d332e05fa2db9/src/components/EmojiPicker/EmojiPickerMenu/BaseEmojiPickerMenu.js#L129-L130

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

By looking at the FlashList repo it seems passing style won't work directly as fixed styles(style: { minHeight: 1, minWidth: 1 },) set for it. We can override the style prop with overrideProps which isn't recommended as per the doc but I am only seeing that option at the moment. Remove scrollPaddingTop from the listWrapperStyle.

overrideProps={{
    style: {
        minHeight: 1, 
        minWidth: 1,
        scrollPaddingTop: isFiltered ? 0 : CONST.EMOJI_PICKER_ITEM_HEIGHT
    }
}}
Result https://github.com/Expensify/App/assets/14358475/cbddfa7c-9b9c-452e-88be-4b320fe693ad
shubham1206agra commented 7 months ago

The solution by @Pujan92 doesn't break anything. We can go by one of the following routes in this case:

  1. Patch the flash-list to accept an extra style prop without overriding anything
  2. Use the given solution as it is. (My preferred choice as it is an edge case, and flash-list might not be changing this a lot).

In either case, I will go ahead with @Pujan92's proposal

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

melvin-bot[bot] commented 7 months ago

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] commented 7 months ago

@puneetlath, @mananjadhav Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] commented 7 months ago

πŸ“£ @Pujan92 πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer 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 πŸ“–

puneetlath commented 7 months ago

Ok let's go with option 2.

melvin-bot[bot] commented 7 months ago

πŸ“£ @shubham1206agra πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer 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 πŸ“–

melvin-bot[bot] commented 7 months ago

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

melvin-bot[bot] commented 7 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.48-0 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 2024-03-14. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 7 months 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:

puneetlath commented 7 months ago

@shubham1206agra friendly reminder about the checklist so that we can pay tomorrow.

puneetlath commented 7 months ago

@Pujan92 has been paid.

@shubham1206agra bump on the checklist! (and on accepting the offer)

shubham1206agra commented 7 months ago

@puneetlath Can you hold my payment temporarily as per https://expensify.slack.com/archives/C02NK2DQWUX/p1710150138788529?

shubham1206agra commented 7 months 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:

melvin-bot[bot] commented 7 months ago

@puneetlath, @Pujan92, @shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

puneetlath commented 7 months ago

Moving to monthly for https://github.com/Expensify/App/issues/36883#issuecomment-1998756425

shubham1206agra commented 6 months ago

@puneetlath I have discussed this internally. You may close this issue as I am keeping track of payment internally and will ask to pay once the issue is resolved. Just write in the payment summary that I have not been paid yet.

shubham1206agra commented 6 months ago

@puneetlath You can process payment here now.

puneetlath commented 6 months ago

Sent offer here: https://www.upwork.com/nx/wm/offer/101910104

Please ping me on this issue when you've accepted.

shubham1206agra commented 6 months ago

@puneetlath Accepted

puneetlath commented 6 months ago

All paid.