User:DWalden (WMF)/Copy paste diffs/2021-10-01 dwalden

From mediawiki.org

Charter[edit]

While testing this yesterday, I found some unpredictability in selection behaviour depending on exactly where on the page you start your selection.

I will follow up with this today.

Coverage[edit]

Browsers Firefox (78), Chromium (87)
Languages https://en.wikipedia.beta.wmflabs.org, https://ar.wikipedia.beta.wmflabs.org
Skins Vector (new and legacy), MinervaNeue, MonoBook, Timeless

Notes[edit]

When attempting to select only one side of the diff, you need to start your selection "inside" the side of the diff you want, for example inside the red or blue area below:

The hotspots can vary a bit depending on the diff, for example:

Starting outside these areas will generally lead to both sides of the diff being selected (although I have found this can vary a bit depending on browser).

I think some of the issues I was seeing yesterday were race-conditions. We use javascript to identify which "side" of the diff we want to select. If using an older browser (e.g. Firefox 78) or if you are quick, the javascript might be slow and you end up selecting both sides of the diff.

I also briefly tested VisualEditor diffs (the wikitext diff, not the visual diff) and Manual:Live_preview. Although both use diffs from wikidiff2, and therefore have been affected by some of the HTML changes (for example, the "+", "-" indicators are not selected as implemented in https://phabricator.wikimedia.org/T192526), they don't appear to take advantage of the JavaScript changes (for example, locking selection of one side of the diff https://phabricator.wikimedia.org/T285793).

Bugs[edit]

  1. On Chrome, if you select one side of the diff and then click "Line #:", it selects both sides of the diff. This doesn't seem like it will affect many people, so I don't think I will raise this as a bug.
  2. On Chrome, when clicking "between" rows of the diff on the right ("added") side (see below) the table's "data-selected-side" gets set to "deleted". It probably should be "added" instead.