Page MenuHomePhabricator

VisualDiff: Subref footnote markers show the wrong number
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue

  • Create wikitext:
<ref details="page 1" name="book">Miller</ref>
  • Switch to VE
  • Add anything to the page
  • Click on Save changes... to open the save dialog
  • Click on Review your changes to open the VisualDiff

What happens?:
The rendered preview in the diff shows [1] for the subref in both the article and in the reference list.

image.png (1,176×432 px, 31 KB)

What should have happened instead?:
The rendered preview in the diff should show [1.1] for the subref

Implementation

  • Correct numbering of footnote markers in article diff.
  • Correct numbering in reference list.

Out of scope:

Technical notes

There are two aspects to this.

Correct numbers

In the VE-core ve.dm.VisualDiff class, footnote numbers are completely overridden with simplistic numbering: ve.setProp( item, 'internal', 'overrideIndex', i + 1 ); . The ve.dm.MWReferenceNode gives this overrideIndex higher priority than its internally-calculated numbers. First, we should try to understand the exact problem that was being solved by this override. Then, we can decide to either continue using the override mechanism and fill it with the formatted subreference number, or we can drop the mechanism and try to simplify how this works. Numbering changes should probably not appear in the diff, but follow existing product decisions.

Findings: the overrideIndex was introduced because the diff algorithm merges the old and new InternalList together, so the native numbering of the combined list would no longer match the article numbering. Before this step, the actual numbering is frozen and saved into this field. Our initial implementation can reuse the override mechanism to pass full sub-reference numbers through to the diff renderer, but for long-term debt it would be best if this merge step could be avoided or isolated from later logic. For example, the merge could be performed on cloned lists and then results carried back into the original old and new internal lists.

Screenshot from 2025-09-08 10-06-02.png (973×310 px, 20 KB)

Reference list rendering

In the VE library ve.ui.DiffElement there's a part that handles how the ReferenceList is rendered handleRefList . We probably need to apply changes there to make it understand subrefs.

Findings: the references list enumeration makes assumptions about sequential numbering, rather than referring back to the reference node metadata. We'll need to wire footnote number labels through. Diff logic contains several quite different code paths for insertion, removal, and changed references, and all will need to include this new wiring.

image.png (973×310 px, 22 KB)

Next steps

  • Get the numbering into the ReferenceNode class ( in the VE lib? )
  • Get the numbers from the new VE ReferenceNode class into the VisualDiff

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Triage:

  • The issue cuts through the happy path when editing and publishing via Visual Editor. Users will experience a broken visual diff when reviewing changes that include a sub-ref. This might lead to confusion and uncertainity at the moment of publishing.
  • The solution is more complex than initially envisioned and requires +2 rights for the VisualEditor Library, which we currently don't have. Getting folks to sync and review the code patches in time for WikiCon Germany, will be challenging for both involved teams and therefore we're postponing work on this until after the first rollout to de.wiki.
  • We will communicate this during the release and on our project pages, which will be linked in the UI.
lilients_WMDE renamed this task from [Bug] VisualDiff: Subref footnote markers don't work in VisualDiff to VisualDiff: Subref footnote markers don't work in VisualDiff.Sep 11 2025, 12:21 PM
lilients_WMDE added a project: Epic.
lilients_WMDE changed the subtype of this task from "Bug Report" to "Task".

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

[VisualEditor/VisualEditor@master] Streamline InternalList related logic in VisualDiff

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

lilients_WMDE renamed this task from VisualDiff: Subref footnote markers don't work in VisualDiff to VisualDiff: Subref footnote markers show the wrong number.Sep 23 2025, 12:15 PM
lilients_WMDE updated the task description. (Show Details)
lilients_WMDE updated the task description. (Show Details)
lilients_WMDE changed the subtype of this task from "Task" to "Bug Report".
zdev changed the task status from Open to Stalled.Apr 24 2026, 3:29 PM

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

[VisualEditor/VisualEditor@master] [WIP] Update circular dependency on Cite

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

awight changed the task status from Stalled to Open.Wed, May 20, 10:17 AM
awight claimed this task.

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

[mediawiki/extensions/VisualEditor@master] Implement formatNumberWithoutSeparators for MediaWiki platform

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

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

[VisualEditor/VisualEditor@master] Add a method for formatting numbers without a separator

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

awight subscribed.

Change #1176645 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Streamline InternalList related logic in VisualDiff

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

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

[VisualEditor/VisualEditor@master] [WIP] Exploring VisualDiff internal list issues

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

Change #1298305 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (f49818bd3)

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

Change #1298305 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (f49818bd3)

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

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

[VisualEditor/VisualEditor@master] [WIP] assign overrideIndex using buildReflistNumbering

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

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

[VisualEditor/VisualEditor@master] [WIP] Experiment with diff list item numbering

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

Since the footnote markers rendered in the article diff is already showing different numbers than in the rendered references list diff, there seems to be no harm in solving the issue in two separate tasks, I propose that we split out the remaining reference list work into a new subtask.

awight raised the priority of this task from Low to Needs Triage.Tue, Jun 9, 6:17 AM

Resetting the priority since my understanding is that visual diff issues are now a blocker to global rollout.

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

[VisualEditor/VisualEditor@master] Store rendered footnote number in InternalItemNode

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

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

[VisualEditor/VisualEditor@master] Drop unused internal "index" parameters

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

Sorting the references is a bit tricky, here's an example where old and new numbering gets mixed together and it looks not so good:

image.png (617×307 px, 22 KB)

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

[mediawiki/extensions/Cite@master] Match new DiffElement output

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

Change #1289922 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Add a method for formatting numbers without a separator

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

Change #1302161 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (3e79e9934)

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

Change #1302161 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (3e79e9934)

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

Change #1302170 had a related patch set uploaded (by WMDE-Fisch; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@wmf/1.47.0-wmf.6] Update VE core submodule to master (3e79e9934)

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

Change #1302170 merged by WMDE-Fisch:

[mediawiki/extensions/VisualEditor@wmf/1.47.0-wmf.6] Update VE core submodule to master (3e79e9934)

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

Mentioned in SAL (#wikimedia-operations) [2026-06-16T07:33:44Z] <wmde-fisch@deploy1003> wmde-fisch: Backport for [[gerrit:1302170|Update VE core submodule to master (3e79e9934) (T397319 T428764)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-16T07:50:16Z] <wmde-fisch@deploy1003> Finished scap sync-world: Backport for [[gerrit:1302170|Update VE core submodule to master (3e79e9934) (T397319 T428764)]] (duration: 36m 13s)

Change #1289907 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Implement formatNumberWithoutSeparators for MediaWiki platform

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