Page MenuHomePhabricator

Don't show "add article description" at the top of pages if short description = none
Closed, ResolvedPublic

Description

Steps to reproduce

On the Wikipedia Android app while logged in:

Information about none short descriptions: WP:SDNONE

Expected results

The option to add an article description should not be shown at the top of the page, since it has been explicitly stated as "none". The short description can still be edited using the normal edit menu ("kebab" at top right > "Edit article").

Such articles should also not be shown in suggested edits. I don't know if they can be, but if they can, they shouldn't.

Actual results

+ ADD ARTICLE DESCRIPTION button is displayed at the top of the page, even though one should not be added.

  • The button can be used as normal. If the short description text goes unchanged (e.g. none is the current value and none is entered), no edit is made (the application still notifies the user it was published). Changing the letter case (e.g. None to none) will still result in a standard edit (example edit).

Environments observed

App version: Stable: 2.7.50426-r-2022-12-08 / Beta: 2.7.50427-beta-2023-01-09
Android OS versions: 12
Device model: Motorola moto g stylus 5G (2022)
Device language: English (United States)

Event Timeline

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

Update: articles with a "none" short description also appear in suggested edits for short descriptions. Example edit. This could probably just be assumed anyway, but I just wanted to mention this.

gabldotink removed the point value 1 for this task.Feb 2 2023, 3:13 PM

Change 885479 had a related patch set uploaded (by Vadim Kovalenko; author: Vadim Kovalenko):

[mediawiki/services/mobileapps@master] [Poc] Mobileapps:Don't show "add article description" at the top of pages if short description = none

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

Though mobileapps doesn't handle any implicit information that comes from templates, I decided to implement PoC patch which solves the problem, but in another hand adds an additional layer of complexity for the transformation module. The only information that we can manipulate here is the Parsoid HTML. For articles without short description explicitly set by wikitext it has <span> element with data-mw attribute. At the same time, this node is empty which is the signal for MobileHTML to strip it, so I've applied extra method to check whether this span was created by {{Short description|none}} wikitext and then passed this info downstream to create a mobile header. Please, let me know what you think of the approach I used in the patch.
cc: @MSantos , @Jgiannelos

We should be using the Wikidata api to get short descriptions, instead of trying to look for a specific template (or magic word).

The template on enwiki uses a parser magic word, which is defined by the Wikibase extension, and writes the wikibase-shortdesc page property: https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/client/includes/Hooks/ShortDescHandler.php#L84

On english wikipedia this uses [[Template::Short description]] which if you look at the source invokes the {{SHORTDESC}} magic word, defined above: https://en.wikipedia.org/wiki/Template:Short_description

This links to all the discussion on the topic: https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Short_descriptions#Discussions

This is where you can see that this behavior is only enabled on enwiki and testwiki: https://github.com/wikimedia/operations-mediawiki-config/blob/master/wmf-config/InitialiseSettings.php#L15415

The Wikibase code which returns the short description is here, and it uses this setting to determine whether to source the short description from wikibase or from the page property:
https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/client/includes/Hooks/DescriptionProviderHookHandler.php#L36https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/client/includes/Store/DescriptionLookup.php

And this is the external API which provides this information:
https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/client/includes/Api/Description.php

So that last is where we should be looking to get the short description, and then presumably showing the warning only if the above API returns nothing; although the Wikiproject mentions just searching for the template: https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Short_descriptions#How_do_I_find_articles_with_no_short_description%3F -- but if we used this criterion it would work only for enwiki, and would falsely indicate all articles outside english wikipedia are missing short descriptions.

We probably need to set up a conversation with Wikidata/WMDE about whether they are comfortable with representing "no short description wanted" as the empty string in wikidata. If so, then there's a trivial change to https://en.wikipedia.org/wiki/Template:Short_description which will set the short description to '' if none is passed, and @vadim-kovalenko can simply look for '' in the short description API output to indicate that the "add short description" button should be suppressed. If wikidata would prefer to use some other representation of the 'none' case (aka, "no short description wanted for this item") then it's a little more complicated, but presumably we'd still use the wikidata API to identify the 'none' case.

If wikidata /doesn't/ want to represent this case, making it "just" an enwiki feature, then I guess there's no better solution other than to have @vadim-kovalenko look through the parsoid HTML output for the template arguments and match against the english string 'none'. As documented at https://www.mediawiki.org/wiki/Specs/HTML/2.7.0#Template_markup you'd be looking for nodes with document.querySelectorAll('[typeof="mw:Transclusion"]') and then deserializing the data-mw attribute and looking for mw.parts[0].template.target.href === './Template:Short_description' and mw.parts[0].template.params["1"].wt === 'none' -- which is pretty hacky and ugly. A regexp on the raw wikitext is also possible and also ugly. Probably "better" would be to update [[Template:Short description]] to add pages with 'none' to a special category, and then we can check for that category instead of trying to pull out the template arguments.

But step 1 is to ask Wikidata how they would like {{Short description|none}} represented in wikidata. If there's a universal representation they can adopt, then we can continue to use the wikidata short description API for this instead of having to resort to enwiki-specific workarounds.

Change 893034 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/extensions/Wikibase@master] WIP add 'none' flag to {{SHORTDESC}}

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

From chat with WMDE:

@Lucas_Werkmeister_WMDE:

I think {{SHORTDESC:}} (literally, i.e. with empty argument) could work, something like this:

  • the magic word would cause its argument to be saved as the local short description, even if it’s empty
  • the prop=description API would allow any present local description to override the central (Wikidata) one, even if it’s empty
  • if you don’t want to override the central description, don’t use {{SHORTDESC:}} (i.e. wrap it in something like {{#if:{{{desc|}}}|{{SHORTDESC:{{{desc}}}|}} or whatever the right wikitext incantation is)
  • the mobile app can interpret an empty local description however it likes, e.g. as “this has been explicitly set to empty and is not a call to action from the reader”
  • Wikidata descriptions can never be empty (only absent), as far as the Wikidata data model is concerned at least, so there should be no risk of confusion
    • though I’m not sure how the prop=description API currently handles absent Wikidata descriptions… tricky to test in the status quo

whether the short description is needed or not would still be an editorial decision of the client wiki (English Wikipedia) in this scenario, which I think is fine – in Wikidata, AFAIK missing descriptions are generally considered okay if not needed for disambiguation, so we don’t need an explicit “none” marker there [...] and I think this would also work well for wikis that don’t [...] disabl[e] Wikidata descriptions even as a fallback (wmgWikibaseForceLocalShortDesc)

@Lydia_Pintscher:

Yeah that sounds acceptable to me if that solves the issue. Also as Lucas says the issue is with the turned off fallback. We can generally imagine having this enabled with fallback on more wikis in the future if needed.

@Jdlrobson:

A solution here would also help with T225529: Article tagline should be set by a hook, not by code highly coupled with Wikibase

@cscott:

So Lucas' solution might still require a wikibase patch to make the fallbacks and API work as expected with an empty string value, I'll take a look at that in a little bit.
For T225529 it seems like it would be straightforward to create a hook in core which wikibase could implement using DescriptionLookup. If the short description stuff ever moves elsewhere then the hook implementation would move with it. That's the first option from T225529#7797034. "Empty string" is probably the right value to return for the "none" case here as well.

On wiki discussion with [[en:User:Jonesey95]] at https://en.wikipedia.org/wiki/Wikipedia_talk:Short_description#WP:SDNONE noted problems getting the overrides to work correctly (see https://en.wikipedia.org/wiki/Wikipedia_talk:Short_description#Possible_mismatch_when_generating_for_mobile_versus_desktop?) so it sounds like @Lucas_Werkmeister_WMDE's solution above would probably fix some of these corner cases in the override mechanism as well.

Change 885479 abandoned by Vadim Kovalenko:

[mediawiki/services/mobileapps@master] [Poc] Mobileapps:Don't show "add article description" at the top of pages if short description = none

Reason:

The solution doesn't guarantee filtering the suitable template and can be considered an antipattern (PCS isn't supposed to intercept templates).

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

Change #1059116 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/extensions/Wikibase@master] Allow empty string as short description

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

Change #893034 abandoned by C. Scott Ananian:

[mediawiki/extensions/Wikibase@master] WIP add 'none' flag to {{SHORTDESC}}

Reason:

Abandoned in favor of I4d6814437d38412c51c24b0637a10225472f5d0e as per T326898#8654683

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

The above patch https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/1059116 implements the first step in the consensus plan above (T326898#8654683 ), which is just to allow the empty string ('') to be treated as a valid short description value.

Once that is done and deployed, I think there might be two followups needed:

  • enwiki might need to tweak some of their templates to use {{SHORTDESC:}} instead of the hard-coded string 'none' which is I think what they currently use?
  • the mobile app might need to have code added to suppress their "call to action" to add a shortdesc if shortdesc == '' --- but this might not be necessary, it depends on how exactly their code is written and whether it recognizes '' as a valid already-existing short description.

I believe @Jdlrobson proposed T225529 as a potential refactor, but I think that's orthogonal and isn't needed to resolve this task.

I wonder if we need to announce this change according to the stable interface policy. IMHO the fact that the description can now be present and empty can be said to “[violate] guarantees given or widely assumed before” (i.e. a breaking change); on the other hand, the prop=description module of the action=query API is marked as internal. Are these short descriptions exposed anywhere else?

I wonder if we need to announce this change according to the stable interface policy. IMHO the fact that the description can now be present and empty can be said to “[violate] guarantees given or widely assumed before” (i.e. a breaking change); on the other hand, the prop=description module of the action=query API is marked as internal. Are these short descriptions exposed anywhere else?

Given that this is marked internal, let's not go through the breaking change process for this.

Change #1059116 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Allow empty string as short description

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

The wikibase patch has rolled out to production. The empty string ('') is now a valid short description value, which means "there should be no short description for this item".

The remaining steps, from T326898#10036057, are:

  • enwiki needs to tweak some of their templates to use {{SHORTDESC:}} instead of the hard-coded string 'none' which is I think what they currently use?
  • the mobile app/PCS needs to have code added to suppress their "call to action" to add a shortdesc if shortdesc == ''
Quiddity subscribed.

I'll remove the Tech News tag, because this should just be communicated to a single wiki.

Change #1100464 had a related patch set uploaded (by Dbrant; author: Dbrant):

[mediawiki/services/mobileapps@master] Treat empty short descriptions as valid.

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

Change #1100464 merged by jenkins-bot:

[mediawiki/services/mobileapps@master] Treat empty short descriptions as valid.

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

All the updates have been deployed, but it looks like there are some loose ends:

  • SDNONE still has some pretty ingrained guidance about using none for the intentionally-empty case. Should someone update that page?
  • The shortdec-helper gadget still treats none as the intentional case, and treats an empty description with a CTA to "add" a description. This would need to be updated, too.

Received from the support email:
"The Wikipedia Android app suggests users add short descriptions to articles with the {{short description|none}} template. For an example, see "Domestication of the cat" on enwiki. That template with the value set to none is used to mean a short description is not needed, i.e. the title is descriptive enough. When users add short descriptions to those articles, they end up being confusing because they either restate the title or say something that shouldn't be in a short description."

Screenshot_20241205_165706_Wikipedia (1).jpg (2×1 px, 868 KB)

Screenshot_20241205_165713_Wikipedia (1).jpg (2×1 px, 828 KB)

Screenshot_20241205_165839_Wikipedia (1).jpg (2×1 px, 746 KB)

Screenshot_20241205_165843_Wikipedia (1).jpg (2×1 px, 664 KB)

Received from the support email:
"The Wikipedia Android app suggests users add short descriptions to articles with the {{short description|none}} template. For an example, see "Domestication of the cat" on enwiki. That template with the value set to none is used to mean a short description is not needed, i.e. the title is descriptive enough. When users add short descriptions to those articles, they end up being confusing because they either restate the title or say something that shouldn't be in a short description."

Yes, this is the bug as described in the original report. According to developers, "All the updates have been deployed", which is always confusing to normal humans, because it usually means that "All of the updates will show up on MWF wikis in a week or two".

The goal of this bug report is to make it so that Android app users are not encouraged to submit short descriptions when the four-character string "none" is already present as a short description.

All the updates have been deployed, but it looks like there are some loose ends:

  • SDNONE still has some pretty ingrained guidance about using none for the intentionally-empty case. Should someone update that page?
  • The shortdec-helper gadget still treats none as the intentional case, and treats an empty description with a CTA to "add" a description. This would need to be updated, too.

It is unclear what is meant by this comment. The four-letter short description of "none" is the correct format for an article that does not need a short description. I reviewed the guidance and do not see anything that needs to be changed.

Possible bug: An editor using the Android app reports that they were prompted to add a short description to an article that already had a short description of "None". This should not be happening. Please investigate. See https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Short_description&oldid=1267806510#Is_none_case-sensitive?

This is still happening. It's been two years since this apparently simple bug was reported. Please fix. https://en.wikipedia.org/w/index.php?title=Economy_of_Spokane,_Washington&curid=21067578&diff=1272521263&oldid=1265830445

The templates on enwiki were never updated. I don't have permissions to fix it myself, but I've made an edit request at: https://en.wikipedia.org/wiki/Wikipedia_talk:Short_description#Protected_edit_request_on_29_January_2025

Once the templates on enwiki are fixed, the apps can implement the correct logic (they may or may not already do so).

Template:Short description on en.WP has been modified as requested.

I think that this issue is not reproduced anymore. For example for this article:
https://en.wikipedia.org/wiki/2016_United_States_presidential_election

  • I verified that it has short description | none [1]
  • Using the android studio I open the app and visit this article [2]
  • No call for add article description as shown on the reports

@Dbrant Is there something I am missing or this issue is resolved?

[1]

image.png (1×2 px, 511 KB)

[2]

image.png (2×1 px, 694 KB)