Page MenuHomePhabricator

[Refactor] Make sure main content of main+details can be saved back independent of synth refs
Closed, ResolvedPublic

Description

Context

Currently the content of a main+details node comes back together using two paths

  1. The content of the details via the sub-ref's ve.dm.MWReferenceNode using the body html attribute when converting to a DOM for Parsoid
  2. The content of the ( synth ) main node via the ve.dm.MWReferencesListNode as part of the reference list DOM for Parsoid

Both parts are connected back using the refListItemId stored in the mainBody attribute of the node and in the DOM of the list.

Work

The mechanism is already "independent" from synth refs as long as the references list can be generated with the correct content and id are used that match.

  • Make sure main content is added to the output and can be found using an id that connects main+details reference nodes even if there's no distinct main node
Review

Do the following to prove that the change works:

  • open page with the following wikitext
<ref name=":0" details="details">Main</ref>
<references />
  • change "Main"
  • save page / view diff

Before: no change was visible
After: the change is visible

image.png (937×326 px, 29 KB)

Event Timeline

Change #1272842 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] VE: Introduce makeRefListItemId to generate reflist item ids

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

Change #1272842 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Introduce makeRefListItemId to generate reflist item ids

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

Change #1275400 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] VE: Fix usage of InternalListNodeGroup when rendering list

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

Change #1275403 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] VE: Let node converter always add fresh `mainBody` attribute on main+details

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

Change #1275415 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] Change refListItemId naming scheme to be more unique

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

Change #1275400 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Fix usage of InternalListNodeGroup when rendering list

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

Change #1275415 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Change refListItemId naming scheme to be more unique

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

Change #1275758 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] VE: Fallback to empty list when using getAllReusesByListIndex

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

Change #1275758 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Fallback to empty list when using getAllReusesByListIndex

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

Change #1275403 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Always set a fresh mainBody id and render fresh reference with sub-refs

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

Change #1276524 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] VE: Minor streamlining in MWReferencesListNode

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

Change #1276524 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Minor streamlining in MWReferencesListNode

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

lilients_WMDE subscribed.

Visual diff does not show the change.

image.png (1,308×274 px, 32 KB)
I added a new ticket for that: T424232: VisualDiff does not show change of a main+details edit.

Tobi_WMDE_SW claimed this task.