Page MenuHomePhabricator

Introduce message copy button on web
ClosedPublic

Authored by tomek on Dec 12 2022, 8:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 6:26 AM
Unknown Object (File)
Sat, Nov 9, 12:02 PM
Unknown Object (File)
Sat, Nov 9, 12:02 PM
Unknown Object (File)
Sat, Nov 9, 12:02 PM
Unknown Object (File)
Fri, Nov 8, 10:00 AM
Unknown Object (File)
Fri, Nov 8, 10:00 AM
Unknown Object (File)
Fri, Nov 8, 10:00 AM
Unknown Object (File)
Thu, Nov 7, 5:48 AM
Subscribers

Details

Summary

The purpose of this button is to copy a message source, including the markdown. The solution uses a recommended approach https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard of interacting with the clipboard.

Linear task: https://linear.app/comm/issue/ENG-2332/copy-message-button-on-web

In this diff we're not giving any feedback to the user, especially we don't display a different tooltip when a message is successfully copied. https://www.figma.com/file/a1nkbWgbgjRlrOY9LVurTz/Comm-%2F-Desktop-app?node-id=1170%3A78271&t=LDQhPB76aimwoBhD-0 This will be handled later in the stack.

icons.png (266×472 px, 24 KB)

Depends on D6013

Test Plan
  1. Check if the button is present only for text messages and sidebar sources based on text messages.
  2. Check if copying a text messages with non-markdown content results in clipboard being filled with its content.
  3. Check if the same happens when a message contains some markdown. Paste it and send to verify that a new message looks the same.
  4. The testing was performed on Chrome, Safari and in Electron.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Dec 12 2022, 8:58 AM
tomek removed a reviewer: atul. tomek added 1 blocking reviewer(s): kamil.Dec 14 2022, 8:16 AM
This revision is now accepted and ready to land.Dec 15 2022, 1:10 AM

Looks good! Reviewing this was helpful as I work on introducing a message like button on web

tomek edited the summary of this revision. (Show Details)
tomek added a parent revision: D6013: [web] Add copy-filled icon.
This revision was automatically updated to reflect the committed changes.