Page MenuHomePhabricator

Reference context doesn't show that the reference is reused, which is confusing if you try to delete and recreate it (converting a re-used basic reference to template citation)
Closed, ResolvedPublic

Description

Reference context doesn't show that the reference is reused. It should have something to let users know that it's not a good idea to delete the ref and create a new one in the same place, as that won't update reused references.

There is no convenient way to replace the contents of a basic reference with a template citation generated using Citoid. You have to insert a new reference, then manually replace every use of the old one.


VisualEditor has a problem with name-refs. It does not edit the origin but replaces the ref-link.
In a former post on MediaWiki I thought it's because there was the full reference after the ref-link the in the article I edited. I am not sure if my assumption is correct.

I wrote this on MediaWiki Talk:VisualEditor:
VE does not understand if the ref is linked to another ref later. Example:
Line 1:

<ref name="XYZ" />

20 lines later:

<ref name="XYZ">This is a reference!</ref>

If I edit line one, VE will not edit the origin.
Please see https://de.wikipedia.org/w/index.php?title=EBuLa&diff=182549901&oldid=179684205 (Line 1) for more information.

Related Objects

Event Timeline

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

Okay, how you would edit that with VE by keeping the ref-names? If I cannot convert anything I need to delete the "old" Basicform reference. In this case the ref-name tag will be deleted too. Because that's what I meant with a "convert-button": A Function which deletes the content of the ref-tag for recreating it with a template by keeping the ref-names.

  • VE support's an option to "convert" a reference without deleting the ref-tags (just a button "convert" which creates a window like that after clicking on "cite" on the same place as the old reference)

You want to convert a reference without a template to one that uses a template. VE can do that, but only where the reference is originally defined, not where it has been reused (as it has been here). See https://en.wikipedia.org/w/index.php?title=User:Thryduulf/sandbox2&oldid=869166099 for a quick illustration.

No that's not the reason why I don't have a convert button:
In your version there is reference one with a template and reference 2 without a template. I can click on both (original and reused) and get a convert button. If I do that with my version (https://de.wikipedia.org/w/index.php?title=EBuLa&oldid=179684205&veaction=edit) I don't have a convert button. That's caused by the cite format:

<ref name[...]>[https://example.com Hello world] Description</ref>

it's not the expected format (like in your version)

<ref name[...]>[https://example.com Hello world]</ref>

That's the reason why I have no convert button. For this case, where VE cannot detect the format, there must be a convert button which (like I already said) creates a window like that after clicking on "cite" at the same place as the old reference (just changing the content)

This problem is not T123778. That task has actually been fixed in 2016 and I just verified that we did not accidentally unfix it since then.

I think the real problem here is this:

It looks like you replaced the citation with a citation template. How did you do that? (What exactly did you click on to make that happen?) I suspect that the visual editor thought you deleted an existing ref, and then created a new/separate/unrelated one.

Uhm that could be the thing, I remember: As this version contained simple text with a [link name] format it could not be converted into the citation template "Internetquelle" (Websource). In result I deleted the old cite note (in believing that it's a "normal" ref) and created a new with the template "Internetquelle".
VE didn't brief me about that :)

So, you actually deleted the existing reused reference and created a new one in the same place. One could say that this was a "user error", but I think there is a problem with the user interface here. It doesn't show that the reference is reused until you try to edit it, so it seems reasonable to just delete it and create a new one, but that actually causes this new reference to be "separated" from the previous reused one.

Correct @matmarex; That's what i tried to say. And I also presented the solution with a "convert" or "re-create" or "replace" (call it how you want) button, which I already mentioned here (second point). It's described a bit misleading, because at that time I didn't know that there was already a "convert" button.

So how do you feel about this suggested solution?

matmarex renamed this task from VE has problems with editing <ref name="XYZ" /> link to Reference context doesn't show that the reference is reused, which is confusing if you try to delete and recreate it.Dec 13 2018, 2:13 AM
matmarex updated the task description. (Show Details)
matmarex moved this task from To Triage to Up next on the VisualEditor board.

@Der_Keks I'm not really sure what your suggestion is. You suggest a "Convert" button, but as we found out there already is one, which doesn't appear for this particular reference, because we can't detect that it is convertible. Can you clarify?

I rephrased the task to describe the part that (I think) we can all agree on :)

I don't know how I could describe it on other ways. Please forget the existing convert-button for following: The first cite in "https://de.wikipedia.org/w/index.php?title=EBuLa&oldid=179684205&veaction=edit" shows a simple-text reference with a link. I want to recreate that reference with the template internet source (Template in the German Wiki). But I also want to keep the ref-name-tags (recitation) in the Article. For that I had the idea for an Button "Recreate", which would be always shown if a reference is reused/recitated (ref name tag).
By clicking on this at the moment not existing "recreate"-button VE will flush the content of the reference (keeping the recitations) and show this "new-reference"-popup (see picture), where I can choose if I want to recreate this cite (by keeping the recitations) with the template internet source, or if i want to use a book-reference, or if i want to enter a manually reference.

I hope you understand what I want.

Unbenannt.png (189×393 px, 4 KB)

At the moment I need to add another cite/reference and have to recite manually all places in the article. After that i need to delete the old one.

So if I understand correctly, you would want something like this in the reference context menu:

image.png (501×1 px, 241 KB)

Clicking the "Recreate" action button would open the same inspector popup as the "Cite" toolbar button (except that the result would replace the existing reference).

Seems like a good idea! I also found another task where the same thing is requested: T179773: [feature request] User scenario to fix old raw references.

I would rather put this button inside the reference dialog itself, though, in place of the "Use an existing reference" button, which is currently mostly useless (it is disabled unless you're inserting a new reference, and the same functionality is reachable more easily from the "Cite" toolbar button). The reasons are:

  • we usually don't put extra actions in the context menus (with the exception of a 'delete' action) – there is very little space for them there, especially on mobile devices
  • I'm not sure if the difference between "Edit" and "Recreate" would be obvious otherwise
  • we did that in the media dialog, and this seems like a similar operation, so it makes sense to be consistent

Mockup of this idea:

de.wikipedia.org_w_index.php_title=EBuLa&oldid=179684205&veaction=edit&uselang=en(Laptop with MDPI screen).png (800×1 px, 427 KB)
de.wikipedia.org_w_index.php_title=EBuLa&oldid=179684205&veaction=edit&uselang=en(Laptop with MDPI screen) (1).png (800×1 px, 418 KB)

If we do this, then the label of the new button could probably be something like "Change reference" (analogous to "Change image" in media dialog), or maybe "Replace reference"?

(Also, this is independent from my idea of adding information that the reference is reused into the context menu. We should probably do both.)

Yeah you understood correctly :) I fully agree with you and your suggestions. I would prefer "Replace reference" because "change reference" sounds like editing the text, which could confuse users.

Change 482141 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/Cite@master] Improve warning that reference is reused

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

That only improves the textual warnings, I'm still working on the "Replace reference" functionality. It's a bit more complicated than it looked like, since the code is split between the Cite and Citoid code.

So if I understand correctly, you would want something like this in the reference context menu:

image.png (501×1 px, 241 KB)

I would avoid complicating this part of the UI for a more advanced feature. I would rather this was buried in the dialog as a "save as copy" type feature.

Change 483335 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/Cite@master] ve.ui.MWReferenceDialog: Remove 'Use an existing reference' button

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

Change 483336 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/Cite@master] ve.ui.MWCitationDialog: If the selected ref is not using the template, clear it

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

Change 483337 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/Citoid@master] Allow any reference to be replaced using Citoid

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

Summary of the series of changes:

  • Improve warning that reference is reused
    • Show the warning in the context menu (on desktop only) in addition to the reference dialog.
    • Add more details to the warning in reference dialog, and adjust spacing around it to make it more noticeable.
  • Remove 'Use an existing reference' button (in the reference dialog – was never present in citation dialog)
  • Allow any reference to be replaced using Citoid
    • Add a "Replace reference" button to reference and citation dialogs from the Cite extension. When clicked, it closes the dialog and opens the Citoid inspector.
    • Citoid inspector has already supported a 'replace' mode, only used when the inspector is opened using the "Convert" button. It was only used for converting "Basic" references to "Automatic" ones. Now the options provided by other tabs in the Citoid inspector are also available. Some notes:
      • "Re-use" tab: Note that this only modifies the individual use of a reference. It doesn't change other places where the reference you're changing is re-used.
      • "Manual" tab:
        • Changing from basic to template, or template to another template, empties the reference and opens the appropriate citation dialog.
        • Changing from template to basic opens the reference dialog with the template inside of it. This is a bit silly, but I'm leaving it in, because this provides a way to set a reference group for a template reference, which was previously impossible (T71498).
  • Use a different dialog title for the Citoid inspector when replacing a reference (this also affects the inspector when opened using the previously existing "Convert" button).

Screenshots of the workflows with the changes (with new/changed parts marked in green circles) – open in new tab for full size:

T208981-workflows.png (5×9 px, 2 MB)

Change 482141 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] Improve warning that reference is reused

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

matmarex renamed this task from Reference context doesn't show that the reference is reused, which is confusing if you try to delete and recreate it to Reference context doesn't show that the reference is reused, which is confusing if you try to delete and recreate it (converting a re-used basic reference to template citation).Jan 10 2019, 6:05 PM
matmarex updated the task description. (Show Details)

Change 483335 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] ve.ui.MWReferenceDialog: Remove 'Use an existing reference' button

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

Change 483336 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] ve.ui.MWCitationDialog: If the selected ref is not using the template, clear it

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

The main patch for this change (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Citoid/+/483337) is not merged yet, so none of the UI changes described above have happened.

Marielle proposed an alternative approach on T219801.

Just wanna ask if you could explain me the current status. I currently stuck on this problem while editing :)

Just wanna ask if you could explain me the current status. I currently stuck on this problem while editing :)

So at present the reference shows that it's been re-used with a message to that effect. However we couldn't decide on how to implement replacing the reference from a design standpoint. So it's been kicked up to the product manager @ppelberg :).

At some point it will make it to design and then back to devs but it's going to be a while, sorry :/. I agree it's super annoying, I run into this problem a lot myself. At the moment I just switch to wikitext editing but it's really hard to do it that way and easy to mess up and leave orphaned references about.

Mvolz triaged this task as Medium priority.May 21 2019, 9:16 AM

Okay, thank you! So I'm not alone.

Jess, please have a look at the workflow I proposed: T208981#4868393

Change 483337 had a related patch set uploaded (by Esanders; owner: Bartosz Dziewoński):
[mediawiki/extensions/Citoid@master] Allow any reference to be replaced using Citoid

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

Having looked at the workflow properly this looks like an improvement. We should just merge it as it's been sitting here for a year.

+1 to moving forward with this merge.

Notes/next steps:

  1. I'm not sure if it's entirely clear throughout the entire flow to the user that they are editing every instance of the reference - this could be reinforced with some more substantial UI treatments
  2. Related to the first note, I think that the button title (Replace Reference) is not quite right because it's not self explanatory - I would test this out and see how people react

cc @ppelberg

Change 483337 merged by jenkins-bot:
[mediawiki/extensions/Citoid@master] Allow any reference to be replaced using Citoid

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

  1. Related to the first note, I think that the button title (Replace Reference) is not quite right because it's not self explanatory - I would test this out and see how people react

Ed renamed it to "Change reference type" in the final version, I think that's actually better than my initial idea.

@Der_Keks If you still remember this issue you filed two years ago… Please try out the new workflow on the beta cluster (e.g. https://en.wikipedia.beta.wmflabs.org/wiki/Reused_references) :)

matmarex edited projects, added Editing QA; removed Patch-For-Review.
matmarex added a subscriber: Ryasmeen.

(@Ryasmeen has already discovered T264133, which was caused by this patch, but I think that just popped up while testing something else)

@Der_Keks If you still remember this issue you filed two years ago… Please try out the new workflow on the beta cluster (e.g. https://en.wikipedia.beta.wmflabs.org/wiki/Reused_references) :)

Oh that looks nice. But I saw that the Button "Change reference type" is also being shown in the references list below.

Screenshot_2020-09-30 Editing Reused references - Wikipedia, the free encyclopedia.png (417×1 px, 14 KB)

Ah nevermind, I should read all new messages first. It's in T264133 :)

The workflow seems to work as described in T208981#4868393.

@matmarex: a couple of resulting questions:

  • Is it possible for people to land directly on the Replace citation's Manual tab after clicking the Change reference type button?
  • Is the below possible?
    • 1. Click [1] on this page: https://en.wikipedia.beta.wmflabs.org/wiki/Reused_references?action=edit
    • 2. Click Edit in the Cite book dialog
    • 3. Click Change reference type
    • 4. Navigate to the Manual tab in the Replace citation dialog, if you're not already there
    • 5. Select Journal
    • 6. ✅Notice the contents of the Book's Title field – "50 shades of white" – now appears in the Journal's Title field

...assuming the above is possible, I will file a separate ticket for them.

+1 to moving forward with this merge.

Notes/next steps:

  1. I'm not sure if it's entirely clear throughout the entire flow to the user that they are editing every instance of the reference - this could be reinforced with some more substantial UI treatments

Good spot, @iamjessklein: can you please fill in the issues you see in this "shell" of a ticket: T268590?

  • Is it possible for people to land directly on the Replace citation's Manual tab after clicking the Change reference type button?

For a Replace reference button, that was nice to land on Automatic tab, but I agree that for a Change reference type button, landing on Manual seems much better.

By the way, I fully support other feature (keeping parameters while changing template), which could be easily configurable through JSON (either automatically from citoid param in TemplateData, or specifying parameter equivalences in MediaWiki:Citoid-template-type-map.json.
This seems to be T87271 / T97936.

JTannerWMF subscribed.

Describe what you would like to happen on a separate ticket and then close this out. @matmarex will comment in the new ticket.

Describe what you would like to happen on a separate ticket and then close this out. @matmarex will comment in the new ticket.

See below.

The workflow seems to work as described in T208981#4868393.

@matmarex: a couple of resulting questions:

  • Is it possible for people to land directly on the Replace citation's Manual tab after clicking the Change reference type button?

The above already seems to be happening by default.

It looks like the Replace citation dialog remembers the last tab you interacted with (Automatic / Manual / Re-use) and lands you in that tab the next time you open the Replace citation dialog.

  • Is the below possible?
    • 1. Click [1] on this page: https://en.wikipedia.beta.wmflabs.org/wiki/Reused_references?action=edit
    • 2. Click Edit in the Cite book dialog
    • 3. Click Change reference type
    • 4. Navigate to the Manual tab in the Replace citation dialog, if you're not already there
    • 5. Select Journal
    • 6. ✅Notice the contents of the Book's Title field – "50 shades of white" – now appears in the Journal's Title field

I'm going to let this go for now. I do not currently have a clear idea in mind for how/if the parameters between reference types ought to be preserved/translated during switches.