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-03-31] [$1000] Clicking ctrl+A in the chat also selects the tooltip #15924

Closed
2 of 6 tasks
kavimuru opened this issue Mar 13, 2023 · 28 comments
Closed
2 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 13, 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 staging on the desktop app or in a browser
  2. Find an old chat thread with a history of messages
  3. Highlight one of the messages in the chat
  4. Click ctrl+A / cmd+A on mac
  5. It highlights all text in the chat & the tooltip

Expected Result:

Only the text should be highlighted and not the tooltip

Actual Result:

The tooltips are selected

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.83-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:
2023-03-14_08-37-20 (1)

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

View all open jobs on GitHub

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

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

@melvin-bot melvin-bot bot locked and limited conversation to collaborators Mar 13, 2023
@MelvinBot
Copy link

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

@Christinadobrzyn
Copy link
Contributor

I have no idea what these steps mean so I reached out in the Slack chat https://expensify.slack.com/archives/C049HHMV9SM/p1678684053281919

@kavimuru have you been able to reproduce this? Can you update the steps to reflect how you reproduced it?

Press Ctrl + A to select all the text within the drawer
Observe that all the text in the Report screen and all the tooltips are selected

@Christinadobrzyn
Copy link
Contributor

Got more information on testing in the Slack convo and updated the OP. Going to add External label.

@Christinadobrzyn Christinadobrzyn added the External Added to denote the issue can be worked on by a contributor label Mar 14, 2023
@melvin-bot melvin-bot bot unlocked this conversation Mar 14, 2023
@melvin-bot melvin-bot bot changed the title Clicking ctrl+A in the chat also selects the tooltip [$1000] Clicking ctrl+A in the chat also selects the tooltip Mar 14, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

Current assignee @Christinadobrzyn 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 - @thesahindia (External)

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

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

@tienifr
Copy link
Contributor

tienifr commented Mar 14, 2023

Proposal

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

The tooltips on the page is currently selectable by Ctrl A.

What is the root cause of that problem?

We're not preventing user from selecting tooltip's text content. I don't see any case where a tooltip text should be selectable. The tooltip text is only shown when we hover on the element, once we try to click to select any text, the tooltip will disappear.

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

We should apply user-select: none style to the tooltip text style, this can be done by adding userSelect: 'none', here

tooltipTextStyle: {

In order for the proposed solution to be effective, we'll need to remove the Safari hack mentioned in issue #3613 as well. I have tested this and can confirm that removing the hack will not reintroduce the bug that the hack was originally implemented to fix, using the latest code in the main branch.

@hoangzinh
Copy link
Contributor

hoangzinh commented Mar 15, 2023

Proposal

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

The tooltips of emotion icons on the chat page is currently selectable by Ctrl-A.

What is the root cause of that problem?

It's default behavior of the browser, when you press Ctrl-A, it will select all things on current page except elements having attribute user-select: none

Unlucky, the attribute user-select of tooltip is unset atm:

tooltipTextStyle: {
color: themeColors.textReversed,
fontFamily: fontFamily.GTA,
fontSize: variables.fontSizeSmall,
},

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

I think about an additional param textSelectable: PropTypes.bool (default is true) to getTooltipStyles util. So we can

tooltipTextStyle: {
    color: themeColors.textReversed,
    fontFamily: fontFamily.GTA,
    fontSize: variables.fontSizeSmall,
+   userSelect: textSelectable ? 'unset' : 'none',
}

It will give us more control each place we want to disable user-select on the tooltip text. I have checked several design systems, they allow selecting tooltip text by default

https://ant.design/components/tooltip
https://mui.com/material-ui/react-tooltip/

What alternative solutions did you explore? (Optional)

Another option is we write a HOC with style user-select: none, and we wrap current tooltip with this HOC

const withUserSelectDisable = (Component) => (props) =>
  (
    <div style={{userSelect: 'none'}}>
      <Component {...props} />
    </div>
  );
....
withUserSelectDisable(Tooltip)

@getusha
Copy link
Contributor

getusha commented Mar 15, 2023

Proposal

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

When you use the keyboard shortcut CTRL+A to select the entire chat text, the visible tooltip text is also included in the selection.

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

we can apply the existing styles.userSelectNone so that We can ensure that the existing style userSelectNone works on both Webkit and Chrome-based browsers by applying it

App/src/styles/styles.js

Lines 2851 to 2854 in eedd92a

userSelectNone: {
userSelect: 'none',
WebkitUserSelect: 'none',
},

What alternative solutions did you explore? (Optional)

N/A

@tienifr
Copy link
Contributor

tienifr commented Mar 15, 2023

To clarify my proposal here will also include the variations of the user-select to support all browsers (like webkit), if not already clearly implied in the solution description.

@thesahindia
Copy link
Member

if not already clearly implied in the solution description.

@tienifr, I don't think there was any implication at all.

@tienifr's proposal was the first but it only mentioned using user-select: none which will not work for Webkit based browsers. They added a new comment after @getusha's proposal. @getusha proposed using styles.userSelectNone which will work for both (Webkit and Chrome-based browsers) so I prefer going with them.

C+ reviewed 🎀👀🎀

@tylerkaraszewski, please take the final decision.

@tylerkaraszewski
Copy link
Contributor

Let's use @getusha's proposal.

@thesahindia
Copy link
Member

@Christinadobrzyn, let's hire and assign @getusha.

@getusha
Copy link
Contributor

getusha commented Mar 16, 2023

@tylerkaraszewski @thesahindia should i wait to be assigned or raise the PR now?

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Mar 16, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 16, 2023
@MelvinBot
Copy link

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

@Christinadobrzyn
Copy link
Contributor

Hired @getusha for the fix, @thesahindia as C+, @tienifr as reporter

Upwork job - https://www.upwork.com/jobs/~019f7286a4382e4682

@getusha
Copy link
Contributor

getusha commented Mar 16, 2023

Thanks @Christinadobrzyn Accepted!

@thesahindia @tylerkaraszewski the PR is ready for 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 Mar 24, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Clicking ctrl+A in the chat also selects the tooltip [HOLD for payment 2023-03-31] [$1000] Clicking ctrl+A in the chat also selects the tooltip Mar 24, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 24, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Mar 24, 2023

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

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 Mar 24, 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:

  • [@thesahindia / @tylerkaraszewski] The PR that introduced the bug has been identified. Link to the PR:
  • [@thesahindia / @tylerkaraszewski] 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:
  • [@thesahindia / @tylerkaraszewski] 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:
  • [@Christinadobrzyn] Determine if we should create a regression test for this bug.
  • [@thesahindia] 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.
  • [@Christinadobrzyn] 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 labels Mar 31, 2023
@Christinadobrzyn
Copy link
Contributor

Time for payment! It looks like the PR was created on March 17th and merged on March 20th so that would be a bonus.

So payment is:

@tienifr reporter $250
@getusha for the fix $1500
@thesahindia as C+ $1500

Sound correct?

@melvin-bot melvin-bot bot added the Overdue label Apr 2, 2023
@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Apr 2, 2023

  • Paid in Upwork and job closed
  • I think this should be a regression test, @thesahindia @getusha do you agree? Do you have a suggestion?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Apr 2, 2023
@MelvinBot
Copy link

@tylerkaraszewski, @Christinadobrzyn, @getusha, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick!

@getusha
Copy link
Contributor

getusha commented Apr 6, 2023

Regression Test Proposal

  1. Hover over any Hoverable element that has a tooltip
  2. Select the whole text using CMD + A or Ctrl + A
  3. Verify that the text inside the Tooltip is not selected

Do we agree?

@melvin-bot melvin-bot bot removed the Overdue label Apr 6, 2023
@thesahindia
Copy link
Member

I think we can skip the first three items in the checklist. We shouldn't call this a regression, it was an edge case that was overlooked during the implementation of tooltip.

@Christinadobrzyn
Copy link
Contributor

Thanks for the insights! I'll close this without creating a regression test based on @thesahindia's comment. Thanks!

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