Page MenuHomePhabricator

Solution for "Copy and paste from diffs" introduced text selection issues
Closed, ResolvedPublic1 Estimated Story Points

Description

There are as much a 3 bug reports that I've come across in the recent days that come down to one reason. The reason is the code for T285956: Lock selection to a single side in TableDiffFormatter (part of the solution for T285285: Community Wishlist Survey 2021/Editing/Copy and paste from diffs) that introduced this line of code:

document.getSelection().removeAllRanges();

(@Daimona). It seems to be the immediate reason of the issues.

The reports themselves were:

  1. Dragging and dropping text selected in diffs doesn't work (link).
  2. On diff pages, one cannot use Shift+click to extend the selected text (by @stjn).
  3. In Convenient-Discussions one cannot choose an autocomplete item because the text input loses the selection (I've fixed that in the script already) (by @MBH).

Event Timeline

So, that code was added to avoid a potentially annoying behaviour when you select text in a column and then want to select text in the other column. Due to the side-locking CSS, you wouldn't be able to select text in that other column without clicking first. However, I've just tried without that line, and it seems to work as expected. So maybe that problem was resolved differently. I'm going to remove that line now; we can think of how to avoid potential annoyances if and when they'll be found during the QA phase.

Change 710962 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] diff: Avoid clearing all selections on click

https://gerrit.wikimedia.org/r/710962

Change 710962 merged by jenkins-bot:

[mediawiki/core@master] diff: Avoid clearing all selections on click

https://gerrit.wikimedia.org/r/710962

Is there anything left to do here? https://gerrit.wikimedia.org/r/710962 has been live for two weeks.

Is there anything left to do here? https://gerrit.wikimedia.org/r/710962 has been live for two weeks.

Only QA. Although this was a PHP-only issue, so it's technically not blocked on T285857.

@imaigwilo @dom_walden Courtesy ping that this can be tested and unlike the other diff-related tasks, is not stalled on T285857. I highly suspect everything is fine though, seeing as this has been in production for over a month now.

I can no longer reproduce issues 1 and 2 from the description. I did not test issue 3 because apparently it has already been fixed.

I tested a variety of keyboard shortcuts on Firefox, Chromium and Safari on 4 skins (Vector, MinervaNeue, MonoBook, Timeless). The only issue I found was T291393.

I also tested that the "Edit pages on double click" user preference still works on the diff page.

Test Environment: https://test.wikipedia.org MediaWiki 1.37.0-wmf.23 (rMW90ffa2fc6044) 11:03, 20 September 2021.
Test Browsers:

  • Firefox 78
  • Chromium 87
  • Safari 14