Page MenuHomePhabricator

VE support for adding independent subrefs to new/unnamed references
Closed, ResolvedPublic

Description

User story

As a VE user I want to add details to an existing reference (creating a subref via the reuse dialog).

Acceptance criteria

GIVEN An unnamed main ref:

<ref>Miller</ref>

WHEN I add a sub-ref with the details page 1 and save the page
THEN the main ref has an auto-generated name
AND a there is new sub-ref with the same name:

<ref name=":0">Miller</ref>
<ref name=":0" details="page 1" />

Current status

image.png (247×1 px, 27 KB)

Dev notes

ve.dm.MWReferenceNode.static.toDomElements is responsible for generating the auto name for the converted output but does not save it in the data structure. We need to implement a mechanism that allows the sub-ref to

  • Get the generated name from the main ref
  • Independent of if the main ref is rendered after the sub-ref or before

A solution to that could be generating auto names early on and saving them in the data structure of the nodes.

Event Timeline

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

[mediawiki/extensions/Cite@master] VE: Extract name generation from toDomElements

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

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

[mediawiki/extensions/Cite@master] Auto generate names for sub-refs

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

MareikeHeuerWMDE updated Other Assignee, removed: WMDE-Fisch.
MareikeHeuerWMDE subscribed.

Change #1137211 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Extract name generation from toDomElements

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

Change #1137213 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Auto generate names for sub-refs

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