fix(fuselage): keep the message toolbar out of copied text selections
Proposed changes (including videos or screenshots)
Selecting text across consecutive messages and copying it while a message's toolbar is showing puts the quick-reaction emojis into the clipboard, between the message bodies (e.g. :raw_acknowledge:, or the Unicode emoji for standard ones).
The toolbar is positioned absolutely, but it is still inside the message in the DOM, so a selection that spans the message spans the toolbar too. Hiding it with display: none kept it out of the copy only until hover; once it shows, the quick-reaction buttons contribute their emoji markup as text. The other toolbar buttons are icon-font glyphs drawn by pseudo-elements, so only the quick reactions leak.
This sets user-select: none on .rcx-message-toolbar__wrapper, so the toolbar is no longer part of a text selection on any surface that renders it. Clicking the buttons is unaffected.
Issue(s)
Steps to test or reproduce
- In a room with a few consecutive messages, drag backwards from a later message body into the one before it.
- Leave the pointer over the earlier message until its toolbar appears.
- Copy (Cmd/Ctrl+C) and paste into a plain-text editor.
Before: the quick-reaction emojis appear in the pasted text. After: only the message text is pasted. The quick-reaction and other toolbar buttons still work.
Further comments
Fixed in Fuselage rather than with a class in the Rocket.Chat toolbar holder, so every consumer of MessageToolbarWrapper gets it. A copy event handler that cleans the clipboard text was considered and rejected as behaviour added to fix a styling issue.
🤖 Generated with Claude Code
Summary by CodeRabbit
- Bug Fixes
- Fixed copied text selections across messages to exclude quick-reaction emojis from the message toolbar.
- Improved text selection behavior by preventing message toolbar controls from being selected.