Page MenuHomePhabricator

Experiment: move reference footnote content out of VE internalList and into reference nodes
Open, Needs TriagePublic

Description

The Parsoid representation for Cite references in a document makes them awkward to handle directly, so VE has already implemented an InternalList storage for the footnote content, which is queried and written to as part of normal document operations.

We've found that this abstraction adds complexity and makes it more difficult to support some of our upcoming use cases, for example ref reuse within dialogs when the user wants to convert an unnamed ref from the outer document to a reused, named ref. A small proof-of-concept seems to demonstrate that we can switch to a simpler abstraction in which footnote content is embedded as an attribute on each ref.

There is a small tech debt penalty around conversion of the footnote from and to HTML, but otherwise it looks like deprecating internalList will be beneficial.

The current recommended approach is:

This patch to extensions/VisualEditor/lib/ve might be helpful for checking that each usage is fully decoupled from internalList, https://gerrit.wikimedia.org/r/c/VisualEditor/VisualEditor/+/997919

List-defined parent references of "subreferences" are an interesting case which isn't served well by the encapsulation approach. LDR is already not handled well.