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-08-03] [$1000] Emoji picker's position changes on decreasing the screen size #17603

Closed
1 of 6 tasks
kavimuru opened this issue Apr 18, 2023 · 66 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 Apr 18, 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 the app
  2. Go to any chat > Open Emoji Picker
  3. Decrease the screen size like shown in video
  4. Notice that emoji picker's position changes

Expected Result :

The emoji picker jumps to the LHN instead of behaving the correct way (as in the second video).

Actual Result :

Emoji picker's position changes

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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

Current:

Screen.Recording.2023-04-18.at.12.31.19.AM.mov

Expected:

Recording.270.mp4

Expensify/Expensify Issue URL:
Issue reported by: @daraksha-dk
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681758191524309

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019f4f66f49e6e10ed
  • Upwork Job ID: 1676073590122438656
  • Last Price Increase: 2023-07-04
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 18, 2023
@MelvinBot
Copy link

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

@MelvinBot

This comment was marked as off-topic.

@sophiepintoraetz
Copy link
Contributor

This is not an issue but expected behaviour due to the screen resizing.

@kadiealexander
Copy link
Contributor

kadiealexander commented Jul 3, 2023

Hey Sophie! The first video in the OP is the one that shows the bug. The emoji picker jumps to the LHN instead of behaving the correct way (as in the second video). This was also reported here but I'm reopening this one instead to ensure the original bug reporter is credited.

@samh-nl
Copy link
Contributor

samh-nl commented Jul 3, 2023

Proposal

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

The emoji picker positions itself to the top-left corner of the screen if the window dimensions change.

What is the root cause of that problem?

The anchor referenced by emojiPopoverAnchor.current (EmojiPicker.js) no longer exists. The context menu is used as the anchor, however after clicking "Add reaction" the context menu is closed, thereby removing the anchor and making repositioning based on the anchor position impossible.

const emojiPopoverDimensionListener = Dimensions.addEventListener('change', () => {
calculateAnchorPosition(emojiPopoverAnchor.current).then((value) => {
setEmojiPopoverAnchorPosition(value);
});
});

This causes the position to be x=0, y=0.

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

We need to use the same anchor that is used by BaseReportActionContextMenu (which is the chat message).

What alternative solutions did you explore? (Optional)

N/A

Originally posted by @samh-nl in #21982 (comment)

@sophiepintoraetz sophiepintoraetz added the External Added to denote the issue can be worked on by a contributor label Jul 4, 2023
@melvin-bot melvin-bot bot changed the title Emoji picker's position changes on decreasing the screen size [$1000] Emoji picker's position changes on decreasing the screen size Jul 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 4, 2023

Job added to Upwork: https://www.upwork.com/jobs/~019f4f66f49e6e10ed

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

melvin-bot bot commented Jul 4, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 4, 2023

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

@sophiepintoraetz
Copy link
Contributor

Thanks, @kadiealexander - that description helped!

The emoji picker jumps to the LHN instead of behaving the correct way (as in the second video).

@alitoshmatov
Copy link
Contributor

alitoshmatov commented Jul 4, 2023

Proposal

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

What is the root cause of that problem?

This is caused by this line where we are checking if device is touchscreen and medium size, if so we are removing emoji picker button

{DeviceCapabilities.canUseTouchScreen() && this.props.isMediumScreenWidth ? null : (

Thus when this button disappears emoji picker popover will lose it is target position

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

I am not sure about this line:

{DeviceCapabilities.canUseTouchScreen() && this.props.isMediumScreenWidth ? null : (

It is not logical to me, for example in mid sized tablets we do not show emoji picker button, how are they going to use it then?
This is image of ipad mini in chrome responsive mode
Screenshot 2023-07-04 at 11 53 06 AM
I think we should remove this condition and want to show emoji picker button always.

What alternative solutions did you explore? (Optional)

Also we can hide emoji picker if anchor element is unmounted. I checked if emojiPopoverAnchor.current will be null if referenced element is unmounted but no it is still pointing to the element, but the element is not present in dom.

We can check if element is visible and if not we can hide emoji picker, like this:

if (!emojiPopoverAnchor.current.checkVisibility()) {
                hideEmojiPicker(false);
                return;
            }

@hoangzinh
Copy link
Contributor

hoangzinh commented Jul 5, 2023

Proposal

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

Emoji picker's position changes on decreasing the screen size

What is the root cause of that problem?

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

To fix this issue #21982 as well. I think we can expose another method called clearEmojiPopoverAnchor here and call this method inside componentWillUnmount lifecycle of Open EmojiPicker buttons. There are only 3 buttons so it's not really an issue
Screenshot 2023-07-06 at 23 09 06

Then in window size change callback, we check if emojiPopoverAnchor.current is cleared, we skip recalculate its position and hide the emoji picker.

What alternative solutions did you explore? (Optional)

I think if the EmojiPickerButton is disappear/unmounted in this case, we can hide the Emoji picker too. In order to do this, we can call the util EmojiPickerAction.hideEmojiPicker() inside the componentWillUnmount (or useEffect with return function) of EmojiPickerButton => That means, when the EmojiPickerButton is unmounted by somehow, it will hide the Emoji picker too.

    useEffect(() => () => {
        EmojiPickerAction.hideEmojiPicker()
    }, []);

Result:

Screen.Recording.2023-07-10.at.23.25.58.mp4

@sophiepintoraetz
Copy link
Contributor

Just waiting on @allroundexperts to review!

@allroundexperts
Copy link
Contributor

I can't reproduce this @sophiepintoraetz. Can you please confirm?

@alitoshmatov
Copy link
Contributor

@allroundexperts You have to simulate in responsive mode of chrome, this issue is reproducible only in medium sized screen and touchscreen enabled

@allroundexperts
Copy link
Contributor

@allroundexperts You have to simulate in responsive mode of chrome, this issue is reproducible only in medium sized screen and touchscreen enabled

@alitoshmatov Can you please share a video of how you're reproducing this behaviour?

@alitoshmatov
Copy link
Contributor

@allroundexperts

Screen.Recording.2023-07-06.at.11.38.11.AM.mov

@allroundexperts
Copy link
Contributor

Thanks @alitoshmatov!

@allroundexperts
Copy link
Contributor

@alitoshmatov's proposal looks good to me.

@sophiepintoraetz We can either hide the emoji picker menu when the button is hidden OR we can make the button always visible. I prefer to hide the emoji picker menu when the button gets hidden instead of showing the button always. @sophiepintoraetz Can you please confirm the expected behaviour here?

In either case, @alitoshmatov's proposal works well.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

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

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Jul 13, 2023
@hoangzinh
Copy link
Contributor

@allroundexperts @Li357 Thanks for accepting my proposal. The PR is ready #22792. Please help me review it. Thanks

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

@hoangzinh, @Li357, @allroundexperts, @sophiepintoraetz Whoops! This issue is 2 days overdue. Let's get this updated quick!

@sophiepintoraetz
Copy link
Contributor

Still in review.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jul 27, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Emoji picker's position changes on decreasing the screen size [HOLD for payment 2023-08-03] [$1000] Emoji picker's position changes on decreasing the screen size Jul 27, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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

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 Jul 27, 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.
  • [@sophiepintoraetz] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@allroundexperts
Copy link
Contributor

Checklist

  1. remove emoji picker menu from tablets #7851
  2. https://github.com/Expensify/App/pull/7851/files#r1278691903
  3. I think a Slack discussion is not needed here as this was an edge case that requires someone to change his window size.
  4. Similar to the third point, a regression test might be un-necessary here as this was a rare case where someone would change his window size while keeping the emoji picker open.

@sophiepintoraetz
Copy link
Contributor

Payouts due (I believe the date for the bonus calculation is correct):

Issue Reporter: $250 @daraksha-dk
Contributor: $500 @hoangzinh r (assigned 13 Jul - PR merged 26 Jul = 14 working days lapsed)
Contributor+: $500 @ @allroundexperts (assigned 13 Jul - PR merged 26 Jul = 14 working days lapsed)

Eligible for 50% #urgency bonus? N (penalty applied)

@hoangzinh
Copy link
Contributor

hoangzinh commented Aug 2, 2023

@sophiepintoraetz could we consider again the penalty in this case? Reasons:

  • I started to implement the proposal after got assigned within 24h.
  • During implement, I found the original proposal can cause regression in other cases => I had to spend time to research, then discussed with @allroundexperts .
  • @allroundexperts and I was actively working on the PR. We didn't intentionally delay the PR merging

@sophiepintoraetz
Copy link
Contributor

@hoangzinh I appreciate the ask but I do not think that's fair to other individuals who submitted proposals and could have completed this job/other contributors who have been penalised for the same reasons. I am glad that you were thorough but we do make the guidelines clear - I would suggest taking more care in your original proposal!

@allroundexperts
Copy link
Contributor

allroundexperts commented Aug 3, 2023

I would agree with @sophiepintoraetz on this one. Though just for record, it did not take 14 working days to get this merged. This was merged within 9 days (excluding the weekends).

@sophiepintoraetz
Copy link
Contributor

@allroundexperts - sorry - I used a calculator which I thought was accurate, you're right in that it wasn't 14 days but am I correct in saying that there are 10 days between assignment and merging?
image

@allroundexperts
Copy link
Contributor

I used this to calculate the exact period. This is pretty accurate AFAIK.

@sophiepintoraetz
Copy link
Contributor

Got it. Moot point seeing as we're in agreement but I appreciate the accuracy. Reconfirming that the payments will be
Issue Reporter: $250 @daraksha-dk
Contributor: $500 @hoangzinh r (assigned 13 Jul - PR merged 26 Jul = 14 working days lapsed)
Contributor+: $500 @ @allroundexperts (assigned 13 Jul - PR merged 26 Jul = 14 working days lapsed)

@sophiepintoraetz
Copy link
Contributor

Offers sent to @daraksha-dk and @hoangzinh

@daraksha-dk
Copy link
Contributor

Accepted the offer. Thanks @sophiepintoraetz

1 similar comment
@hoangzinh
Copy link
Contributor

Accepted the offer. Thanks @sophiepintoraetz

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Aug 3, 2023
@sophiepintoraetz
Copy link
Contributor

Payments done - @allroundexperts - just drop the request here when you're ready!

@allroundexperts
Copy link
Contributor

Requested. Thanks!

@JmillsExpensify
Copy link

Reviewed the above payment details for @allroundexperts. This is approved for payment in NewDot.

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