Page MenuHomePhabricator

VisualEditor: Make each reference editable where it appears in the reference list as well as on the edit surface
Open, LowPublicFeature

Description

At https://en.wikipedia.org/w/index.php?title=Wikipedia:VisualEditor/Feedback&oldid=568194420#I_can.27t_edit_the_references it has been proposed that it would be helpful to editors if they could edit references in the reference list, as well as where they appear inline.

"As just about every object you see on a page is directly editable with the VE, of course having the reflist not editable is counter-intuitive. "

This proposal would make T54736 either unnecessary or just a "workaround"/interim measure, depending on the timescale to implement.


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=52736

Details

Reference
bz52750

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:08 AM
bzimport set Reference to bz52750.

Adam Cuerdon comments:

I'd suggest popping up a note telling the user what he or she is doing at least the first time, though. Something like "This reference is used to document the source of text in the article. You can also edit it by clicking on the number after the text. Please make sure that you don't accidentally break documentation with your edit. Thanks for your work!"
We don't want to have a situation where newbies, for example, try to alphabetise the list, say.

Personally, I'm not sure "documentation" is the right word, but otherwise it seems like a good suggestion.

The alphabetising problem could perhaps be reduced by making the references only limitedly editable. i.e. Only individually editable in a dialog that allows for the editing of the template/parameters only.

nshahquinn-wmf lowered the priority of this task from Medium to Low.Jul 22 2015, 11:22 PM
nshahquinn-wmf set Security to None.
nshahquinn-wmf updated the task description. (Show Details)

New feedback from a user (a beginner) who wants to change a reference rom the reflist while editing with VE.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:13 AM
Aklapper removed a subscriber: rmoen.

Copying my comment in from the other ticket, since I think it remains relevant here:

The major hangup on this is that it's going to expose the challenges with VE seeing references that're defined within templates. (Because of the current lack of a centralized way to edit references, this is only really visible to users from the "reuse citation" part of the cite dialog, where such references don't appear.) I suspect that if we accept having those ones greyed out in the list with a "this can't be edited here" tooltip, the rest of this should be fairly simple to do -- unless I'm not thinking of something, it's "just" hooking up a few bits of already-existing functionality and doing some UI work to expose them.

Following on from David's point, there are two ways the the reference list is rendered in the VisualEditor surface:

  1. Using the HTML of the ref list supplied by Parsoid: This will include all references, included those defined inside templates (e.g. infoboxes), but the numbers will not necessarily map to those in VE's data model, so mapping from these references to editable references will be hard.
  2. Generating a reference list by iterating over references in the document model: This will exclude references defined inside templates, but can easily be mapped back to the reference data in VE's data model. This list could be edited directly, or be used to launch a reference editor relatively easily.

(1) is used on the first load mostly for performance reasons (implemented in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/411101) as it's a lot quicker to use the pre-generated HTML; rebuilding the reference list can be pretty slow on large pages. It also helps on wikis where most references are defined in templates, such as he.wiki.

Even if we switch to just using (2) this will mean that references are re-numbered when switching from read mode to edit mode.

From a UI perspective, we will need a way of showing the reference list context, probably by not embedding it but also thinking about where a user can click to show it (as clicking the reference list contents would now let you edit the list in some way)

image.png (205×827 px, 45 KB)

image.png (264×826 px, 55 KB)

I was thinking that a quick path forward would be for the reference list to offer a button that opened up a variant on the reuse dialog. In its context item would be the easiest place.

image.png (852×848 px, 68 KB)

Even if we switch to just using (2) this will mean that references are re-numbered when switching from read mode to edit mode.

I think we're stuck with the references renumbering in the reflist if the user edits any of them anyway, so it might be better to do it up-front and have them stay consistent throughout the entire session.

Even if we switch to just using (2) this will mean that references are re-numbered when switching from read mode to edit mode.

I think we're stuck with the references renumbering in the reflist if the user edits any of them anyway, so it might be better to do it up-front and have them stay consistent throughout the entire session.

It takes ~800ms to render the list on [[Barack Obama]], hence not doing it up-front. Also on he.wiki, the initial rendering is the only rendering with content.