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-09-27] [$1000] Chat - Hover state is shown on long hold of an emoji on emoji picker pop over #24654

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 16, 2023 · 45 comments
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

@lanitochka17
Copy link

lanitochka17 commented Aug 16, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open ND on mWeb
  2. Open any chat
  3. Click on the emoji picker
  4. Hold down on one of the emojis

Expected Result:

Hover state should not be visible on mWeb for long hold

Actual Result:

Hover state is being shown for long hold

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

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

Screen_Recording_20230807_212804_Chrome.mp4
Record_2023-08-16-23-01-44.mp4

Expensify/Expensify Issue URL:

Issue reported by: @Nathan-Mulugeta

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01efcb634d262da535
  • Upwork Job ID: 1693672410355466240
  • Last Price Increase: 2023-08-21
  • Automatic offers:
    • s-alves10 | Contributor | 26535914
    • Nathan-Mulugeta | Reporter | 26535915
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 16, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 16, 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

@bernhardoj
Copy link
Contributor

Proposal

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

Holding down the emoji item for a long time will leave a highlighted effect on the emoji.

What is the root cause of that problem?

When we hold a focusable element, it will trigger onFocus callback. I tested this on a plain HTML file and this behavior is there. onFocus will set the highlight of the focused emoji

onFocus={() => this.setState({highlightedIndex: index})}

To remove the focus, we can click/press anywhere and it will trigger onBlur to reset the highlighted index.

onBlur={() =>
this.setState((prevState) => ({
// Only clear the highlighted index if the highlighted index is the same,
// meaning that the focus changed to an element that is not an emoji item.
highlightedIndex: prevState.highlightedIndex === index ? -1 : prevState.highlightedIndex,
}))
}

On the web, even though we can focus the emoji by holding it down too, this didn't happen because we have onHoverOut that will also reset the highlighted index.

onHoverOut={() => {
if (this.state.arePointerEventsDisabled) {
return;
}
this.setState({highlightedIndex: -1});
}}

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

To also solve this issue on mWeb, we can rely on onPressOut to reset the highlighted index.

onPressOut={this.props.onHoverOut}

I think we can think of onPressOut as the equivalent of onHoverOut in this case. Technically the emoji item is not blurred, so I think calling onBlur is not correct

@melvin-bot melvin-bot bot added the Overdue label Aug 21, 2023
@zanyrenney zanyrenney added the External Added to denote the issue can be worked on by a contributor label Aug 21, 2023
@melvin-bot melvin-bot bot changed the title Chat - Hover state is shown on long hold of an emoji on emoji picker pop over [$1000] Chat - Hover state is shown on long hold of an emoji on emoji picker pop over Aug 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 21, 2023

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

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

melvin-bot bot commented Aug 21, 2023

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

@zanyrenney
Copy link
Contributor

Oops, sorry I somehow missed this but have triaged now!

@melvin-bot
Copy link

melvin-bot bot commented Aug 21, 2023

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

@melvin-bot melvin-bot bot removed the Overdue label Aug 21, 2023
@dummy-1111
Copy link
Contributor

dummy-1111 commented Aug 22, 2023

Proposal

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

Hover state appears when long pressing an emoji in emoji picker popover

What is the root cause of that problem?

Whenever onLongPress event occurs, a short haptic feedback event also occurs. : This is a known issue in react-native-web.

And we have style of an emoji

style={({pressed}) => [
Browser.isMobile() && StyleUtils.getButtonBackgroundColorStyle(getButtonState(false, pressed)),
this.props.isHighlighted && this.props.isUsingKeyboardMovement ? styles.emojiItemKeyboardHighlighted : {},
this.props.isHighlighted && !this.props.isUsingKeyboardMovement ? styles.emojiItemHighlighted : {},
styles.emojiItem,
]}

Because of the above known issue, when long pressing a Pressable, pressed value becomes false shortly. And also onFocus is called when we long press a Pressable(maybe related to context menu action in mWeb. Please refer here), so the selected item is highlighted.

That's why when we long-pressing an emoji, hover state is shown.

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

We have a workaround for this issue as described here

To apply this, replace the below line

onLongPress={!isDisabled && onLongPress ? onLongPressHandler : undefined}

with

        onLongPress={!isDisabled && onLongPress ? onLongPressHandler : () => {}}

And to prioritize the pressing effect, move this line

Browser.isMobile() && StyleUtils.getButtonBackgroundColorStyle(getButtonState(false, pressed)),

below this line
this.props.isHighlighted && !this.props.isUsingKeyboardMovement ? styles.emojiItemHighlighted : {},

This works as expected

Note: We might need to add onPressOut to set highlight index to -1 if we want to remove hover effect after press out

Result
24654.mp4

What alternative solutions did you explore? (Optional)

@TTaro
Copy link

TTaro commented Aug 24, 2023

Proposal

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

When you press and hold, the icon below becomes highlighted.

What is the root cause of that problem?

We have logic to avoid issues when scrolling about onHoverOut we need to add same logic for mobile with onPressOut

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

We need to add the logic of onHoverOut to onPressOut , set highlightedIndex=-1 when arePointersEventsDisabled is false.
In EmogiPickerMenuItem we need to configure onPressOut as any other needed event, onPressOut= this.props.onPressOut to have this event available.

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Aug 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 2023

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

@zanyrenney
Copy link
Contributor

hey @allroundexperts what do you think of the proposal above from @TTaro ?

@melvin-bot melvin-bot bot removed the Overdue label Aug 25, 2023
@dummy-1111
Copy link
Contributor

I think the expected behavior is that pressing effect should last until press out.
@allroundexperts What do you think?

@allroundexperts
Copy link
Contributor

@bernhardoj With your solution, it seems like the hover would be lost on long press. See the video below:

Screen.Recording.2023-08-28.at.12.50.55.AM.mov

I think this is not consistent with how it is behaving on desktop web. On desktop web, following happens:

Screen.Recording.2023-08-28.at.12.53.01.AM.mov

@s-alves10 your proposal makes the behaviour more consistent and as such, I think your approach is better.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Aug 27, 2023

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

@bernhardoj
Copy link
Contributor

bernhardoj commented Aug 28, 2023

@allroundexperts that is consistent with all buttons on Android mWeb. My solution fixes the issue we have here and @s-alves10 extends mine by also including the fix to this issue which happens on all buttons and I think is out-of-scope of this issue. If we still going forward with the extended fix, then I think it would be fair if I get compensation for this issue too. What do you think?

cc: @bondydaa

@allroundexperts
Copy link
Contributor

@bernhardoj I think we can split up the compensation. Collaborative work is always better!

@bondydaa can make the final call though.

@dummy-1111
Copy link
Contributor

dummy-1111 commented Aug 28, 2023

@bernhardoj

I understood that the expected behavior is to keep the press state until pressing out and this is totally different than your solution. I was not adding something to your solution.

Anyway, let's wait for @bondydaa

@TTaro
Copy link

TTaro commented Aug 29, 2023

@allroundexperts please can you review my proposal ?? Many thanks !!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 7, 2023
@dummy-1111
Copy link
Contributor

@allroundexperts

PR is ready for review

@dummy-1111
Copy link
Contributor

@bondydaa

Please take a look at the PR

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @s-alves10 got assigned: 2023-09-06 22:53:27 Z
  • when the PR got merged: 2023-09-15 21:09:56 UTC
  • days elapsed: 6

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 20, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Chat - Hover state is shown on long hold of an emoji on emoji picker pop over [HOLD for payment 2023-09-27] [$1000] Chat - Hover state is shown on long hold of an emoji on emoji picker pop over Sep 20, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.71-12 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-09-27. 🎊

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

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

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 Sep 20, 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:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] 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:
  • [@allroundexperts] 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:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] 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.
  • [@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@zanyrenney
Copy link
Contributor

zanyrenney commented Sep 27, 2023

payment summary - (no urgency bonuses applied)
@allroundexperts does not require payment (Eligible for Manual Requests) payment due is $1000 (no urgency bonus)
@s-alves10 requires payment offer (Contributor) - $1000 [PAID]
@Nathan-Mulugeta requires payment offer (Reporter) - $250 [PAID]

@zanyrenney
Copy link
Contributor

@s-alves10 have invited you to the job. please accept so we can close this out.

@dummy-1111
Copy link
Contributor

@zanyrenney

Accepted

@zanyrenney
Copy link
Contributor

All that can be paid, paid. @allroundexperts please request in ND.

@allroundexperts
Copy link
Contributor

Requested!

@JmillsExpensify
Copy link

Need a payment amount in the BZ summary for @allroundexperts before I can issue payment.

@allroundexperts
Copy link
Contributor

@zanyrenney Can you please look into this? 🙇

@JmillsExpensify
Copy link

Updated, thank you!

@JmillsExpensify
Copy link

$1,000 payment approved for @allroundexperts based on BZ summary.

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

8 participants