Repository navigation
Fix multi-message copy on desktop web chat rows. - #102143
Conversation
Allow text selection on button-role report action rows via shouldAllowTextSelection, and normalize button tags in SelectionScraper so pasted messages keep line breaks.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
The new file imported a .ts path and used DOM casts that fail typecheck and ESLint.
dylanexpensify
left a comment
There was a problem hiding this comment.
Looks good from a product perspective 👍
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppNA Android: mWeb ChromeNA iOS: HybridAppNA iOS: mWeb SafariNA MacOS: Chrome / SafariScreen.Recording.2026-10-12.at.9.12.21.PM.mov |
|
Bug: text selection needs to click at the right start of text, or it doesn't work Screen.Recording.2026-10-01.at.10.00.00.PM.mov |
|
Bug: selection doesn't work when select short message and long message
Screen.Recording.2026-10-01.at.10.04.00.PM.mov |
|
Thanks @eh2077, I checked both of these on staging Chrome and they already happen there.
Screen.Recording.2026-10-03.at.8.51.41.PM.mov
Screen.Recording.2026-10-03.at.8.50.50.PM.online-video-cutter.com.mp4So this PR did not introduce either bug. It only fixes the empty clipboard on multi-message copy. Happy to look at these as a follow-up if we want to handle them separately. |
|
@eh2077 Bump ^ |
I think it's fine then. Can you add a note to QA steps please? |
|
Added a note to the QA steps. @eh2077 all yours. |
Hmm, I think we should fix it for better UX. If it's a tricky issue requires going down a rabbit hole, then we can consider fix it as a follow-up. |
|
Thanks @eh2077. I think the best move is to open a follow up and fix both Chrome issues there, for a better UX. I checked Safari and neither of these happens there. I would rather keep this PR to the copy fix and handle both Chrome selection issues together in the follow up.
These need a separate pass because the cause is not fully proven yet, and the likely fix sits in shared list code. My best guess is that FlashList reorders the message rows in the DOM about a second after layout settles. A long message often finishes measuring after a reload, and if that reorder happens mid-drag the selection breaks partway through. It is flaky, so we would need extra logging to confirm, and the fix would be in the FlashList ordering patch that also keeps tab order correct. I would rather not mix that into this copy fix. I'm good to open a seperate follow up pr cc: @Julesssss |
Yeah happy for that to be fixed as a follow up in seperate PR |
eh2077
left a comment
There was a problem hiding this comment.
@neerajbachani please update checklist to green CI checks, thx!
@eh2077 Fixed. All yours!! |
|
🚧 Julesssss has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.5.9-0 🚀
|
|
No help site update needed. This PR is a bug fix that makes copying and pasting text across multiple chat messages work on desktop Chrome, which is what users already expect, so no article sentence is now incorrect. |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.9-4 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
On desktop web Chrome, chat rows use
role="button"(added in #78527 for Appium tab navigation). That activatesBaseGenericPressable's button behavior:user-select: noneon the row wrapper and adata-selection-scrapper-hidden-elementmarker. For multi-message selections,SelectionScraperstrips every marked row from the cloned selection,getClipboardTextreturns empty text, andsetHtmlbails before writing to the clipboard. Paste then shows stale clipboard content.Safari was already fixed in #90541 by skipping the button role there. This PR completes the fix for Chrome by:
shouldAllowTextSelectionprop toGenericPressableso callers can opt out of selection suppression while keepingrole="button"for accessibility/tab stops.shouldAllowTextSelection={hasHoverSupport()}on chat rows inReportActionItem(desktop web only).<button>to<div>inSelectionScraper.replaceNodesso the HTML clipboard flavor stays block-level for composer paste.Native and mobile behavior is unchanged because
hasHoverSupport()is false on those platforms.Fixed Issues
$ #37447
PROPOSAL: #37447 (comment)
Tests
Offline tests
Same as Tests.
QA Steps
Same as Tests.
Note: Start the selection by clicking and dragging on the message text itself. Clicking the empty space next to the message does not start a selection. This is existing Chrome behavior and is expected.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Chrome
Screen.Recording.2026-09-14.at.9.54.41.PM.mov
Safari
Screen.Recording.2026-09-14.at.9.56.23.PM.mov