-
Notifications
You must be signed in to change notification settings - Fork 3k
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-05-16] [$1000] The Emoji suggestion is flickered when adding attachment #16977
Comments
Triggered auto assignment to @arielgreen ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~01b73cd2c4c5df346d |
Current assignee @arielgreen is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Triggered auto assignment to @AndrewGable ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The emoji picker is appearing in between selecting the attachment menu item and the file selector opening. What is the root cause of that problem?We are inadvertently returning focus to the composer when the attachment menu item is selected. This is because we are forcing focus here: App/src/pages/home/report/ReportActionCompose.js Lines 232 to 238 in 313c575
The issue is we are only checking for What changes do you think we should make in order to solve the problem?I suggest we add a new state, First we need to update this section to add the new state and an event listener for the window regaining focus. App/src/pages/home/report/ReportActionCompose.js Lines 783 to 790 in 313c575
When the window regains focus we want to force focus onto the composer:
By forcing focus without setting emoji-flicker-issue-original-cancel-behaviour-2023-04-12_15.01.41.mp4We can then set To handle a file being selected, we can need to also reset the state in when the App/src/pages/home/report/ReportActionCompose.js Lines 716 to 719 in 5fadec9
Now we can add the App/src/pages/home/report/ReportActionCompose/index.js Lines 246 to 249 in ab9b7d9
And finally we need to use the
so that it becomes Demo: emoji-flicker-issue-updated-fix-2023-04-12_16.14.17.mp4What alternative solutions did you explore? (Optional)Simpler alternative solution is to add some sort of state flag App/src/pages/home/report/ReportActionCompose.js Lines 783 to 790 in 313c575
We can then add this as a check before going ahead with App/src/pages/home/report/ReportActionCompose/index.js Lines 416 to 417 in 0276f42
|
ProposalPlease re-state the problem that we are trying to solve in this issue.The emoji selection suggestion is flickering when adding attachment What is the root cause of that problem?As correctly pointed out by @jjcoffee, the issue is that we're refocusing the composer once the popover closes. However, the fie selector isn't a popover. As such, the menu item opens for a short time before the file dialog opens. What changes do you think we should make in order to solve the problem?Setting the state when the
This will result in the focus being returned to the composer after a slight delay. What alternative solutions did you explore? (Optional)Alternatively, we can open the
We'll also have to remove this callback because it gets triggered only when the menu closes. Doing the above changes will also prevent the usage of state. IF none of the above work, and our preference is to go with the state variable, then we'll have to add that state check on this line instead of the one mentioned in the proposal by @jjcoffee. We'll also have to modify the |
Updated proposal with extra details regarding handling cancelling the file picker. @allroundexperts I don't think your first solution does anything as far as I can tell, since the delay is only set to 100ms, unless I'm missing something! I don't think your second solution does anything either, or maybe you can explain a bit more? |
@jjcoffee Can you please add the explanation on "which should reliably trigger on either cancel or opening a file". How you are planning to achieve this? What will be the changes in |
@allroundexperts Thanks for your proposal. The use of delays and setTimeout should be the last resort. So, I believe firstly, we should look for other solutions if any. Your alternative solution does not look reliable. I can still reproduce the issue with the solution. |
@Snehal-Techforce Thanks for the proposal. The use of |
This comment was marked as outdated.
This comment was marked as outdated.
@sobitneupane Sorry for not being clearer! I meant that we can add an event listener on the window to check when it receives focus, as this will reliably trigger when the file picker is closed (either via selecting a file, or via cancelling). As an example, my quick and dirty version was to update App/src/components/AttachmentPicker/index.js Lines 56 to 59 in b96c516
to the following:
Then we add the callback here App/src/pages/home/report/ReportActionCompose.js Lines 787 to 790 in b96c516
|
@jjcoffee Thanks for the update. There is one problem with the implementation. You can notice in the following video that emoji suggestion is shown for a brief moment after selecting an image which is not expected. Screen.Recording.2023-04-11.at.14.03.48.mov |
@sobitneupane Ah good catch! On my device the modal appears instantly, so I wasn't getting the same issue. The solution would be to update
(We could also remove the window focus event listener in the |
@jjcoffee I don't think it will work. Even if we remove the event listener on the onChange event, the call back function will be called. |
@sobitneupane I have tested by logging when the |
@jjcoffee For me, Also, Can you please update your original proposal incorporating the suggested changes. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.12-0 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-05-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.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
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:
|
Current assignee @arielgreen is eligible for the External assigner, not assigning anyone new. |
Current assignee @sobitneupane is eligible for the External assigner, not assigning anyone new. |
Current assignee @AndrewGable is eligible for the External assigner, not assigning anyone new. |
@tienifr @sobitneupane @jjcoffee offers sent in Upwork |
@arielgreen Accepted, thanks! Just a heads up this one's also due the 50% timeliness bonus (assigned Fri 28 April, merged Tues 2nd May). |
Not overdue, regression period. |
Same, just waiting for payment. |
@sobitneupane can you please complete the checklist so we can close this issue? |
It is just an edge case and can easily be missed while implementing a big feature. So, I don't think any update in the PR review checklist will help to catch such case. |
Regression Test Proposal
Do we agree 👍 or 👎 |
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:
Expected Result:
The emoji suggestion is not flickered and it should be displayed when the composer is focus
Actual Result:
The Emoji suggestion is flickered when adding attachment and it isn’t displayed when the composer is focus
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.95-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: Any additional supporting documentation
Screen.Recording.2023-04-05.at.09.39.19.mov
Recording.141.mp4
Expensify/Expensify Issue URL:
Issue reported by: @tienifr
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1680662678402299
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: