matrix-react-sdk icon indicating copy to clipboard operation
matrix-react-sdk copied to clipboard

Copy events from the timeline in an IRC log style format

Open ara4n opened this issue 6 years ago • 2 comments

rather than as incoherent gunks of HTML and text, which ends up including avatars and RRs and context menus and all sorts.

It's debatable as to whether this is the right approach: we go and walk the displayed DOM, putting the innerHTML/innerText of the event contents into a new wrapper built from the event's metadata.

Instead, we could make EventTile support rendering to a logger mode, which would then help us finally fix https://github.com/vector-im/riot-web/issues/2630. However, this means that we would be completely rebuilding the clipboard rather than basing it on what the user actually copied (and for instance, it would be much harder to handle partial event selections).

This solution could always evolve in that direction in future though.

thoughts welcome.

ara4n avatar Sep 01 '19 17:09 ara4n

rather than as incoherent gunks of HTML and text, which ends up including avatars and RRs and context menus and all sorts.

Is this actually happening for you today? We've tried to prevent this somewhat by setting user-select: none on things that generally shouldn't be copied.

Aha, after some testing, it appears Firefox does listen to this CSS when copying, but Chrome does not. 😕

jryans avatar Sep 04 '19 13:09 jryans

Related issues:

  • https://github.com/vector-im/element-web/issues/893
  • https://github.com/vector-im/element-web/issues/17844
  • https://github.com/vector-im/element-web/issues/11673
  • https://github.com/vector-im/element-web/issues/11525
  • https://github.com/vector-im/element-web/issues/18202
  • slightly related, https://github.com/vector-im/element-web/issues/10649

MadLittleMods avatar Sep 14 '21 22:09 MadLittleMods

Testing, it seems the behaviour here is sensible now so I think this PR is no longer necessary.

dbkr avatar Jul 29 '24 13:07 dbkr