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-04-10] [$1000] Emoji picker moves to top left side when using Tab key #16384

Closed
1 of 6 tasks
kavimuru opened this issue Mar 22, 2023 · 33 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

@kavimuru
Copy link

kavimuru commented Mar 22, 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. Open app
  2. go to any chat
  3. Hover over any message
  4. Use tab key to "add reaction" icon

Expected Result:

emoji picker should not move to top left side

Actual Result:

emoji picker moves to top left side

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.88-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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:

Screen.Recording.2023-03-22.at.7.20.34.PM.mov

Untitled

Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1678684960601349

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e7e5fc421067468c
  • Upwork Job ID: 1640667623552278528
  • Last Price Increase: 2023-03-28
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 22, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Mar 22, 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

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

@JmillsExpensify Huh... This is 4 days overdue. Who can take care of this?

@JmillsExpensify
Copy link

We don't officially support keyboard navigation, though I agree that this is an issue and I can reproduce it. @stitesExpensify and @hannojg thoughts on prioritizing a fix for this here, vs closing it and coming back to keyboard navigation throughout the app? I tend to favor closing it, though I thought I'd check with either of you first.

@melvin-bot melvin-bot bot removed the Overdue label Mar 28, 2023
@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.

@esh-g
Copy link
Contributor

esh-g commented Mar 28, 2023

@JmillsExpensify I investigated this and this is definitely a one line fix as we are not following the recommended approach for handling refs in functional components. Fixing this would also help in adhering to the conventions laid out by react. I didn't post a proposal as the help Wanted label isn't present, but let me know if I should do so. 😇

@JmillsExpensify
Copy link

I'll go ahead and apply the external label so you can get ahead on that one. I'd still like input from Brandon/Hanno when they get a chance though!

@JmillsExpensify JmillsExpensify added the External Added to denote the issue can be worked on by a contributor label Mar 28, 2023
@melvin-bot melvin-bot bot changed the title Emoji picker moves to top left side when using Tab key [$1000] Emoji picker moves to top left side when using Tab key Mar 28, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

Current assignee @JmillsExpensify 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 - @sobitneupane (External)

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

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

@esh-g
Copy link
Contributor

esh-g commented Mar 28, 2023

Proposal

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

The emojiPicker shows on the top left corner of the web page when pressing the add reaction icon with enter key.

What is the root cause of that problem?

The root cause is that the anchor ref.current becomes null while executing the EmojiPickerAction.showEmojiPicker method.

const MiniQuickEmojiReactions = (props) => {
const ref = React.createRef();
const openEmojiPicker = () => {
props.onPressOpenPicker();
EmojiPickerAction.showEmojiPicker(
props.onEmojiPickerClosed,
(emojiCode, emojiObject) => {
props.onEmojiSelected(emojiObject);
},
ref.current,
);
};

This happens because we are executing props.onEmojiPickerClosed on line 55 before EmojiPickerAction.showEmojiPicker, which causes the component to re-render. And when pressing the enter key, the re-render happens twice.
Due to the re-render, the ref gets redefined every time that happens so it is null when the next line executes.

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

We can solve this problem by using the useRef hook instead of react.createRef which is the recommended way to use refs in functional components.
This hooks is meant exactly for this type of circumstance where we don't want the ref to get re-defined on every re-render.

After applying

Screen.Recording.2023-03-22.at.11.06.57.PM.mov

Additional Details: There are only two files in the codebase where we are using React.createRef in functional Components. One is in MiniQuickEmojiReactions.js as listed above and the other is in AddReactionBubble.js

What alternative solutions did you explore? (Optional)

We can also

  • Use a class based component approach and use refs that way
  • Store the ref temporarily in a variable before executing props.onEmojiPickerClosed

Both these options have been tested as well.

@sobitneupane
Copy link
Contributor

Proposal from @esh-g looks good to me.

🎀👀🎀 C+ reviewed
cc: @madmax330

@madmax330
Copy link
Contributor

I agree @sobitneupane

@JmillsExpensify you can assign the job to @esh-g on upwork

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

📣 @esh-g You have been assigned to this job by @JmillsExpensify!
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 📖

@JmillsExpensify
Copy link

Sounds good! @esh-g is assigned to this GH issue. In addition, please apply to the Upwork job and we'll already have that in place once the regression period has passed.

@esh-g
Copy link
Contributor

esh-g commented Mar 29, 2023

Thanks for assigning me! The PR will be ready shortly.
Applied on Upwork with profile: https://www.upwork.com/freelancers/~0186b1d7cc69656f22

@JmillsExpensify
Copy link

Great! I sent you the initial offer. We can apply the 50% bonus on final payout, if that ends up applying.

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Mar 29, 2023
@esh-g
Copy link
Contributor

esh-g commented Mar 29, 2023

PR is ready! 🚀

cc @madmax330 @sobitneupane @JmillsExpensify

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Apr 3, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Emoji picker moves to top left side when using Tab key [HOLD for payment 2023-04-10] [$1000] Emoji picker moves to top left side when using Tab key Apr 3, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 3, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.93-4 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-04-10. 🎊

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

MelvinBot commented Apr 3, 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:

  • [@sobitneupane / @madmax330] The PR that introduced the bug has been identified. Link to the PR:
  • [@sobitneupane / @madmax330] 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:
  • [@sobitneupane / @madmax330] 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:
  • [@JmillsExpensify] Determine if we should create a regression test for this bug.
  • [@sobitneupane] 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.
  • [@JmillsExpensify] 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 Daily KSv2 labels Apr 10, 2023
@esh-g
Copy link
Contributor

esh-g commented Apr 12, 2023

@JmillsExpensify Is this issue due? I hope that there were no regressions...

@sobitneupane
Copy link
Contributor

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:

#15210

  • [@sobitneupane / @madmax330] 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:

#15210 (comment)

  • [@sobitneupane / @madmax330] 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:

https://expensify.slack.com/archives/C049HHMV9SM/p1681283318136189

@sobitneupane
Copy link
Contributor

Regression Test Proposal

  • Click on the "+ reaction" option while hovering on any report
  • Verify that the emoji picker is correctly positioned.
  • Navigate to the "+ reaction" option using tab and press enter
  • Verify that the emoji picker is correctly positioned.
  • After adding a reaction, click on the AddReactionBubble that appears right of the added reaction.
  • Verify that it is positioned correctly.

Do we agree 👍 or 👎

@stitesExpensify
Copy link
Contributor

Looks good to me! Just a couple small changes to make it more clear

  • Click on the + "add reaction" icon while hovering a message on any chat
  • Verify that the emoji picker is correctly positioned.
  • Navigate to the + "add reaction" option using tab and press enter
  • Verify that the emoji picker is correctly positioned.
  • After adding a reaction, click on the add reaction bubble that appears to the right of the added reaction.
  • Verify that it is positioned correctly.

@melvin-bot melvin-bot bot added the Overdue label Apr 14, 2023
@MelvinBot
Copy link

@JmillsExpensify, @madmax330, @sobitneupane, @esh-g Huh... This is 4 days overdue. Who can take care of this?

@JmillsExpensify
Copy link

Love those updates. I'm going make just a couple more to mimic the formatting we use in TestRail.

  • Click on the + "add reaction" icon while hovering a message on any chat
  • Verify that the emoji picker is correctly positioned.
  • Navigate to the + "add reaction" option using tab and press enter
  • Verify that the emoji picker is correctly positioned.
  • After adding a reaction, click on the add reaction bubble that appears to the right of the added reaction.
  • Verify that it is positioned correctly.

@melvin-bot melvin-bot bot removed the Overdue label Apr 18, 2023
@JmillsExpensify
Copy link

Alright, in terms of settling up for this issue, it looks like we have the following:

I've sent contracts to the issue reporter as well as contributor plus. I'll pay bonuses out when issuing payment, which by the way, @esh-g I've just done that very step for you.

@gadhiyamanan
Copy link
Contributor

@JmillsExpensify accepted, thanks!

@JmillsExpensify
Copy link

Thanks, all paid out.

@sobitneupane
Copy link
Contributor

@JmillsExpensify Accepted the offer.

@JmillsExpensify
Copy link

Awesome, payment sent. Closing this one out!

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