Page MenuHomePhabricator

Paste identical annotated content into (end of?) an annotation serialises very poorly because it gets double-annotated
Closed, ResolvedPublic8 Estimated Story Points

Description

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 17 2016, 9:10 PM

Test case:

<p><b id="a">Foo</b></p>
<p><b id="b">Bar</b></p>

Copy an 'o' to the end of 'Bar' and you get:

<p><b id="b">Bar<b id="a">o</b></b></p>

Esanders assigned this task to dchan.Aug 17 2016, 9:18 PM
dchan added a comment.Aug 17 2016, 9:22 PM

I think this goes back a long way (I see this same behaviour in revisions from 2014).

Jdforrester-WMF renamed this task from Paste into (end of?) an annotation serialises very poorly to Paste identical annotated content into (end of?) an annotation serialises very poorly because it gets double-annotated.Aug 23 2016, 6:13 PM
Jdforrester-WMF removed dchan as the assignee of this task.
Jdforrester-WMF lowered the priority of this task from High to Medium.
Jdforrester-WMF changed the point value for this task from 1 to 8.
Jdforrester-WMF added a subscriber: dchan.

Change 344417 had a related patch set uploaded (by DLynch):
[VisualEditor/VisualEditor@master] SurfaceFragment: avoid double-annotating in insertContent

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

DLynch added a subscriber: DLynch.Mar 23 2017, 4:53 PM

That patch fixes Ed's test case. It makes the assumption that when moving content around like this, all that matters is the comparable annotation objects, and discards the ones on the pasted content which are comparable-to the surrounding annotations that are going to get applied.

I chose the order of application that'll get us <p><b id="b">Baro</b></p>, but it'd be easy to adjust it so we get <p><b id="b">Bar</b><b id="a">o</b></p> instead. It's just a matter of which annotation set gets priority.

If the approach seems good, I can add it for external pastes as well.

Change 344417 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] SurfaceFragment: avoid double-annotating in insertContent

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

Change 344692 had a related patch set uploaded (by Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (7b51cb6ab)

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

(Now waiting for the external paste fix, but fixed for internal pastes.)

Change 344692 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (7b51cb6ab)

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

Change 344813 had a related patch set uploaded (by DLynch):
[VisualEditor/VisualEditor@master] SurfaceFragment: Avoid double-annotating in insertDocument, as well

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

Change 344813 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] SurfaceFragment: Avoid double-annotating in insertDocument, as well

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

Change 344803 had a related patch set uploaded (by Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (495cd7d65)

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

Change 344803 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (495cd7d65)

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

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptMar 28 2017, 3:50 PM