Page MenuHomePhabricator

[refactor] Don't remove internal item nodes from InternalList's indexes
Closed, DeclinedPublic

Description

If the InternalItemNode holding a main ref's footnote body is never deleted and remains in the InternalList indexes, then it can be used to to avoid orphaning and serialize to a main+details ref tag. This will become the new source of truth which replaces synthetic list-defined main refs.

Currently, ve.dm.MWReferenceNode#removeFromInternalList will remove the InternalItemNode corresponding to a ref from the index when that ref is deleted. This breaks some sub-referencing use cases, for example when a main ref is deleted but its sub-reference remains. Always leave the index pointing a an InternalItemNode intact.

Acceptance Criteria

  • Deleted but sub-referenced main ref still serializes as a main+details (status quo)
  • Footnote numbering remains sequential (status quo)
  • Both main and sub-ref footnote body can still be edited (status quo)
  • "pure" main ref is still visible in the reuse dialog and can be reused into a standalone main ref.
  • Unused refs (including no subrefs) are not shown in the references list.

Event Timeline

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

[mediawiki/extensions/Cite@master] [WIP] Don't remove internal node on deletion

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

awight renamed this task from Visual editor should not remove nodes from InternalList to [refactor] Don't remove internal item nodes from InternalList.Oct 8 2025, 1:57 PM
awight updated the task description. (Show Details)

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

[mediawiki/extensions/Cite@master] [refactor] Get internal item without knowing ref node

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

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

[mediawiki/extensions/Cite@master] [refactor] Can render a reflist item without ref node

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

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

[mediawiki/extensions/Cite@master] [refactor] Don't count synthetic refs when placing body

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

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

[mediawiki/extensions/Cite@master] [WIP] [refactor] Don't copy main into synthetic ref when adding details

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

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

[mediawiki/extensions/Cite@master] [WIP] [refactor] Serialize main+details without synthetic ref

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

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

[mediawiki/extensions/Cite@master] [WIP] Exploring issues with serializing refs

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

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

[mediawiki/extensions/Cite@master] [refactor] Get internal item without knowing ref node

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

WMDE-Fisch renamed this task from [refactor] Don't remove internal item nodes from InternalList to [refactor] Don't remove internal item nodes from InternalList's indexes.Mon, Jan 12, 1:57 PM
WMDE-Fisch updated the task description. (Show Details)

Change #1194657 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] [refactor] Get internal item without knowing ref node

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

Change #1194212 abandoned by WMDE-Fisch:

[mediawiki/extensions/Cite@master] [WIP] [refactor] Don't remove internal node on deletion

Reason:

We're using another approach now.

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

WMDE-Fisch subscribed.

We're using another approach now.