Page MenuHomePhabricator

Allow MWCitationDialog and MWReferenceDialog to work on refs that are not selected
Open, Needs TriagePublic

Description

Context

When users edit references from the references list there's a little hack applied to change the selected fragment so that the dialogs involved in editing can still work with the logic that uses the selectedNode as basis for what needs to be edited. In other cases this divergence between, what's actually selected and what should be edited can lead to issues we see in T367910: The entire reference list is deleted when attempting to replace citation with a reused reference.

Solution

MWReferenceDialog and MWCitationDialog mostly rely in the currently selected node to figure out what's currently edited and what needs to be updated, replaced or changed. To untangle the hack applied for the references list and avoid issues with replacing citations it would be helpful if the dialogs could be called with a target reference that's independent of what's currently selected.

Implementation
  • Add an option that can be passed to these dialogs that links to a reference for editing
  • Make it possible to work with these dialogs on references that got passed into the dialog's getSetupProcess

Event Timeline

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

[mediawiki/extensions/Cite@master] VE: Refactor MWReferenceDialog setup

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

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

[mediawiki/extensions/Cite@master] VE: Introduce edit mode flag to MWReferenceDialog

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

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

[mediawiki/extensions/Cite@master] VE: Introduce MWEditReferenceNodeCommand and wire it for basic editing

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

Change #1219902 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Refactor MWReferenceDialog setup

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

Change #1219903 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Introduce edit mode flag to MWReferenceDialog

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

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

[mediawiki/extensions/Cite@master] [VE] Don't collaps fragment on sub-ref creation

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

Change #1236257 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] [VE] Don't collaps fragment on sub-ref creation

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