Page MenuHomePhabricator

VE: Deleting main ref should not orphan existing sub-refs
Closed, ResolvedPublic

Description

User story:

As a VE user,
when I delete a main reference
then any sub-references associated with it should not be orphaned
so that the citations do not break, become confusing for readers and editors.

Acceptance criteria:

GIVEN [1] [1.1] in VE, wikitext:

<ref name="book">Miller 2025</ref>
<ref name="book" details="page 1" />

WHEN deleting [1] in VE (line 1 in wikitext)
THEN [1.1] should stay intact
AND [1.1] should still be able to refer to the main content in the context menu
AND the reference list should not change, it should continue to show the main reference after "1."
AND saving will result in the following wikitext:~~ (removed from scope)

<ref name="book" details="page 1" >Miller 2025</ref>
Dev notes
Current status

Currently the main issue here is, that there's no node that could provided the main content left and we're exploring how we could solve that. If weThe three options are

A) Move the main node during deletion to the references list as synthetic main ref
B) Make sure the content of the main body can be restored from and accessed via the InternalList even if the last main node got deleted from the document.
C) Make sure that there's always a ( even redundant ) synthetic main ref if there's a subref

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Lina_Farid_WMDE renamed this task from Avoid orphaning of sub-refs in VE to VE: Deleting main ref does not orphan existing sub-refs.Apr 16 2025, 3:39 PM
Lina_Farid_WMDE updated the task description. (Show Details)
Lina_Farid_WMDE updated the task description. (Show Details)

Change #1143068 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/Cite@master] [WIP] QUnit test for deleting a ref

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

Change #1144494 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/Cite@master] Demonstrate bad behavior when deleting a main ref

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

Change #1145251 had a related patch set uploaded (by Mareike Heuer; author: Mareike Heuer):

[mediawiki/extensions/Cite@master] Mein ref deletion doesn't orphan subrefs

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

thiemowmde raised the priority of this task from High to Needs Triage.May 14 2025, 7:20 AM

Change #1143068 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] QUnit test for deleting a ref

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

Change #1144494 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Demonstrate bad behavior when deleting a main ref

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

awight moved this task from Doing to Watching / Stalled on the WMDE-TechWish-Sprint-2025-04-30 board.
awight added subscribers: MareikeHeuerWMDE, awight.

Creating subtasks for implementation work and treating this ticket as an epic now.

lilients_WMDE renamed this task from VE: Deleting main ref does not orphan existing sub-refs to VE: Deleting main ref should not orphan existing sub-refs.Jul 10 2025, 9:53 AM

Change #1145251 abandoned by WMDE-Fisch:

[mediawiki/extensions/Cite@master] Mein ref deletion doesn't orphan subrefs

Reason:

Duplicate of I5ac7f427376a3a0ab7ef36e470cf387748b15b20

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

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

[mediawiki/extensions/Cite@master] [WIP][POC] Save main ref to reflist when orphaning a subref

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

This is the use case that's currently hard to solve in a general way. Only "C" is looking like a viable way forward, and it will require:

  • Parsoid changes to always include a synthetic LDR when a main+details is present.
  • VE always creates a synthetic LDR when adding a subref.

Change #1178481 abandoned by Awight:

[mediawiki/extensions/Cite@master] [WIP][POC] Save main ref to reflist when orphaning a subref

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

Does not work for me, sadly. Is there a trick to activate it?

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

[mediawiki/extensions/Cite@master] VE Converter: Update the test for details orphaning

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

Change #1184790 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE Converter: Update the test for details orphaning

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