App icon indicating copy to clipboard operation
App copied to clipboard

[$250] [AU] Chat - Mac / Safari - Web - User details tooltip persists upon opening emoji suggestions

Open IuliiaHerets opened this issue 1 year ago • 18 comments

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


Version Number: 9.0.68-2 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/5279387&group_by=cases:section_id&group_id=306201&group_order=asc Issue reported by: Applause Internal Team

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Log in with any account
  3. Open any 1:1 DM
  4. Send a single letter message to the chat
  5. Hover over your name/email
  6. Type ":sm" into the composer without moving the mouse

Expected Result:

User details tooltip should disappear.

Actual Result:

User details tooltip persists upon opening emoji suggestions.

Workaround:

Unknown

Platforms:

  • [ ] Android: Standalone
  • [ ] Android: HybridApp
  • [ ] Android: mWeb Chrome
  • [ ] iOS: Standalone
  • [ ] iOS: HybridApp
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/5c0592c6-48ab-407e-aa56-b9fb4afe7aab

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021863596043381250880
  • Upwork Job ID: 1863596043381250880
  • Last Price Increase: 2024-12-09
Issue OwnerCurrent Issue Owner: @eVoloshchak

IuliiaHerets avatar Nov 29 '24 13:11 IuliiaHerets

Triggered auto assignment to @isabelastisser (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] avatar Nov 29 '24 13:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 02 '24 14:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 02 '24 14:12 melvin-bot[bot]

Proposal

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

Chat - Mac / Safari - Web - User details tooltip persists upon opening emoji suggestions

What is the root cause of that problem?

The User Details tooltip uses the rootWrapperStyle style with a zIndex of 10050, which is higher than the zIndex of the emoji suggestions (which currently lacks a zIndex value). This issue also occurs with SuggestionMention component.

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

In the AutoCompleteSuggestionsPortal/index file, add a zIndex of 10050(equal to or higher than the tooltip) to the View style. https://github.com/Expensify/App/blob/d3d20f6582e3a85ce0f25b603b7e44c3f913102f/src/components/AutoCompleteSuggestions/AutoCompleteSuggestionsPortal/index.tsx#L43

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

What alternative solutions did you explore? (Optional)

N/A

linhvovan29546 avatar Dec 03 '24 09:12 linhvovan29546

📣 @linhvovan29546! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Dec 03 '24 09:12 melvin-bot[bot]

Edited by proposal-police: This proposal was edited at 2024-12-04 08:20:53 UTC.

Proposal

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

In Safari when the user has hovered on the name and sees the tooltip with the details and at the same time tries to type in the chat; the autocomplete tooltip of the suggestions does not close the one of tthe user details and the user can see both at the same time.

What is the root cause of that problem?

The tooltip is closed when the user hovers out of the tooltip, which is triggered here: https://github.com/Expensify/App/blob/a2ad3f38b63c9fdd9b2cf5957a43e6aba4d2bd59/src/components/Tooltip/BaseTooltip/index.tsx#L111

The tooltip opens up as a portal with fixed position and a transparent overlay that takes the whole window. In the same way we have the autocomplete suggestions but with slight differences, one of them being the lack of the zIndex.

In Chrome, when the new component is added on top of the previous one the browser generates a hoverOut event because it sees that the mouse was on one div and went on another. However, that does not work in the same way for Safari, which you can see if you add a console.log on the onHoverOut.

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

We need to trigger the onHoverOut for Safari browsers and we can do that by dispatching a mouseover event on the AutoCompleteSuggestionsPortal when the portal is opened.

  1. Add a viewRef: const viewRef = useRef<View>(null);
  2. Add useEffect to dispatch a mouseover event on render:
 useEffect(() => {
        if (!Browser.isSafari()) {
            return;
        }
        const event = new MouseEvent('mouseover', {
            bubbles: true,
            cancelable: true,
            view: window,
        });
        viewRef?.current.dispatchEvent(event);
    }, []);
  1. Pass the viewRef to the view in line:

https://github.com/Expensify/App/blob/a40eb994e4cad7c27147ea2dab507497ff0803e5/src/components/AutoCompleteSuggestions/AutoCompleteSuggestionsPortal/index.tsx#L43

What alternative solutions did you explore? (Optional)

klajdipaja avatar Dec 03 '24 19:12 klajdipaja

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Dec 04 '24 03:12 melvin-bot[bot]

Updated my proposal https://github.com/Expensify/App/issues/53320#issuecomment-2515409413 to use Browser.isSafari instead of Browser.isMobileSafari because we need to dispatch the event only for web safari.

klajdipaja avatar Dec 04 '24 08:12 klajdipaja

@eVoloshchak, please review the updated proposal above. Thanks!

isabelastisser avatar Dec 05 '24 16:12 isabelastisser

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

melvin-bot[bot] avatar Dec 06 '24 09:12 melvin-bot[bot]

Bump @eVoloshchak. Thanks!

isabelastisser avatar Dec 06 '24 17:12 isabelastisser

@eVoloshchak I DM'd you for visibility. Thanks!

isabelastisser avatar Dec 09 '24 15:12 isabelastisser

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Dec 09 '24 16:12 melvin-bot[bot]

Not a quality bug

muttmuure avatar Dec 09 '24 18:12 muttmuure

@eVoloshchak, @isabelastisser Still overdue 6 days?! Let's take care of this!

melvin-bot[bot] avatar Dec 10 '24 09:12 melvin-bot[bot]

@linhvovan29546, thank you for the proposal! I don't think that's the approach we should take, this doesn't close the tooltip, just makes it so suggestions composer is rendered on top of it. This means the behavior on Chrome and Safari would be different, which is not desirable

eVoloshchak avatar Dec 10 '24 13:12 eVoloshchak

However, that does not work in the same way for Safari

@klajdipaja, let's dig a bit deeper here. Why does it not work the same way in Safari? Is this a bug or the expected behavior according to Apple?

eVoloshchak avatar Dec 10 '24 13:12 eVoloshchak

@eVoloshchak seems like a webkit bug: https://bugs.webkit.org/show_bug.cgi?id=4117

klajdipaja avatar Dec 10 '24 14:12 klajdipaja

@eVoloshchak @isabelastisser this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Dec 13 '24 09:12 melvin-bot[bot]

@eVoloshchak, please share an update. Thanks!

isabelastisser avatar Dec 16 '24 02:12 isabelastisser

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

melvin-bot[bot] avatar Dec 16 '24 09:12 melvin-bot[bot]

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Dec 16 '24 16:12 melvin-bot[bot]

@eVoloshchak, @isabelastisser 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] avatar Dec 18 '24 09:12 melvin-bot[bot]

Bump @eVoloshchak for an update. Thanks!

isabelastisser avatar Dec 18 '24 19:12 isabelastisser

@eVoloshchak, @isabelastisser Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

melvin-bot[bot] avatar Dec 20 '24 09:12 melvin-bot[bot]

FYI, I will be OOO from Dec 23 to Jan 6, so please reassign the issue to another team member for urgency, IF needed.

isabelastisser avatar Dec 20 '24 21:12 isabelastisser

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Dec 23 '24 16:12 melvin-bot[bot]

@eVoloshchak, @isabelastisser 12 days overdue now... This issue's end is nigh!

melvin-bot[bot] avatar Dec 24 '24 09:12 melvin-bot[bot]

@eVoloshchak @isabelastisser this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

melvin-bot[bot] avatar Dec 27 '24 09:12 melvin-bot[bot]

This issue has not been updated in over 14 days. @eVoloshchak, @isabelastisser eroding to Weekly issue.

melvin-bot[bot] avatar Dec 27 '24 09:12 melvin-bot[bot]