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

[Payment due 2023-12-21] [$500] Chat - Text in the composer loses the hightlight as soon as the cursor reaches the LHN #31573

Closed
6 tasks done
lanitochka17 opened this issue Nov 20, 2023 · 44 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 20, 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!


Version Number: 1.4.1.4
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Open any 1:1 chat
  3. Click inside the composer
  4. Type in any text
  5. Click on the empty space after your text (still inside the composer)
  6. Slowly start moving your mouse to the LNH while holding the mouse button

Expected Result:

The text should be highlighted even when the cursor reaches the LNH

Actual Result:

The text in the composer loses the hightlight as soon as the cursor reaches the LNH

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6284256_1700505162669.bandicam_2023-11-20_18-35-47-842.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010f7879c01d6e7f2b
  • Upwork Job ID: 1726671955755700224
  • Last Price Increase: 2023-12-04
  • Automatic offers:
    • bernhardoj | Contributor | 28012611
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 20, 2023
Copy link

melvin-bot bot commented Nov 20, 2023

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

@melvin-bot melvin-bot bot changed the title Chat - Text in the composer loses the hightlight as soon as the cursor reaches the LNH [$500] Chat - Text in the composer loses the hightlight as soon as the cursor reaches the LNH Nov 20, 2023
Copy link

melvin-bot bot commented Nov 20, 2023

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

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

melvin-bot bot commented Nov 20, 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

Copy link

melvin-bot bot commented Nov 20, 2023

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

@witehound
Copy link

Proposal

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

Text in the composer loses the hightlight as soon as the cursor reaches the LNH

What is the root cause of that problem?

Here

style={[styles.sidebar, Browser.isMobile() ? styles.userSelectNone : {}]}
styles.userSelectNone is being used in this component.

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

style={[styles.sidebar, Browser.isMobile() ? styles.userSelectNone : {}]}
styles.userSelectNone should not be used, as it uses Browser.isMobile() condition which is always false.

What alternative solutions did you explore? (Optional)

N/A

Copy link

melvin-bot bot commented Nov 20, 2023

📣 @witehound! 📣
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>

@witehound
Copy link

Contributor details
Your Expensify account email: netvid00@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~011e0ee171549014ff

Copy link

melvin-bot bot commented Nov 20, 2023

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

@ZhenjaHorbach
Copy link
Contributor

@witehound
Can you give more explanation?)

The video is not a mobile browser
And therefore styles.userSelectNone is not used in this case )

@parasharrajat
Copy link
Member

@witehound Thanks for the proposal. I noticed that when we move the cursor on the items rendered above the FAB menu the highlight is not removed. only when the cursor is moved inline to FAB buttons, it hides. So I am not sure how your proposal solves the issue.

Can you please explain the root cause on how it is really the root cause?

@witehound
Copy link

@parasharrajat , @ZhenjaHorbach so i think this proposal might be redundant! this is my first time looking at the code base and i figured removing the userSelectNone might fix the bug!

@shahinyan11
Copy link

shahinyan11 commented Nov 20, 2023

@parasharrajat I think It is not a bug. It is standard behavior . It related mouse position. Even here if you try to highlight any text from right to left and move mouse to down the highlight will disappear .
Or you can move FAB button to top (e.g. 100px ) and try to test again. You will see that the highlight will not disappear.

@codecreator28
Copy link

codecreator28 commented Nov 21, 2023

Proposal

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

Text in the composer loses the hightlight as soon as the cursor reaches the LNH

What is the root cause of that problem?

The expected behavior is that the text selection state should continue even if the mouse cursor moves outside of the input field.
When the mouse cursor moves outside of the input field, it is no longer affected by the user-select property, and the browser's default behavior of deselecting the text takes effect.

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

To achieve the expected behavior, you need to apply the user-select CSS property to the body element of the input field. This will ensure that the text selection state is preserved even if the mouse cursor moves outside of the input field.

Please add following code to onFocus and onBlur function in /src/pages/home/report/ReportActionCompose/ReportActionCompose.js

onFocus function:
document.body.style.userSelect = 'all';

onBlur function:
document.body.style.userSelect = 'none';

What alternative solutions did you explore? (Optional)

---Safari---
document.body.style.webkitUserSelect

@s-alves10
Copy link
Contributor

This issue is not reproducible in the latest main

@parasharrajat
Copy link
Member

I can reproduce... Let's wait for some decent proposals. Otherwise, it is not a big deal.

@melvin-bot melvin-bot bot added the Overdue label Nov 24, 2023
@laurenreidexpensify
Copy link
Contributor

Let's see if we get any more proposals by EOW and take it from there

@melvin-bot melvin-bot bot removed the Overdue label Nov 27, 2023
@s-alves10
Copy link
Contributor

@parasharrajat

Can you please tell me if you're able to reproduce the issue in the latest main?

Copy link

melvin-bot bot commented Nov 27, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Nov 29, 2023
@parasharrajat
Copy link
Member

Yes, I can reproduce this on the latest main.

Screen.Recording.2023-11-30.at.2.07.53.PM.mov

@melvin-bot melvin-bot bot removed the Overdue label Nov 30, 2023
@melvin-bot melvin-bot bot added the Overdue label Dec 7, 2023
@parasharrajat
Copy link
Member

Still no response on the original PR. IMO, we should be good to use margin instead of transform as we are not changing it dynamically so their overall impact on rendering should be the same as transform. The only difference is that currently it is rendered via GPU and the margin will force it to use CPU.

@bernhardoj can you please do some testing around it and confirm that the margin does not change anything? If that is the case, we can go with your proposal.

@melvin-bot melvin-bot bot removed the Overdue label Dec 7, 2023
@codecreator28
Copy link

Hi, @parasharrajat
Could you please check my updated comment

@parasharrajat
Copy link
Member

I have seen it @sukach318 but I don't think it is a good solution because it does not target the root cause. We have disabled the selection on the sidebar intentionally and we don't want to change that. The problem here is to prevent selection from getting hidden from the composer.

@bernhardoj
Copy link
Contributor

@parasharrajat So far I found no issue. The visual is still the same and the sidebar is still interactable.

@parasharrajat
Copy link
Member

Let's roll then.... @bernhardoj suggestion looks good to me. @bernhardoj Please convert that post to a proposal.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Dec 8, 2023

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

@codecreator28
Copy link

@parasharrajat The same phenomenon occurs not only when you move the mouse sideways but also when you move it down or to the up while selected.

@bernhardoj
Copy link
Contributor

Proposal

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

The composer input text selection is lost as soon as we move our mouse while dragging the selection to the FAB.

What is the root cause of that problem?

I did play around with the layout and it looks like the issue is with how we style the layout.

The sidebar screen has a translateX of -375px to shift it to the left.

cardStyle: {
...getNavigationModalCardStyle(),
width: isSmallScreenWidth ? '100%' : variables.sideBarWidth,
// We need to translate the sidebar to not be covered by the StackNavigator so it can be clickable.
transform: [{translateX: isSmallScreenWidth ? 0 : -variables.sideBarWidth}],
...(isSmallScreenWidth ? {} : styles.borderRight),
},

The current behavior is, that the selection is lost when it touches the FAB (the OP video).

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

Replacing translateX with marginLeft: -375 seems to fix the selection issue (sidebar is still clickable).

Screen.Recording.2023-12-04.at.16.17.21.mov

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

melvin-bot bot commented Dec 8, 2023

📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@bernhardoj
Copy link
Contributor

PR is ready

cc: @parasharrajat

@laurenreidexpensify
Copy link
Contributor

Heh - this should be paid on 21 Dec, looks like it was on prod from 14 Dec #32772 (comment)

@laurenreidexpensify laurenreidexpensify changed the title [$500] Chat - Text in the composer loses the hightlight as soon as the cursor reaches the LHN [Payment due 2023-12-21] [$500] Chat - Text in the composer loses the hightlight as soon as the cursor reaches the LHN Dec 20, 2023
@laurenreidexpensify laurenreidexpensify added Daily KSv2 and removed Weekly KSv2 labels Dec 20, 2023
Copy link

melvin-bot bot commented Dec 27, 2023

@francoisl, @parasharrajat, @bernhardoj, @laurenreidexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@laurenreidexpensify
Copy link
Contributor

Payment Summary:

Contributor: @bernhardoj $500 paid in Upwork
C+ review: @parasharrajat $500 please request payment in NewDot

Outstanding steps: @parasharrajat please complete a checklist and confirm if we need a regression test thanks

@parasharrajat
Copy link
Member

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:

Regression Test Steps

Web/Desktop

  1. Open any chat
  2. Type anything in the composer
  3. Drag a text selection from the end of the text in the composer towards the FAB in the sidebar/LHN
  4. Verify the text selection persist

Do you agree 👍 or 👎 ?

@parasharrajat
Copy link
Member

@laurenreidexpensify Done. Please close the issue if nothing is left here. I will request the payment later and track it myself. Thanks.

@parasharrajat
Copy link
Member

Payment requested as per #31573 (comment)

@JmillsExpensify
Copy link

$500 approved for @parasharrajat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests