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

Web - Chat - Edited gets copied after selecting and copying an edited comment #48200

Closed
1 of 6 tasks
IuliiaHerets opened this issue Aug 28, 2024 · 6 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@IuliiaHerets
Copy link

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: 9.0.25-10
Reproducible in staging?: Y
Reproducible in production?: Y
Issue was found when executing this PR: #45150
Email or phone of affected tester (no customers): applausetester+nl460@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Send a comment in a chat
  3. Edit that comment
  4. Start selecting the edited comment from the start of the text beyond the end of the comment
  5. CTRL + C to copy or right click on the comment click on copy to clipboard while the selection is still on the text
  6. Paste the copied content elsewhere

Expected Result:

"(edited)" doesn't get copied alongside the text

Actual Result:

"(edited)" gets copied with the text

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6585067_1724837936571.bandicam_2024-08-28_12-34-11-320.mp4

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 28, 2024
Copy link

melvin-bot bot commented Aug 28, 2024

Triggered auto assignment to @OfstadC (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.

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@IuliiaHerets
Copy link
Author

@OfstadC FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@excile1
Copy link

excile1 commented Aug 28, 2024

Proposal

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

When copying a message by highlighting it and pressing CTRL+C, (edited) can be highlighted and copied along with the text.

What is the root cause of that problem?

The root cause of this issue is that the (edited) label is treated as normal text, and you can highlight it and copy it as you would be able to with other text.

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

The solution to this problem is making sure we assign user-select: none; CSS property to prevent the ability for the user to select the (edited) label and also to prevent them from copying it.
This can be done by altering the editedLabelStyles/index.tsx file, which contains the styles for the label.

// eslint-disable-next-line no-restricted-imports
import display from '@styles/utils/display';
// eslint-disable-next-line no-restricted-imports
import flex from '@styles/utils/flex';
import type EditedLabelStyles from './types';
const editedLabelStyles: EditedLabelStyles = {
...display.dInlineFlex,
...flex.alignItemsBaseline,
};
export default editedLabelStyles;

we can import the userSelect styles by adding: import userSelect from '../userSelect';, and then change the editedLabelStyles constant to include the new style:

const editedLabelStyles: EditedLabelStyles = {
    ...display.dInlineFlex,
    ...flex.alignItemsBaseline,
    ...userSelect.userSelectNone,
};

The result:

Screen.Recording.2024-08-28.at.23.15.51.mp4

@melvin-bot melvin-bot bot added the Overdue label Aug 30, 2024
@OfstadC
Copy link
Contributor

OfstadC commented Aug 30, 2024

Working on this now

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Aug 30, 2024
@OfstadC
Copy link
Contributor

OfstadC commented Sep 3, 2024

Okay - so "edited" doesn't copy when double clicking and copying, nor when selecting the actual text, but it does if you drag your cursor over "edit" - It works this way in Slack too (just tested) - so I don't think this is a bug.

@melvin-bot melvin-bot bot removed the Overdue label Sep 3, 2024
@OfstadC OfstadC closed this as completed Sep 3, 2024
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
Projects
None yet
Development

No branches or pull requests

3 participants