Page MenuHomePhabricator

Add a useful call-to-action in the context for citation needed templates
Closed, ResolvedPublic

Assigned To
Authored By
Esanders
Dec 5 2018, 9:39 PM
Referenced Files
F30443814: image.png
Sep 23 2019, 12:10 PM
F30166756: image.png
Aug 30 2019, 12:10 PM
F29516907: image.png
Jun 13 2019, 5:22 PM
F27395096: image.png
Dec 5 2018, 9:39 PM
F27395104: image.png
Dec 5 2018, 9:39 PM
F27395111: image.png
Dec 5 2018, 9:39 PM
Tokens
"Like" token, awarded by Lens0021."Like" token, awarded by Volker_E."Love" token, awarded by Ryasmeen."Like" token, awarded by Mvolz."Love" token, awarded by Trizek-WMF.

Description

This is not very useful:

image.png (122×417 px, 14 KB)

This is more useful:

image.png (177×416 px, 13 KB)

where "Add a citation" triggers Citoid:

image.png (199×415 px, 20 KB)

Event Timeline

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

Change 477910 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/Cite@master] WIP POC: Citation needed template handling

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

This requires a per-wiki definitions file to map template names to handler code.

Proposal:

MediaWiki:Visualeditor-template-tools.json
{
  // contextItem.static.name
  "citationNeeded": [
    {
      "title": "Citation needed",
      "params": {
        "reason": "reason",
        "date": "date"
      },
    },
    {
      "title": "Cite quote",
      "params": {
        "date": "date"
      }
    },
    ...
  ]
}

This would declare that the context with the name of "citationNeeded" would match any template with the title listed. It also allows for key-mappings to be provided so that the context could show specific information.

We can pass an "encapsulate" meta-param:

it.wiki:

{
  "citationNeeded": [
    {
      "title": "Senza fonte",
      "params": {
        "encapsulate": "1"
      },
    }
  ]
}

en.wiki

{
  "citationNeeded": [
    {
      "title": "Citation needed span",
      "params": {
        "encapsulate": "text",
        "reason": "reason"
      },
    }
  ]
}

The downside of this is that we are putting all template definitions in one place (we already do this for citation mappings). Theoretically this could balloon into a very long list, but in practice we are unlikely to have that many specialised template handlers.

The alternative would be to move this information to TemplateData. The downside for that is we would need to load TD for every template on the page (even though only a small handful have a context item definition).

I think for the time being we should use the single definition file. It this list becomes unmanageable, we can add support for defining these in TD, and transition.

Change 478246 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Support for defined template context items

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

"An editor has suggested that this needs a citation. Do you have one?" // "Replace with a citation" maybe?

On en.wiki there are 60 redirects to {{Citation needed}}, two of which are actually listed in the documentation. We could allow titles to be an array for cases where the templates have identical params, or are redirects to each other.

{
  "citationNeeded": [
    {
      "title": [ "Citation needed", "cn", "fact", ... ],
      "params": {
        "reason": "reason",
        "date": "date"
      }
    }
}

Link to James' audit of en.wiki templates requiring actions: T110644#2016140

The questions below are now represented in T225750#5257515 (thank you to @Esanders for moving them)


Questions:

In March 2019, Wikipedia:Citation needed received ~280,000 pageviews via mobile web.

Some resulting questions [1]

  • Where are these visitors being referred from?
  • Where do people go after visiting?
  • What do people do after visiting?
  • What does the traffic to other guidelines, policy, etc. look like?

  1. Resulting questions: intended as mental notes

Change 478246 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Support for defined template context items

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

Change 477910 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/Cite@master] Citation needed template handling

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

@ppelberg I think your questions are tangentially relevant to this specific ticket -- this one applies to once you're within the editor, and your questions largely apply to users who're still pre-editor and reading the article.

That said, the mapping file this patch requires would be an incredibly useful prelude for another task to hook into the article-view citation-needed templates...

this one applies to once you're within the editor,

That's my fault for not specifying it in the title :)

Filed T225750.

@ppelberg I think your questions are tangentially relevant to this specific ticket -- this one applies to once you're within the editor, and your questions largely apply to users who're still pre-editor and reading the article.

That said, the mapping file this patch requires would be an incredibly useful prelude for another task to hook into the article-view citation-needed templates...

Thank you for clarifying, @DLynch.

This is going to need a help page, the main purpose of which is to explain to local admins how to identify these templates at each local wiki.

This is going to need a help page, the main purpose of which is to explain to local admins how to identify these templates at each local wiki.

Yes - although it needn't block the code release. If this is not configured on a wiki it just keeps the old behaviour.

Restyling the {{citation needed}} dialog and adding an additional call to action within it that leads contributors into the workflow for adding a citation seems like a good idea...let's do it.

Before that, a couple questions:

  • 1) In T211243#5257118 there are two calls to action: "Edit" and "Add a citation." I appreciate we likely need both [1]. Tho, I wonder if how similarly the two calls to action currently look will distract contributors. To me, they look similar enough that my attention is divided between the two. Assuming we think others will have a similar experience/reaction, what might be a better way of communicating to contributors the "Edit" action is secondary? One thought: removing the background and boarder. Tho, @Esanders, I defer to you and @iamjessklein here.
  • 2) What do you think about changing the "Edit" call to action to "Edit template" (or something similar)? Thinking: in T211243#5257118, there is no indication that this dialog is related to the {{citation needed}} template. This leads me to wonder whether contributors will a) know how to edit the {{citation needed}} template and b) what the "Edit" action does.

  1. Both calls to action: one CTA to add a citation; one CTA to edit the [citation needed] template
  1. The 'Edit' action is usually flagged as progressive, so would be blue text, but here I have manually switched it so the 'Add a citation' is blue and so slightly more prominent. We have used this pattern elsewhere when we have multiple actions in contexts. We may want to consider using the 'primary' flag, which makes buttons white-text-on-blue, but that would be a wider change. We could also swap the locations of the buttons, but that may be more confusing and have text length issues (see 2.)
  2. Perhaps, I'm a little worried about using long messages here though - I imagine "Citation needed" and "Edit template" won't fit on one line in German

Change 478246 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Support for defined template context items

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

(The above patch is just the infrastructure needed for this in VE, not the citation-needed feature itself)

I imagine "Citation needed" and "Edit template" won't fit on one line in German

I can't find any such template at dewiki. However, ruwiki seems to have one.

We're going to deploy this.

For posterity: I still hold this concern/question. Tho, not strongly enough to the point that I think it should block us deploying this and learning.

  • 2) What do you think about changing the "Edit" call to action to "Edit template" (or something similar)? Thinking: in T211243#5257118, there is no indication that this dialog is related to the {{citation needed}} template. This leads me to wonder whether contributors will a) know how to edit the {{citation needed}} template and b) what the "Edit" action does.

Change 477910 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] Citation needed template handling

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

There are 63 redirects to {{Citation needed}} on en.wiki, but just listing the first 4 most common will get us over 99% coverage:

image.png (354×427 px, 39 KB)

We need to add some documentation for this but to set this up you just need to copy the configuration file from https://en.wikipedia.org/wiki/MediaWiki:Visualeditor-template-tools-definition.json to your wiki, then change the list under "title" to be the titles of templates uses on your wiki for citation needed.

I was pointed to the CitationHunt tool, which mentions in the code that all or most wikis have a redirect at "Template:Citation needed" to the local canonical version (https://github.com/eggpi/citationhunt/blob/1fbf340f68c8539ed087ba52e40d06e343f3b5c4/config.py)

This means with a single API call we can get a list of all templates that redirect to the canonical template, e.g. in French:
https://fr.wikipedia.org/wiki/Sp%C3%A9cial:ApiSandbox#action=query&format=json&prop=redirects&titles=Template%3ACitation%20needed&redirects=1&rdlimit=500

This wouldn't help with param mapping, although at the moment those are unused.

If I get around to updating this, we many need to check the configs currently deployed:

$ mwgrep citationNeeded
enwiki              MediaWiki:Visualeditor-template-tools-definition.json
hewiki              MediaWiki:Visualeditor-template-tools-definition.json
lvwiki              MediaWiki:Visualeditor-template-tools-definition.json
slwiki              MediaWiki:Visualeditor-template-tools-definition.json

We need to add some documentation for this but to set this up you just need to copy the configuration file from https://en.wikipedia.org/wiki/MediaWiki:Visualeditor-template-tools-definition.json to your wiki, then change the list under "title" to be the titles of templates uses on your wiki for citation needed.

So... We are now starting to have a general way to have semantic annotation of special things that VE can do with various templates.

In fact we've kinda had something like this already with the Cite button and Citoid, but this appears to be next level.

An obvious question for me is why does it have to be copied. Does it make sense that at least some of these tools definitions will be global?

When I say "global" I mean two things:

  1. Global for all wikis and languages. If a wiki wants something different, then of course it can have something local. One issue with this is that template names are different in each wiki, but this can probably be resolved somehow (see https://www.mediawiki.org/wiki/Global_templates/Draft_spec#Localizing_the_template_name ).
  2. Global for all kinds of templates. Immediately obvious candidates are {{dubious}}, {{dead link}}, {{who}}, all of which are similar to {{citation needed}}. But I can also imagine special handling for templates like {{Quote}}, {{IPA}}, and many, many others.

Are there existing written plans for something like this? Or am I bringing up something like this here for the first time?

Trizek-WMF subscribed.

Amir shared the link with me and I must say that this feature makes my day. Thank you!

I have several questions about it:

  • is this feature working no matter if the template is wrapping up some text or not? Examples : {{citation needed|this is a text that needs a citation}} versus this is a text that needs a citation{{citation needed}}
  • is it deployed everywhere? If not, what's missing for a broader deployment? This is definitely food for tech news.

Anyway, <3

@Esanders, there is a now a new configuration to take into account:
frwiki MediaWiki:Visualeditor-template-tools-definition.json

This comment was removed by Johan.

Agree this is interesting and relevant for Tech News, but we would at the very least need that documentation for internationalisation first.

Has this been documented somewhere?

  1. The 'Edit' action is usually flagged as progressive, so would be blue text, but here I have manually switched it so the 'Add a citation' is blue and so slightly more prominent. We have used this pattern elsewhere when we have multiple actions in contexts. We may want to consider using the 'primary' flag, which makes buttons white-text-on-blue, but that would be a wider change. We could also swap the locations of the buttons, but that may be more confusing and have text length issues (see 2.)
  2. Perhaps, I'm a little worried about using long messages here though - I imagine "Citation needed" and "Edit template" won't fit on one line in German

"Zitat bitte, Vorlage bearbeiten"

Has this been documented somewhere?

See T265878

The announcement will wait until the documentation is ready.

Archiving regarding the announcement: the feature is live for a while now.